use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class ConverterTest method testStringConversions.
@Test
public void testStringConversions() {
Converters converters = new Converters(null);
Converter converter = converters.getConverter(String.class);
checkConversion(converter, "");
checkConversion(converter, null);
checkConversion(converter, "Hello");
}
use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class AbstractDolphinBasedTest method createBeanManager.
protected BeanManager createBeanManager(ServerModelStore serverModelStore, BeanRepository beanRepository, EventDispatcher dispatcher) {
final Converters converters = new Converters(beanRepository);
final PresentationModelBuilderFactory builderFactory = new ServerPresentationModelBuilderFactory(serverModelStore);
final ClassRepository classRepository = new ClassRepositoryImpl(serverModelStore, converters, builderFactory);
final ListMapper listMapper = new ListMapperImpl(serverModelStore, classRepository, beanRepository, builderFactory, dispatcher);
final RemotingConfiguration configurationForGc = new RemotingConfiguration();
final GarbageCollector garbageCollector = new GarbageCollector(configurationForGc, new GarbageCollectionCallback() {
@Override
public void onReject(Set<Instance> instances) {
}
});
final BeanBuilder beanBuilder = new ServerBeanBuilderImpl(classRepository, beanRepository, listMapper, builderFactory, dispatcher, garbageCollector);
return new BeanManagerImpl(beanRepository, beanBuilder);
}
use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class AbstractDolphinBasedTest method createBeanManager.
protected BeanManager createBeanManager(ServerModelStore serverModelStore) {
final EventDispatcher dispatcher = new ServerEventDispatcher(serverModelStore);
final BeanRepositoryImpl beanRepository = new BeanRepositoryImpl(serverModelStore, dispatcher);
final Converters converters = new Converters(beanRepository);
final PresentationModelBuilderFactory builderFactory = new ServerPresentationModelBuilderFactory(serverModelStore);
final ClassRepository classRepository = new ClassRepositoryImpl(serverModelStore, converters, builderFactory);
final ListMapper listMapper = new ListMapperImpl(serverModelStore, classRepository, beanRepository, builderFactory, dispatcher);
final RemotingConfiguration configurationForGc = new RemotingConfiguration();
final GarbageCollector garbageCollector = new GarbageCollector(configurationForGc, new GarbageCollectionCallback() {
@Override
public void onReject(Set<Instance> instances) {
}
});
final BeanBuilder beanBuilder = new ServerBeanBuilderImpl(classRepository, beanRepository, listMapper, builderFactory, dispatcher, garbageCollector);
return new BeanManagerImpl(beanRepository, beanBuilder);
}
use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class DurationConverterFactoryTest method testBasicConversions.
@Test
public void testBasicConversions(@Mocked BeanRepository beanRepository) {
// Given
Converters converters = new Converters(beanRepository);
// When
Converter converter = converters.getConverter(Duration.class);
// Then
testReconversion(converter, Duration.ZERO);
testReconversion(converter, Duration.ofDays(7));
testReconversion(converter, Duration.ofMillis(10));
testReconversion(converter, Duration.ofDays(10_000_000));
}
use of com.canoo.dp.impl.remoting.Converters in project dolphin-platform by canoo.
the class DurationConverterFactoryTest method testConverterCreation.
@Test
public void testConverterCreation(@Mocked BeanRepository beanRepository) {
// Given
Converters converters = new Converters(beanRepository);
// When
Converter converter = converters.getConverter(Duration.class);
// Then
assertNotNull(converter);
}
Aggregations