Search in sources :

Example 6 with RowGetterFactory

use of org.simpleflatmapper.datastax.impl.RowGetterFactory in project SimpleFlatMapper by arnaudroger.

the class RowGetterFactoryTest method testDoubleGetterOnNullValue.

@Test
public void testDoubleGetterOnNullValue() throws Exception {
    when(row.isNull(1)).thenReturn(true);
    assertEquals(null, new RowGetterFactory(null).newGetter(Double.class, columnKey).get(row));
}
Also used : RowGetterFactory(org.simpleflatmapper.datastax.impl.RowGetterFactory) Test(org.junit.Test)

Example 7 with RowGetterFactory

use of org.simpleflatmapper.datastax.impl.RowGetterFactory in project SimpleFlatMapper by arnaudroger.

the class RowGetterFactoryTest method testBooleanGetterOnNullValue.

@Test
public void testBooleanGetterOnNullValue() throws Exception {
    when(row.isNull(1)).thenReturn(true);
    assertEquals(null, new RowGetterFactory(null).newGetter(Boolean.class, columnKey).get(row));
}
Also used : RowGetterFactory(org.simpleflatmapper.datastax.impl.RowGetterFactory) Test(org.junit.Test)

Example 8 with RowGetterFactory

use of org.simpleflatmapper.datastax.impl.RowGetterFactory in project SimpleFlatMapper by arnaudroger.

the class RowGetterFactoryTest method testLongGetterOnNullValue.

@Test
public void testLongGetterOnNullValue() throws Exception {
    when(row.isNull(1)).thenReturn(true);
    assertEquals(null, new RowGetterFactory(null).newGetter(Long.class, columnKey).get(row));
}
Also used : RowGetterFactory(org.simpleflatmapper.datastax.impl.RowGetterFactory) Test(org.junit.Test)

Example 9 with RowGetterFactory

use of org.simpleflatmapper.datastax.impl.RowGetterFactory in project SimpleFlatMapper by arnaudroger.

the class RowGetterFactoryTest method testShortGetterOnNullValue.

@Test
public void testShortGetterOnNullValue() throws Exception {
    when(row.isNull(1)).thenReturn(true);
    assertEquals(null, new RowGetterFactory(null).newGetter(Short.class, columnKey.datatype(DataType.bigint())).get(row));
}
Also used : RowGetterFactory(org.simpleflatmapper.datastax.impl.RowGetterFactory) Test(org.junit.Test)

Aggregations

RowGetterFactory (org.simpleflatmapper.datastax.impl.RowGetterFactory)9 Test (org.junit.Test)7 DatastaxColumnKey (org.simpleflatmapper.datastax.DatastaxColumnKey)2 GettableByIndexData (com.datastax.driver.core.GettableByIndexData)1 DatastaxMappingContextFactoryBuilder (org.simpleflatmapper.datastax.impl.DatastaxMappingContextFactoryBuilder)1 ConstantSourceMapperBuilder (org.simpleflatmapper.map.mapper.ConstantSourceMapperBuilder)1 MapperSourceImpl (org.simpleflatmapper.map.mapper.MapperSourceImpl)1 FieldMapperColumnDefinition (org.simpleflatmapper.map.property.FieldMapperColumnDefinition)1