Search in sources :

Example 1 with GeoServerReadProgress

use of com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress in project sldeditor by robward-scisys.

the class RenderTransformationDialog method main.

/**
 * The main method.
 *
 * @param args the arguments
 */
public static void main(String[] args) {
    GeoServerConnectionManagerInterface dummyInterface = new GeoServerConnectionManagerInterface() {

        @Override
        public List<GeoServerConnection> getConnectionList() {
            List<GeoServerConnection> list = new ArrayList<GeoServerConnection>();
            GeoServerConnection connection = new GeoServerConnection();
            connection.setConnectionName("Test");
            try {
                connection.setUrl(new URL("http://localhost:8080/geoserver"));
                connection.setUserName("admin");
                connection.setPassword("geoserver");
                list.add(connection);
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }
            return list;
        }

        @Override
        public void updateList() {
        }

        @Override
        public GeoServerConnection getConnection(String connectionDataName) {
            return null;
        }

        @Override
        public void readPropertyFile(GeoServerReadProgress progress) {
        }

        @Override
        public Map<GeoServerConnection, GeoServerClientInterface> getConnectionMap() {
            return null;
        }

        @Override
        public void removeConnection(GeoServerConnection connection) {
        }

        @Override
        public void addNewConnection(GeoServerReadProgress progress, GeoServerConnection newConnectionDetails) {
        }
    };
    List<VersionData> vendorOptionList = new ArrayList<VersionData>();
    vendorOptionList.add(VersionData.getLatestVersion(GeoServerVendorOption.class));
    VendorOptionManager.getInstance().setSelectedVendorOptions(vendorOptionList);
    RenderTransformationDialog dlg = new RenderTransformationDialog(dummyInterface);
    dlg.showDialog(null);
}
Also used : MalformedURLException(java.net.MalformedURLException) GeoServerVendorOption(com.sldeditor.common.vendoroption.GeoServerVendorOption) ArrayList(java.util.ArrayList) GeoServerConnection(com.sldeditor.common.data.GeoServerConnection) URL(java.net.URL) GeoServerClientInterface(com.sldeditor.extension.filesystem.geoserver.client.GeoServerClientInterface) VersionData(com.sldeditor.common.vendoroption.VersionData) GeoServerConnectionManagerInterface(com.sldeditor.common.connection.GeoServerConnectionManagerInterface) GeoServerReadProgress(com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress)

Example 2 with GeoServerReadProgress

use of com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress 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 3 with GeoServerReadProgress

use of com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress 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 4 with GeoServerReadProgress

use of com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress 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 5 with GeoServerReadProgress

use of com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress in project sldeditor by robward-scisys.

the class GeoServerReadProgressTest method testDisconnect.

/**
 * Test method for
 * {@link com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress#disconnect(com.sldeditor.common.data.GeoServerConnection)}.
 */
@Test
public void testDisconnect() {
    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.disconnect(null);
    progress.disconnect(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)

Aggregations

GeoServerConnection (com.sldeditor.common.data.GeoServerConnection)5 GeoServerReadProgress (com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress)5 GeoServerNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode)4 GeoServerOverallNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode)4 Test (org.junit.Test)4 GeoServerConnectionManagerInterface (com.sldeditor.common.connection.GeoServerConnectionManagerInterface)1 GeoServerLayer (com.sldeditor.common.data.GeoServerLayer)1 StyleWrapper (com.sldeditor.common.data.StyleWrapper)1 GeoServerVendorOption (com.sldeditor.common.vendoroption.GeoServerVendorOption)1 VersionData (com.sldeditor.common.vendoroption.VersionData)1 GeoServerClientInterface (com.sldeditor.extension.filesystem.geoserver.client.GeoServerClientInterface)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1