use of com.sldeditor.datasource.impl.DataSourceProperties in project sldeditor by robward-scisys.
the class DataSourcePropertiesTest method testDataSourcePropertiesWithConnector.
/**
* Test method for {@link com.sldeditor.datasource.impl.DataSourceProperties#DataSourceProperties(com.sldeditor.DataSourceConnectorInterface)}.
* Test method for {@link com.sldeditor.datasource.impl.DataSourceProperties#setPropertyMap(java.util.Map)}.
* Test method for {@link com.sldeditor.datasource.impl.DataSourceProperties#getDataSourceConnector()}.
*/
@Test
public void testDataSourcePropertiesWithConnector() {
Map<String, Object> propertyMap = new HashMap<String, Object>();
propertyMap.put("field1", "value1");
propertyMap.put("field2", "value2");
propertyMap.put("field3", "value3");
DataSourceConnectorInterface dsc = new DataSourceConnector();
DataSourceProperties dsp = new DataSourceProperties(dsc);
dsp.setPropertyMap(propertyMap);
Map<String, Object> actualPropertyMap = dsp.getConnectionProperties();
assertEquals(propertyMap, actualPropertyMap);
assertEquals(propertyMap, dsp.getAllConnectionProperties());
// Is empty
assertFalse(dsp.isEmpty());
}
use of com.sldeditor.datasource.impl.DataSourceProperties in project sldeditor by robward-scisys.
the class DataSourcePropertiesTest method testPopulate.
/**
* Test method for {@link com.sldeditor.datasource.impl.DataSourceProperties#populate()}.
*/
@Test
public void testPopulate() {
DataSourceProperties dsp = new DataSourceProperties(null);
dsp.populate();
// Does nothing
DataSourceConnectorInterface dsc = new DataSourceConnector();
dsp = new DataSourceProperties(dsc);
dsp.populate();
}
use of com.sldeditor.datasource.impl.DataSourceProperties in project sldeditor by robward-scisys.
the class DataSourcePropertiesTest method testPassword.
/**
* Test method for {@link com.sldeditor.datasource.impl.DataSourceProperties#getPassword()}.
*/
@Test
public void testPassword() {
DataSourceProperties dsp = new DataSourceProperties(null);
assertFalse(dsp.hasPassword());
String expectedPassword = "top secret password";
dsp.setPassword(expectedPassword);
assertTrue(dsp.hasPassword());
assertEquals(expectedPassword, dsp.getPassword());
}
Aggregations