use of com.canoo.platform.remoting.spi.converter.ValueConverterException in project dolphin-platform by canoo.
the class PeriodeConverterFactoryTest method testReconversion.
private void testReconversion(Converter converter, Period duration) {
try {
Object dolphinObject = converter.convertToDolphin(duration);
assertNotNull(dolphinObject);
Object reconvertedObject = converter.convertFromDolphin(dolphinObject);
assertNotNull(reconvertedObject);
assertEquals(reconvertedObject.getClass(), Period.class);
Period reconvertedDuration = (Period) reconvertedObject;
assertEquals(reconvertedDuration, duration);
} catch (ValueConverterException e) {
fail("Error in conversion", e);
}
}
use of com.canoo.platform.remoting.spi.converter.ValueConverterException in project dolphin-platform by canoo.
the class ServerControllerActionCallBean method getParam.
public Object getParam(String name, Class<?> type) {
final String internalName = PARAM_PREFIX + name;
final Attribute valueAttribute = pm.getAttribute(internalName);
if (valueAttribute == null) {
throw new IllegalArgumentException(String.format("Invoking RemotingAction requires parameter '%s', but it was not withContent", name));
}
try {
return converters.getConverter(type).convertFromDolphin(valueAttribute.getValue());
} catch (ValueConverterException e) {
throw new MappingException("Error in conversion", e);
}
}
Aggregations