use of org.camunda.bpm.dmn.engine.impl.spi.type.DmnDataTypeTransformer in project camunda-engine-dmn by camunda.
the class DmnDataTypeTransformerTest method booleanType.
@Test
public void booleanType() {
DmnDataTypeTransformer typeTransformer = registry.getTransformer("boolean");
assertThat(typeTransformer.transform(true), is((TypedValue) Variables.booleanValue(true)));
assertThat(typeTransformer.transform(false), is((TypedValue) Variables.booleanValue(false)));
assertThat(typeTransformer.transform("true"), is((TypedValue) Variables.booleanValue(true)));
assertThat(typeTransformer.transform("false"), is((TypedValue) Variables.booleanValue(false)));
}
use of org.camunda.bpm.dmn.engine.impl.spi.type.DmnDataTypeTransformer in project camunda-engine-dmn by camunda.
the class DmnDataTypeTransformerTest method invalidDoubleValueForIntegerType.
@Test
public void invalidDoubleValueForIntegerType() {
DmnDataTypeTransformer typeTransformer = registry.getTransformer("integer");
thrown.expect(IllegalArgumentException.class);
typeTransformer.transform(4.2);
}
use of org.camunda.bpm.dmn.engine.impl.spi.type.DmnDataTypeTransformer in project camunda-engine-dmn by camunda.
the class DmnDataTypeTransformerTest method invalidStringValueForBooleanType.
@Test
public void invalidStringValueForBooleanType() {
DmnDataTypeTransformer typeTransformer = registry.getTransformer("boolean");
thrown.expect(IllegalArgumentException.class);
typeTransformer.transform("NaB");
}
use of org.camunda.bpm.dmn.engine.impl.spi.type.DmnDataTypeTransformer in project camunda-engine-dmn by camunda.
the class DmnDataTypeTransformerTest method invalidIntegerMaxValueForIntegerType.
@Test
public void invalidIntegerMaxValueForIntegerType() {
DmnDataTypeTransformer typeTransformer = registry.getTransformer("integer");
thrown.expect(IllegalArgumentException.class);
typeTransformer.transform(Integer.MAX_VALUE + 1L);
}
use of org.camunda.bpm.dmn.engine.impl.spi.type.DmnDataTypeTransformer in project camunda-engine-dmn by camunda.
the class DmnDataTypeTransformerTest method longType.
@Test
public void longType() {
DmnDataTypeTransformer typeTransformer = registry.getTransformer("long");
assertThat(typeTransformer.transform(2L), is((TypedValue) Variables.longValue(2L)));
assertThat(typeTransformer.transform("2"), is((TypedValue) Variables.longValue(2L)));
assertThat(typeTransformer.transform(4), is((TypedValue) Variables.longValue(4L)));
assertThat(typeTransformer.transform(4.0), is((TypedValue) Variables.longValue(4L)));
assertThat(typeTransformer.transform(Long.MIN_VALUE), is((TypedValue) Variables.longValue(Long.MIN_VALUE)));
assertThat(typeTransformer.transform(Long.MAX_VALUE), is((TypedValue) Variables.longValue(Long.MAX_VALUE)));
}
Aggregations