Search in sources :

Example 21 with SampleFieldKey

use of org.simpleflatmapper.test.map.SampleFieldKey in project SimpleFlatMapper by arnaudroger.

the class AbstractMapperFactoryTest method testKeys.

@Test
public void testKeys() {
    MapperFactory mapperFactory = new MapperFactory();
    mapperFactory.addKeys("a", "b");
    Assert.assertArrayEquals(new Object[] { KeyProperty.DEFAULT }, mapperFactory.columnDefinitions().getColumnDefinition(new SampleFieldKey("a", 0)).properties());
    Assert.assertArrayEquals(new Object[] { KeyProperty.DEFAULT }, mapperFactory.columnDefinitions().getColumnDefinition(new SampleFieldKey("b", 0)).properties());
    Assert.assertArrayEquals(new Object[] {}, mapperFactory.columnDefinitions().getColumnDefinition(new SampleFieldKey("c", 0)).properties());
}
Also used : AbstractMapperFactory(org.simpleflatmapper.map.mapper.AbstractMapperFactory) SampleFieldKey(org.simpleflatmapper.test.map.SampleFieldKey) Test(org.junit.Test)

Aggregations

SampleFieldKey (org.simpleflatmapper.test.map.SampleFieldKey)21 Test (org.junit.Test)19 AbstractMapperFactory (org.simpleflatmapper.map.mapper.AbstractMapperFactory)7 FieldMapperColumnDefinition (org.simpleflatmapper.map.property.FieldMapperColumnDefinition)6 DbObject (org.simpleflatmapper.test.beans.DbObject)4 ConstantSourceMapperBuilder (org.simpleflatmapper.map.mapper.ConstantSourceMapperBuilder)3 DbFinal1DeepObject (org.simpleflatmapper.test.beans.DbFinal1DeepObject)3 DbFinalObject (org.simpleflatmapper.test.beans.DbFinalObject)3 DbListObject (org.simpleflatmapper.test.beans.DbListObject)3 DbPartialFinalObject (org.simpleflatmapper.test.beans.DbPartialFinalObject)3 Type (java.lang.reflect.Type)2 ArrayList (java.util.ArrayList)2 FieldMapperErrorHandler (org.simpleflatmapper.map.FieldMapperErrorHandler)2 MapperBuildingException (org.simpleflatmapper.map.MapperBuildingException)2 MappingException (org.simpleflatmapper.map.MappingException)2 BreakDetectorMappingContextFactory (org.simpleflatmapper.map.context.impl.BreakDetectorMappingContextFactory)2 RethrowConsumerErrorHandler (org.simpleflatmapper.map.error.RethrowConsumerErrorHandler)2 RethrowMapperBuilderErrorHandler (org.simpleflatmapper.map.error.RethrowMapperBuilderErrorHandler)2 IdentityFieldMapperColumnDefinitionProvider (org.simpleflatmapper.map.impl.IdentityFieldMapperColumnDefinitionProvider)2 FieldMapperColumnDefinitionProviderImpl (org.simpleflatmapper.map.mapper.FieldMapperColumnDefinitionProviderImpl)2