Permalink
Browse files

added thrift from latest build

  • Loading branch information...
nberardi committed Sep 5, 2010
1 parent 9e8c988 commit 50d830b25d508ea86e84479e3d9bf07042224044
@@ -53,6 +53,7 @@
<Compile Include="CassandraQueryTest.cs" />
<Compile Include="Connection\ConnectionProviderTest.cs" />
<Compile Include="Connection\NormalConnectionProviderTest.cs" />
+ <Compile Include="_CassandraSetup.cs" />
<Compile Include="FluentSuperColumnFamilyTest.cs" />
<Compile Include="FluentColumnFamilyTest.cs" />
<Compile Include="FluentColumnTest.cs" />
@@ -81,7 +82,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <Content Include="Test.Keyspace.xml" />
+ <None Include="Test.Keyspace.yaml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -41,7 +41,7 @@ public void ColumnFamily_Key()
_family.InsertColumn(_testKey, "Test3", Math.PI);
// act
- int actual = _family.ColumnCount(_testKey);
+ int actual = _family.ColumnCount(_testKey, null, null);
// assert
Assert.AreEqual(expected, actual);
@@ -57,7 +57,7 @@ public void SuperColumnFamily_Key()
_superFamily.InsertColumn(_testKey, _testSuperName, "Test3", Math.PI);
// act
- int actual = _superFamily.ColumnCount(_testKey);
+ int actual = _superFamily.ColumnCount(_testKey, null, null);
// assert
Assert.AreEqual(expected, actual);
@@ -73,7 +73,7 @@ public void SuperColumnFamily_Key_And_SuperColumnName()
_superFamily.InsertColumn(_testKey, _testSuperName, "Test3", Math.PI);
// act
- int actual = _superFamily.ColumnCount(_testKey, _testSuperName);
+ int actual = _superFamily.ColumnCount(_testKey, _testSuperName, null, null);
// assert
Assert.AreEqual(expected, actual);
@@ -55,7 +55,7 @@ public void Standard_GetSlice_Columns()
int expectedCount = 2;
// act
- var columns = _family.Get(new[] { _testKey, _testKey2 }, new AsciiType[] { "Test1", "Test2" });
+ var columns = _family.Get(new BytesType[] { _testKey, _testKey2 }, new AsciiType[] { "Test1", "Test2" });
// assert
Assert.AreEqual(expectedCount, columns.Count());
@@ -68,7 +68,7 @@ public void Super_GetSlice_Columns()
int expectedCount = 2;
// act
- var columns = _superFamily.GetSuperColumns(new[] { _testKey, _testKey2 }, _testSuperName, new AsciiType[] { "Test1", "Test2" });
+ var columns = _superFamily.GetSuperColumns(new BytesType[] { _testKey, _testKey2 }, _testSuperName, new AsciiType[] { "Test1", "Test2" });
// assert
Assert.AreEqual(expectedCount, columns.Count());
@@ -81,7 +81,7 @@ public void Super_GetSuperSlice_Columns()
int expectedCount = 2;
// act
- var columns = _superFamily.Get(new[] { _testKey, _testKey2 }, new AsciiType[] { _testSuperName });
+ var columns = _superFamily.Get(new BytesType[] { _testKey, _testKey2 }, new AsciiType[] { _testSuperName });
// assert
Assert.AreEqual(expectedCount, columns.Count());
@@ -94,7 +94,7 @@ public void Standard_GetSlice_Range()
int expectedCount = 2;
// act
- var columns = _family.Get(new[] { _testKey, _testKey2 }, _testName, null, columnCount: 2);
+ var columns = _family.Get(new BytesType[] { _testKey, _testKey2 }, _testName, null, columnCount: 2);
// assert
Assert.AreEqual(expectedCount, columns.Count());
@@ -107,7 +107,7 @@ public void Super_GetSlice_Range()
int expectedCount = 2;
// act
- var columns = _superFamily.GetSuperColumns(new[] { _testKey, _testKey2 }, _testSuperName, _testName, null, columnCount: 2);
+ var columns = _superFamily.GetSuperColumns(new BytesType[] { _testKey, _testKey2 }, _testSuperName, _testName, null, columnCount: 2);
// assert
Assert.AreEqual(expectedCount, columns.Count());
@@ -120,7 +120,7 @@ public void Super_GetSuperSlice_Range()
int expectedCount = 2;
// act
- var columns = _superFamily.Get(new[] { _testKey, _testKey2 }, _testSuperName, null, columnCount: 1);
+ var columns = _superFamily.Get(new BytesType[] { _testKey, _testKey2 }, _testSuperName, null, columnCount: 1);
// assert
Assert.AreEqual(expectedCount, columns.Count());
@@ -49,7 +49,7 @@ public void Standard_RemoveColumn()
_family.RemoveColumn(_testKey, _testName);
// assert
- int actualCount = _family.ColumnCount(_testKey);
+ int actualCount = _family.ColumnCount(_testKey, null, null);
Assert.AreEqual(expectedCount, actualCount);
}
@@ -63,7 +63,7 @@ public void Standard_RemoveKey()
_family.RemoveKey(_testKey);
// assert
- int actualCount = _family.ColumnCount(_testKey);
+ int actualCount = _family.ColumnCount(_testKey, null, null);
Assert.AreEqual(expectedCount, actualCount);
}
@@ -77,7 +77,7 @@ public void Super_RemoveColumn()
_superFamily.RemoveColumn(_testKey, _testSuperName, _testName);
// assert
- int actualCount = _superFamily.ColumnCount(_testKey, _testSuperName);
+ int actualCount = _superFamily.ColumnCount(_testKey, _testSuperName, null, null);
Assert.AreEqual(expectedCount, actualCount);
}
@@ -91,7 +91,7 @@ public void Super_RemoveSuperColumn()
_superFamily.RemoveSuperColumn(_testKey, _testSuperName);
// assert
- int actualCount = _superFamily.ColumnCount(_testKey);
+ int actualCount = _superFamily.ColumnCount(_testKey, null, null);
Assert.AreEqual(expectedCount, actualCount);
}
@@ -105,7 +105,7 @@ public void Super_RemoveKey()
_superFamily.RemoveKey(_testKey);
// assert
- int actualCount = _superFamily.ColumnCount(_testKey);
+ int actualCount = _superFamily.ColumnCount(_testKey, null, null);
Assert.AreEqual(expectedCount, actualCount);
}
}
@@ -1,12 +0,0 @@
-<Keyspace Name="Testing">
- <ColumnFamily Name="Standard"
- CompareWith="AsciiType"/>
- <ColumnFamily Name="Super"
- ColumnType="Super"
- CompareWith="AsciiType"
- CompareSubcolumnsWith="AsciiType" />
-
- <ReplicaPlacementStrategy>org.apache.cassandra.locator.RackUnawareStrategy</ReplicaPlacementStrategy>
- <ReplicationFactor>1</ReplicationFactor>
- <EndPointSnitch>org.apache.cassandra.locator.EndPointSnitch</EndPointSnitch>
-</Keyspace>
@@ -0,0 +1,11 @@
+ - name: Testing
+ replica_placement_strategy: org.apache.cassandra.locator.RackUnawareStrategy
+ replication_factor: 1
+ column_families:
+ - name: Standard
+ compare_with: AsciiType
+
+ - name: Super
+ column_type: Super
+ compare_with: AsciiType
+ compare_subcolumns_with: AsciiType
@@ -5,7 +5,7 @@
using System.Text;
using System.Linq;
-namespace FluentCassandra.Test
+namespace FluentCassandra.Test.Types
{
[TestClass]
public class AsciiTypeTest
@@ -10,6 +10,19 @@ namespace FluentCassandra.Test.Types
[TestClass]
public class BytesTypeTest
{
+ [TestMethod]
+ public void String_To_BytesType()
+ {
+ // arrange
+ string expected = "Something Good";
+
+ // act
+ BytesType actual = expected;
+
+ // assert
+ Assert.AreEqual(expected, (string)actual);
+ }
+
[TestMethod]
public void Double_To_BytesType()
{
@@ -5,7 +5,7 @@
using System.Text;
using System.Linq;
-namespace FluentCassandra.Test
+namespace FluentCassandra.Test.Types
{
[TestClass]
public class LongTypeTest
@@ -5,7 +5,7 @@
using System.Text;
using System.Linq;
-namespace FluentCassandra.Test
+namespace FluentCassandra.Test.Types
{
[TestClass]
public class NullTypeTest
@@ -20,17 +20,10 @@ public class NullTypeTest
[TestInitialize]
public void TestInit()
{
- _db = new CassandraContext("Testing", "localhost");
- _family = _db.GetColumnFamily<AsciiType>("Standard");
- _superFamily = _db.GetColumnFamily<AsciiType, AsciiType>("Super");
-
- _family.InsertColumn(_testKey, "Test1", Math.PI);
- _family.InsertColumn(_testKey, "Test2", Math.PI);
- _family.InsertColumn(_testKey, "Test3", Math.PI);
-
- _superFamily.InsertColumn(_testKey, _testSuperName, "Test1", Math.PI);
- _superFamily.InsertColumn(_testKey, _testSuperName, "Test2", Math.PI);
- _superFamily.InsertColumn(_testKey, _testSuperName, "Test3", Math.PI);
+ var setup = new _CassandraSetup();
+ _db = setup.DB;
+ _family = setup.Family;
+ _superFamily = setup.SuperFamily;
}
[TestCleanup]
@@ -5,7 +5,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using FluentCassandra.Types;
-namespace FluentCassandra.Test.Types
+namespace FluentCassandra.Test.Types.Types
{
[TestClass]
public class TimeUUIDTypeTest
@@ -5,7 +5,7 @@
using System.Text;
using System.Linq;
-namespace FluentCassandra.Test
+namespace FluentCassandra.Test.Types
{
[TestClass]
public class UTF8TypeTest
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using FluentCassandra.Types;
+using Apache.Cassandra;
+
+namespace FluentCassandra.Test
+{
+ internal class _CassandraSetup
+ {
+ public CassandraContext DB;
+ public CassandraColumnFamily<AsciiType> Family;
+ public CassandraSuperColumnFamily<AsciiType, AsciiType> SuperFamily;
+
+ public const string TestKey = "Test1";
+ public const string TestStandardName = "Test1";
+ public const string TestSuperName = "SubTest1";
+
+ public _CassandraSetup()
+ {
+ var keyspace = "Testing";
+ var server = new Server("localhost");
+
+ var ksDef = new KsDef {
+ Name = "Testing",
+ Replication_factor = 1,
+ Strategy_class = "org.apache.cassandra.locator.RackUnawareStrategy",
+ Cf_defs = new List<CfDef>()
+ };
+
+ ksDef.Cf_defs.Add(new CfDef {
+ Name = TestStandardName,
+ Keyspace = "Testing",
+ Column_type = "Standard",
+ Comparator_type = "AsciiType",
+ Comment = "Used for testing Standard family."
+ });
+
+ ksDef.Cf_defs.Add(new CfDef {
+ Name = TestSuperName,
+ Keyspace = "Testing",
+ Column_type = "Super",
+ Comparator_type = "AsciiType",
+ Subcomparator_type = "AsciiType",
+ Comment = "Used for testing Super family."
+ });
+
+ CassandraSession.AddKeyspace(server, ksDef);
+
+ DB = new CassandraContext(keyspace, server);
+ Family = DB.GetColumnFamily<AsciiType>("Standard");
+ SuperFamily = DB.GetColumnFamily<AsciiType, AsciiType>("Super");
+
+ Family.InsertColumn(TestKey, "Test1", Math.PI);
+ Family.InsertColumn(TestKey, "Test2", Math.PI);
+ Family.InsertColumn(TestKey, "Test3", Math.PI);
+
+ SuperFamily.InsertColumn(TestKey, TestSuperName, "Test1", Math.PI);
+ SuperFamily.InsertColumn(TestKey, TestSuperName, "Test2", Math.PI);
+ SuperFamily.InsertColumn(TestKey, TestSuperName, "Test3", Math.PI);
+ }
+ }
+}
Oops, something went wrong.

0 comments on commit 50d830b

Please sign in to comment.