use of com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode in project sldeditor by robward-scisys.
the class GeoServerReadProgressTest method testUpdateConnection.
/**
* Test method for
* {@link com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress#updateConnection(com.sldeditor.common.data.GeoServerConnection, com.sldeditor.common.data.GeoServerConnection)}.
*/
@Test
public void testUpdateConnection() {
GeoServerReadProgress progress = new GeoServerReadProgress(null, null);
GeoServerOverallNode geoServerRootNode = new GeoServerOverallNode(null);
GeoServerConnection connection = new GeoServerConnection();
connection.setConnectionName("test connection 1");
GeoServerNode node = new GeoServerNode(null, connection);
geoServerRootNode.add(node);
progress.addNewConnectionNode(connection, node);
progress.updateConnection(null, null);
GeoServerConnection newConnectionDetails = new GeoServerConnection();
newConnectionDetails.setConnectionName("updated test connection 1");
progress.updateConnection(connection, newConnectionDetails);
}
use of com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode in project sldeditor by robward-scisys.
the class GeoServerReadProgressTest method testRemoveNode.
/**
* Test method for
* {@link com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress#removeNode(com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode, java.lang.String)}.
*/
@Test
public void testRemoveNode() {
GeoServerOverallNode geoServerRootNode = new GeoServerOverallNode(null);
GeoServerConnection connection = new GeoServerConnection();
connection.setConnectionName("test connection 1");
GeoServerNode node = new GeoServerNode(null, connection);
geoServerRootNode.add(node);
GeoServerReadProgress.removeNode(null, null);
GeoServerReadProgress.removeNode(node, "test title");
}
use of com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode in project sldeditor by robward-scisys.
the class GeoServerReadProgressTest method testDeleteConnection.
/**
* Test method for
* {@link com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress#deleteConnection(com.sldeditor.common.data.GeoServerConnection)}.
*/
@Test
public void testDeleteConnection() {
GeoServerReadProgress progress = new GeoServerReadProgress(null, null);
GeoServerOverallNode geoServerRootNode = new GeoServerOverallNode(null);
GeoServerConnection connection = new GeoServerConnection();
connection.setConnectionName("test connection 1");
GeoServerNode node = new GeoServerNode(null, connection);
geoServerRootNode.add(node);
progress.addNewConnectionNode(connection, node);
progress.deleteConnection(null);
progress.deleteConnection(connection);
}
use of com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode in project sldeditor by robward-scisys.
the class GeoServerReadProgressTest method testGeoServerReadProgress.
/**
* Test method for
* {@link com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress#GeoServerReadProgress(com.sldeditor.common.filesystem.FileSystemInterface, com.sldeditor.extension.filesystem.geoserver.GeoServerParseCompleteInterface)}.
*/
@Test
public void testGeoServerReadProgress() {
DummyProgressComplete complete = new DummyProgressComplete();
GeoServerReadProgress progress = new GeoServerReadProgress(null, complete);
GeoServerOverallNode geoServerRootNode = new GeoServerOverallNode(null);
GeoServerConnection connection = new GeoServerConnection();
connection.setConnectionName("test connection 1");
GeoServerNode node = new GeoServerNode(null, connection);
geoServerRootNode.add(node);
progress.addNewConnectionNode(connection, node);
progress.startPopulating(null);
progress.startPopulating(connection);
progress.readLayersProgress(null, 0, 0);
assertFalse(complete.completed);
progress.readLayersProgress(connection, 0, 5);
progress.readLayersProgress(connection, 1, 5);
progress.readLayersProgress(connection, 2, 5);
progress.readLayersProgress(connection, 3, 5);
progress.readLayersProgress(connection, 4, 5);
progress.readLayersProgress(connection, 5, 5);
assertFalse(complete.completed);
progress.readLayersProgress(connection, 6, 5);
assertFalse(complete.completed);
progress.readStylesProgress(null, 0, 0);
progress.readStylesProgress(connection, 0, 3);
progress.readStylesProgress(connection, 1, 3);
progress.readStylesProgress(connection, 2, 3);
progress.readStylesProgress(connection, 3, 3);
progress.readStylesProgress(connection, 4, 3);
assertFalse(complete.completed);
Map<String, List<GeoServerLayer>> completedLayersMap = new HashMap<String, List<GeoServerLayer>>();
Map<String, List<StyleWrapper>> completedStyleMap = new HashMap<String, List<StyleWrapper>>();
progress.readLayersComplete(connection, completedLayersMap);
progress.readStylesComplete(connection, completedStyleMap, false);
assertTrue(complete.completed);
}
use of com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode in project sldeditor by robward-scisys.
the class GeoServerOverallNodeTest method testGeoServerLayerNode.
/**
* Test method for {@link com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode#GeoServerOverallNode(com.sldeditor.common.filesystem.FileSystemInterface)}.
*/
@Test
public void testGeoServerLayerNode() {
FileSystemInterface fileHandler = new DummyFileSystemInput();
GeoServerOverallNode node = new GeoServerOverallNode(fileHandler);
assertEquals(fileHandler, node.getHandler());
assertEquals(BuiltInDataFlavour.GEOSERVER_OVERALL_DATAITEM_FLAVOUR, node.getDataFlavour());
assertNull(node.getDestinationText());
}
Aggregations