use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class SoftEnumPropertiesTest method testNullableStringValue.
@Test
public void testNullableStringValue() throws InvalidPropertyException {
NullableSoftEnumProperty<Example> property = new NullableSoftEnumProperty<>("enum.nullable", Example.class);
PropertyConfiguration config = configOf(Pair.of("enum.nullable", "ANOTHER ONE"));
Assertions.assertEquals(Optional.of(SoftEnumValue.ofSoftValue("ANOTHER ONE")), config.getValue(property));
PropertyTestHelpUtil.assertAllHelpValid(property, Arrays.asList("THING", "ANOTHER", "THIRD"));
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class IntegerPropertiesTests method testList.
@Test
public void testList() throws InvalidPropertyException {
ValuedAlikeListProperty<Integer> property = new IntegerListProperty("integer.list", Collections.emptyList());
PropertyConfiguration config = configOf(Pair.of("integer.list", "2,3"));
Assertions.assertEquals(Bds.listOf(2, 3), config.getValue(property));
PropertyTestHelpUtil.assertAllListHelpValid(property);
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class IntegerPropertiesTests method testNullable.
@Test
public void testNullable() throws InvalidPropertyException {
NullableAlikeProperty<Integer> property = new NullableIntegerProperty("integer.nullable");
PropertyConfiguration config = configOf(Pair.of("integer.nullable", "2"));
Assertions.assertEquals(Optional.of(2), config.getValue(property));
PropertyTestHelpUtil.assertAllHelpValid(property);
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class BooleanPropertiesTests method testValued.
@Test
public void testValued() throws InvalidPropertyException {
ValuedAlikeProperty<Boolean> property = new BooleanProperty("boolean.valued", false);
PropertyConfiguration config = configOf(Pair.of("boolean.valued", "true"));
Assertions.assertEquals(true, config.getValue(property));
PropertyTestHelpUtil.assertAllHelpValid(property);
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class BooleanPropertiesTests method testList.
@Test
public void testList() throws InvalidPropertyException {
ValuedAlikeListProperty<Boolean> property = new BooleanListProperty("boolean.list", Collections.emptyList());
PropertyConfiguration config = configOf(Pair.of("boolean.list", "true, true"));
Assertions.assertEquals(Bds.listOf(true, true), config.getValue(property));
PropertyTestHelpUtil.assertAllListHelpValid(property);
}
Aggregations