Search in sources :

Example 6 with GeoServerNode

use of com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode 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);
}
Also used : GeoServerOverallNode(com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode) GeoServerNode(com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode) GeoServerConnection(com.sldeditor.common.data.GeoServerConnection) GeoServerReadProgress(com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress) Test(org.junit.Test)

Example 7 with GeoServerNode

use of com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode 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");
}
Also used : GeoServerOverallNode(com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode) GeoServerNode(com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode) GeoServerConnection(com.sldeditor.common.data.GeoServerConnection) Test(org.junit.Test)

Example 8 with GeoServerNode

use of com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode 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);
}
Also used : GeoServerOverallNode(com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode) GeoServerNode(com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode) GeoServerConnection(com.sldeditor.common.data.GeoServerConnection) GeoServerReadProgress(com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress) Test(org.junit.Test)

Example 9 with GeoServerNode

use of com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode 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);
}
Also used : GeoServerOverallNode(com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode) GeoServerLayer(com.sldeditor.common.data.GeoServerLayer) HashMap(java.util.HashMap) StyleWrapper(com.sldeditor.common.data.StyleWrapper) GeoServerNode(com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode) List(java.util.List) GeoServerConnection(com.sldeditor.common.data.GeoServerConnection) GeoServerReadProgress(com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress) Test(org.junit.Test)

Example 10 with GeoServerNode

use of com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode in project sldeditor by robward-scisys.

the class GeoServerReadProgress method updateConnection.

/**
 * Update connection.
 *
 * @param originalConnectionDetails the original connection details
 * @param newConnectionDetails the new connection details
 */
public void updateConnection(GeoServerConnection originalConnectionDetails, GeoServerConnection newConnectionDetails) {
    if (newConnectionDetails != null) {
        GeoServerNode geoserverNode = nodeMap.get(originalConnectionDetails);
        originalConnectionDetails.update(newConnectionDetails);
        if (geoserverNode != null) {
            geoserverNode.setUserObject(newConnectionDetails.getConnectionName());
            refreshNode(geoserverNode);
            setFolder(newConnectionDetails, false);
        }
    }
}
Also used : GeoServerNode(com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode)

Aggregations

GeoServerNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode)18 GeoServerConnection (com.sldeditor.common.data.GeoServerConnection)8 Test (org.junit.Test)6 GeoServerOverallNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode)5 GeoServerReadProgress (com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress)4 List (java.util.List)3 NodeInterface (com.sldeditor.common.NodeInterface)2 StyleWrapper (com.sldeditor.common.data.StyleWrapper)2 GeoServerWorkspaceNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerWorkspaceNode)2 GeoServerClientInterface (com.sldeditor.extension.filesystem.geoserver.client.GeoServerClientInterface)2 HashMap (java.util.HashMap)2 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)2 SLDDataInterface (com.sldeditor.common.SLDDataInterface)1 GeoServerLayer (com.sldeditor.common.data.GeoServerLayer)1 SLDData (com.sldeditor.common.data.SLDData)1 FileSystemInterface (com.sldeditor.common.filesystem.FileSystemInterface)1 SelectedFiles (com.sldeditor.common.filesystem.SelectedFiles)1 FileTreeNode (com.sldeditor.datasource.extension.filesystem.node.file.FileTreeNode)1 GeoServerStyleHeadingNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerStyleHeadingNode)1 GeoServerStyleNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerStyleNode)1