Skip to content

Commit

Permalink
Merge pull request #11 from AdysTech/wip
Browse files Browse the repository at this point in the history
Release 0.5 version
  • Loading branch information
mvadu committed Apr 16, 2016
2 parents 4996edd + 98e2518 commit 5d626cb
Show file tree
Hide file tree
Showing 11 changed files with 205 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>InfluxDB.Client.Test</RootNamespace>
<AssemblyName>InfluxDB.Client.Test</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -61,6 +62,11 @@
<Name>AdysTech.InfluxDB.Client.Net</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Tests.orderedtest">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion AdysTech.InfluxDB.Client.Net.Test/DataGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static double RandomDouble()

public static string RandomString()
{
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ,=/\\";
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ,=/";
var stringChars = new StringBuilder (16, 16);

for ( int i = 0; i < stringChars.Capacity; i++ )
Expand Down
29 changes: 8 additions & 21 deletions AdysTech.InfluxDB.Client.Net.Test/InfluxDBClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,6 @@ public async Task TestGetInfluxDBNamesAsync_ServiceUnavailable()
var r = await client.GetInfluxDBNamesAsync();
}

//[TestMethod]
//[ExpectedException(typeof(UnauthorizedAccessException))]
//public async Task TestGetInfluxDBNamesAsync_Auth()
//{
// var client = new InfluxDBClient(influxUrl);
// var r = await client.GetInfluxDBNamesAsync();
//}


//[TestMethod]
//[ExpectedException(typeof(UnauthorizedAccessException))]
//public async Task TestGetInfluxDBNamesAsync_Auth2()
//{
// var client = new InfluxDBClient(influxUrl, invalidUName, dbpwd);
// var r = await client.GetInfluxDBNamesAsync();
//}



[TestMethod]
public async Task TestGetInfluxDBNamesAsync()
{
Expand Down Expand Up @@ -164,10 +145,16 @@ public async Task TestQueryAsync()
}

[TestMethod]
public async Task TestQueryAsync_MultiSeries()
public async Task TestQueryMultiSeriesAsync()
{
var client = new InfluxDBClient(influxUrl, dbUName, dbpwd);
var r = await client.QueryMultiSeriesAsync("_internal", "Show field keys");

Stopwatch s = new Stopwatch();
s.Start();
var r = await client.QueryMultiSeriesAsync("_internal", "SHOW STATS");

s.Stop();
Debug.WriteLine("Elapsed{0}", s.ElapsedMilliseconds);
Assert.IsTrue(r != null && r.Count > 0, "QueryMultiSeriesAsync retunred null or invalid data");
}

Expand Down
22 changes: 22 additions & 0 deletions AdysTech.InfluxDB.Client.Net.Test/Tests.orderedtest
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<OrderedTest name="tests" storage="e:\visual studio projects\console\influxdb.client.net\adystech.influxdb.client.net.test\tests.orderedtest" id="ae8a7c43-c134-4ca0-8c92-bb18e7ee9a52" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<TestLinks>
<TestLink id="57d01cf9-83ef-a005-0f85-eb5792247c78" name="TestGetInfluxDBNamesAsync_ServiceUnavailable" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="9058be20-12ae-1e8a-f312-8b02d9c07c05" name="TestGetInfluxDBNamesAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="67797d4e-b1d0-c575-40ac-6dc644dba8bc" name="TestCreateDatabaseAsync_InvalidName" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="532c19b5-ea6f-7493-b6d5-a1d2fa80cf18" name="TestCreateDatabaseAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="2c6bcc58-eaf5-7f2e-2b7b-729cbf03814d" name="TestGetRetentionPoliciesAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="7ea260f2-0906-a35a-2113-4c026c5612a9" name="TestCreateRetentionPolicy" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="5f73da07-603f-a3cd-63b0-4cd60d51017e" name="TestGetInfluxDBStructureAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="a07759b7-7705-cd3b-4cfc-32ec6481d258" name="TestGetInfluxDBStructureAsync_InvalidDB" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="1b9c2e37-956b-53ca-1d60-95e7a1ba8945" name="TestGetServerVersionAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="0fcf513b-dd30-6a18-48ac-393796540954" name="TestQueryAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="53cf4c7c-91be-9ef6-6a88-f63a16979ee9" name="TestQueryMultiSeriesAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="6001049c-1b46-8498-b0d8-f808d2fe3833" name="TestPostPointsAsync_PartialWrite" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="44e1133f-177e-5d30-ba36-52eaa5600717" name="TestPostPointsAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="055ba1a3-9cd7-e3ed-cb3b-bba752d90066" name="TestPostPointAsyncNonDefaultRetention" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="0242c815-8578-05d6-d171-01aaf80218cd" name="TestPostPointAsync_InvalidReq" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="8297f3de-98f5-89e1-6696-05ea3860a846" name="TestPostMixedPointAsync" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<TestLink id="5f4cd12a-b9b1-1b27-476e-835a2aa4d1c1" name="TestPostPointsAsync_Batch" storage="bin\debug\influxdb.client.test.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</TestLinks>
</OrderedTest>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AdysTech.InfluxDB.Client.Net</RootNamespace>
<AssemblyName>AdysTech.InfluxDB.Client.Net</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -34,6 +35,7 @@
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand Down
15 changes: 8 additions & 7 deletions AdysTech.InfluxDB.Client.Net/DataContracts/InfluxJsonTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,31 @@ namespace AdysTech.InfluxDB.Client.Net.DataContracts
[DataContract]
public class Series
{
[DataMember(Name="name")]
public string SeriesName { get; set; }
[DataMember(Name = "name")]
public string Name { get; set; }

[DataMember(Name = "tags")]
public Dictionary<string,string> Tags { get; set; }

[DataMember (Name = "columns")]
public List<string> ColumnHeaders { get; set; }
[DataMember(Name = "columns")]
public List<string> Columns { get; set; }

[DataMember (Name = "values")]
[DataMember(Name = "values")]
public List<List<string>> Values { get; set; }

}

[DataContract]
public class Result
{
[DataMember (Name = "series")]
[DataMember(Name = "series")]
public List<Series> Series { get; set; }
}

[DataContract]
public class InfluxResponse
{
[DataMember (Name = "results")]
[DataMember(Name = "results")]
public List<Result> Results { get; set; }
}
}
Loading

0 comments on commit 5d626cb

Please sign in to comment.