public void testSetProperties() { StaticPropertiesPropertySource source = new StaticPropertiesPropertySource(); Properties properties = new Properties(); properties.setProperty("property1", "value1"); source.setProperties(properties); BasePropertyValue value = new BasePropertyValue(); value.setPropertySource(source); value.setName("property1"); assertEquals("value1", value.getRawValue()); }
public void testProperties() throws Exception { BasePropertyValue value = new BasePropertyValue(); try { value.getRawValue(); fail(); } catch (IllegalArgumentException e) { assertEquals("propertySource must be specified", e.getMessage()); } StaticPropertiesPropertySource source = new StaticPropertiesPropertySource(); value.setPropertySource(source); try { value.getRawValue(); fail(); } catch (IllegalArgumentException e) { assertEquals("name must be specified", e.getMessage()); } }