Search in sources :

Example 11 with IThriftPool

use of org.scale7.cassandra.pelops.pool.IThriftPool in project scale7-pelops by s7.

the class MutatorIntegrationTest method testNewColumnWithTTLDefaultFromMemberVariable.

@Test
public void testNewColumnWithTTLDefaultFromMemberVariable() {
    IThriftPool pool = Mockito.mock(IThriftPool.class);
    Mutator mutator = new Mutator(pool, Long.MAX_VALUE, true, Integer.MAX_VALUE);
    Column column = mutator.newColumn(Bytes.fromUTF8("a"), Bytes.fromUTF8("b"));
    assertEquals("column name is not in the expected state", Bytes.fromUTF8("a").getBytes(), column.name);
    assertEquals("column value is not in the expected state", Bytes.fromUTF8("b").getBytes(), column.value);
    assertEquals("column TTL is not in the expected state", Integer.MAX_VALUE, column.ttl);
}
Also used : Column(org.apache.cassandra.thrift.Column) IThriftPool(org.scale7.cassandra.pelops.pool.IThriftPool) Test(org.junit.Test) AbstractIntegrationTest(org.scale7.cassandra.pelops.support.AbstractIntegrationTest)

Aggregations

IThriftPool (org.scale7.cassandra.pelops.pool.IThriftPool)11 Test (org.junit.Test)7 AbstractIntegrationTest (org.scale7.cassandra.pelops.support.AbstractIntegrationTest)7 Column (org.apache.cassandra.thrift.Column)4 CommonsBackedPool (org.scale7.cassandra.pelops.pool.CommonsBackedPool)2 Mutation (org.apache.cassandra.thrift.Mutation)1 DebuggingPool (org.scale7.cassandra.pelops.pool.DebuggingPool)1