Search in sources :

Example 1 with DateConverterFactory

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

the class DateConverterFactoryTest method testConverterCreation.

@Test
public void testConverterCreation() {
    DateConverterFactory factory = new DateConverterFactory();
    Converter converter = factory.getConverterForType(Date.class);
    Assert.assertNotNull(converter);
}
Also used : DateConverterFactory(com.canoo.dp.impl.remoting.converters.DateConverterFactory) Converter(com.canoo.platform.remoting.spi.converter.Converter) Test(org.testng.annotations.Test)

Example 2 with DateConverterFactory

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

the class DateConverterFactoryTest method testConvertion.

@Test
public void testConvertion() throws ValueConverterException {
    DateConverterFactory factory = new DateConverterFactory();
    Converter converter = factory.getConverterForType(Date.class);
    Date date = new Date();
    Object converted = converter.convertToDolphin(date);
    Assert.assertNotNull(converted);
    Assert.assertEquals(converter.convertFromDolphin(converted), date);
}
Also used : DateConverterFactory(com.canoo.dp.impl.remoting.converters.DateConverterFactory) Converter(com.canoo.platform.remoting.spi.converter.Converter) Date(java.util.Date) Test(org.testng.annotations.Test)

Example 3 with DateConverterFactory

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

the class DateConverterFactoryTest method testTypeSupport.

@Test
public void testTypeSupport() {
    DateConverterFactory factory = new DateConverterFactory();
    Assert.assertTrue(factory.supportsType(Date.class));
}
Also used : DateConverterFactory(com.canoo.dp.impl.remoting.converters.DateConverterFactory) Date(java.util.Date) Test(org.testng.annotations.Test)

Example 4 with DateConverterFactory

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

the class DateConverterFactoryTest method testTypeIdentifier.

@Test
public void testTypeIdentifier() {
    DateConverterFactory factory = new DateConverterFactory();
    Assert.assertEquals(factory.getTypeIdentifier(), DateConverterFactory.FIELD_TYPE_DATE);
}
Also used : DateConverterFactory(com.canoo.dp.impl.remoting.converters.DateConverterFactory) Test(org.testng.annotations.Test)

Aggregations

DateConverterFactory (com.canoo.dp.impl.remoting.converters.DateConverterFactory)4 Test (org.testng.annotations.Test)4 Converter (com.canoo.platform.remoting.spi.converter.Converter)2 Date (java.util.Date)2