Search in sources :

Example 11 with Converters

use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.

the class LocalDateTimeConverterFactoryTest method testWrongDolphinValues.

@Test(expectedExceptions = ClassCastException.class)
public void testWrongDolphinValues(@Mocked BeanRepository beanRepository) throws ValueConverterException {
    // Given
    Converters converters = new Converters(beanRepository);
    // When
    Converter converter = converters.getConverter(LocalDateTime.class);
    // Then
    converter.convertFromDolphin(7);
}
Also used : Converters(com.canoo.dp.impl.remoting.Converters) Converter(com.canoo.platform.remoting.spi.converter.Converter) Test(org.testng.annotations.Test)

Example 12 with Converters

use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.

the class LocalDateTimeConverterFactoryTest method testWrongBeanValues.

@Test(expectedExceptions = ClassCastException.class)
public void testWrongBeanValues(@Mocked BeanRepository beanRepository) throws ValueConverterException {
    // Given
    Converters converters = new Converters(beanRepository);
    // When
    Converter converter = converters.getConverter(LocalDateTime.class);
    // Then
    converter.convertToDolphin(7);
}
Also used : Converters(com.canoo.dp.impl.remoting.Converters) Converter(com.canoo.platform.remoting.spi.converter.Converter) Test(org.testng.annotations.Test)

Example 13 with Converters

use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.

the class LocalDateTimeConverterFactoryTest method testConverterCreation.

@Test
public void testConverterCreation(@Mocked BeanRepository beanRepository) {
    // Given
    Converters converters = new Converters(beanRepository);
    // When
    Converter converter = converters.getConverter(LocalDateTime.class);
    // Then
    assertNotNull(converter);
}
Also used : Converters(com.canoo.dp.impl.remoting.Converters) Converter(com.canoo.platform.remoting.spi.converter.Converter) Test(org.testng.annotations.Test)

Example 14 with Converters

use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.

the class LocalDateTimeConverterFactoryTest method testFactoryFieldType.

@Test
public void testFactoryFieldType(@Mocked BeanRepository beanRepository) {
    // Given
    Converters converters = new Converters(beanRepository);
    // When
    int type = converters.getFieldType(LocalDateTime.class);
    // Then
    assertEquals(type, ValueFieldTypes.LOCAL_DATE_TIME_FIELD_TYPE);
}
Also used : Converters(com.canoo.dp.impl.remoting.Converters) Test(org.testng.annotations.Test)

Example 15 with Converters

use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.

the class PeriodeConverterFactoryTest method testWrongBeanValues.

@Test(expectedExceptions = ClassCastException.class)
public void testWrongBeanValues(@Mocked BeanRepository beanRepository) throws ValueConverterException {
    // Given
    Converters converters = new Converters(beanRepository);
    // When
    Converter converter = converters.getConverter(Period.class);
    // Then
    converter.convertToDolphin(7);
}
Also used : Converters(com.canoo.dp.impl.remoting.Converters) Converter(com.canoo.platform.remoting.spi.converter.Converter) Test(org.testng.annotations.Test)

Aggregations

Converters (com.canoo.dp.impl.remoting.Converters)36 Test (org.testng.annotations.Test)33 Converter (com.canoo.platform.remoting.spi.converter.Converter)28 ValueConverterException (com.canoo.platform.remoting.spi.converter.ValueConverterException)5 BeanBuilder (com.canoo.dp.impl.remoting.BeanBuilder)3 BeanManagerImpl (com.canoo.dp.impl.remoting.BeanManagerImpl)3 ClassRepository (com.canoo.dp.impl.remoting.ClassRepository)3 ClassRepositoryImpl (com.canoo.dp.impl.remoting.ClassRepositoryImpl)3 ListMapper (com.canoo.dp.impl.remoting.ListMapper)3 PresentationModelBuilderFactory (com.canoo.dp.impl.remoting.PresentationModelBuilderFactory)3 ListMapperImpl (com.canoo.dp.impl.remoting.collections.ListMapperImpl)3 RemotingConfiguration (com.canoo.dp.impl.server.config.RemotingConfiguration)2 GarbageCollectionCallback (com.canoo.dp.impl.server.gc.GarbageCollectionCallback)2 GarbageCollector (com.canoo.dp.impl.server.gc.GarbageCollector)2 Instance (com.canoo.dp.impl.server.gc.Instance)2 ServerBeanBuilderImpl (com.canoo.dp.impl.server.model.ServerBeanBuilderImpl)2 ServerPresentationModelBuilderFactory (com.canoo.dp.impl.server.model.ServerPresentationModelBuilderFactory)2 ClientBeanBuilderImpl (com.canoo.dp.impl.client.ClientBeanBuilderImpl)1 ClientPresentationModelBuilderFactory (com.canoo.dp.impl.client.ClientPresentationModelBuilderFactory)1 BeanRepositoryImpl (com.canoo.dp.impl.remoting.BeanRepositoryImpl)1