use of com.sldeditor.common.data.GeoServerConnection in project sldeditor by robward-scisys.
the class SLDDataTest method testConnectionData.
/**
* Test connection data.
*/
@Test
public void testConnectionData() {
SLDData data = new SLDData(null, null);
GeoServerConnection connectionData = new GeoServerConnection();
data.setConnectionData(connectionData);
assertEquals(connectionData, data.getConnectionData());
}
use of com.sldeditor.common.data.GeoServerConnection in project sldeditor by robward-scisys.
the class GeoServerNodeTest method testGeoServerLayerNode.
/**
* Test method for {@link com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerLayerNode#GeoServerLayerNode(com.sldeditor.common.filesystem.FileSystemInterface, com.sldeditor.common.data.GeoServerLayer)}.
*/
@Test
public void testGeoServerLayerNode() {
FileSystemInterface fileHandler = new DummyFileSystemInput();
GeoServerConnection connection = new GeoServerConnection();
connection.setConnectionName("test connection");
connection.setUserName("test user name");
GeoServerNode node = new GeoServerNode(fileHandler, connection);
assertEquals(connection, node.getConnection());
assertEquals(fileHandler, node.getHandler());
assertEquals(BuiltInDataFlavour.GEOSERVER_DATAITEM_FLAVOUR, node.getDataFlavour());
assertNull(node.getDestinationText());
}
use of com.sldeditor.common.data.GeoServerConnection in project sldeditor by robward-scisys.
the class GeoServerStyleNodeTest method testGeoServerLayerNode.
/**
* Test method for {@link com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerStyleNode#GeoServerStyleNode(com.sldeditor.common.filesystem.FileSystemInterface)}.
*/
@Test
public void testGeoServerLayerNode() {
FileSystemInterface fileHandler = new DummyFileSystemInput();
GeoServerConnection connection = new GeoServerConnection();
connection.setConnectionName("test connection");
connection.setUserName("test user name");
StyleWrapper styleWrapper = new StyleWrapper("workspace", "layer");
GeoServerStyleNode node = new GeoServerStyleNode(fileHandler, connection, styleWrapper);
assertEquals(fileHandler, node.getHandler());
assertEquals(connection, node.getConnectionData());
assertEquals(styleWrapper, node.getStyle());
assertEquals(BuiltInDataFlavour.GEOSERVER_STYLE_DATAITEM_FLAVOUR, node.getDataFlavour());
assertNull(node.getDestinationText());
}
use of com.sldeditor.common.data.GeoServerConnection in project sldeditor by robward-scisys.
the class GeoServerConnectionManager method updateList.
/**
* Update connection list.
*/
@Override
public void updateList() {
Set<GeoServerConnection> keySet = connectionMap.keySet();
int count = 0;
PropertyManagerFactory.getInstance().clearValue(GEOSERVER_CONNECTION_FIELD, true);
for (GeoServerConnection connection : keySet) {
count++;
PropertyManagerFactory.getInstance().updateValue(GEOSERVER_CONNECTION_FIELD, count, connection.encodeAsString());
}
}
use of com.sldeditor.common.data.GeoServerConnection in project sldeditor by robward-scisys.
the class GeoServerConnectionManager method getConnectionList.
/**
* Gets the connection list.
*
* @return the connection list
*/
@Override
public List<GeoServerConnection> getConnectionList() {
List<GeoServerConnection> connectionList = new ArrayList<GeoServerConnection>();
List<String> valueList = PropertyManagerFactory.getInstance().getMultipleValues(GEOSERVER_CONNECTION_FIELD);
for (String connectionString : valueList) {
GeoServerConnection connection = GeoServerConnection.decodeString(connectionString);
if (connection != null) {
connectionList.add(connection);
}
}
return connectionList;
}
Aggregations