use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class LongPropertiesTests method testList.
@Test
public void testList() throws InvalidPropertyException {
ValuedAlikeListProperty<Long> property = new LongListProperty("long.list", Collections.emptyList());
PropertyConfiguration config = configOf(Pair.of("long.list", "2,3"));
Assertions.assertEquals(Bds.listOf(2L, 3L), config.getValue(property));
PropertyTestHelpUtil.assertAllListHelpValid(property);
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class PathPropertiesTest method testNullable.
@Test
public void testNullable() throws InvalidPropertyException {
NullableAlikeProperty<PathValue> property = new NullablePathProperty("path.nullable");
PropertyConfiguration config = configOf(Pair.of("path.nullable", "/new/path"));
Assertions.assertEquals(Optional.of(new PathValue("/new/path")), config.getValue(property));
PropertyTestHelpUtil.assertAllHelpValid(property);
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class PathPropertiesTest method testValued.
@Test
public void testValued() throws InvalidPropertyException {
ValuedAlikeProperty<PathValue> property = new PathProperty("path.valued", new PathValue("/tmp/test"));
PropertyConfiguration config = configOf(Pair.of("path.valued", "/new/path"));
Assertions.assertEquals(new PathValue("/new/path"), config.getValue(property));
PropertyTestHelpUtil.assertAllHelpValid(property);
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class StringPropertiesTest method testValued.
@Test
public void testValued() throws InvalidPropertyException {
ValuedAlikeProperty<String> property = new StringProperty("string.valued", "defaultString");
PropertyConfiguration config = configOf(Pair.of("string.valued", "abc"));
Assertions.assertEquals("abc", config.getValue(property));
PropertyTestHelpUtil.assertAllHelpValid(property);
}
use of com.synopsys.integration.configuration.config.PropertyConfiguration in project synopsys-detect by blackducksoftware.
the class StringPropertiesTest method testNullable.
@Test
public void testNullable() throws InvalidPropertyException {
NullableAlikeProperty<String> property = new NullableStringProperty("string.nullable");
PropertyConfiguration config = configOf(Pair.of("string.nullable", "abc"));
Assertions.assertEquals(Optional.of("abc"), config.getValue(property));
PropertyTestHelpUtil.assertAllHelpValid(property);
}
Aggregations