Search in sources :

Example 36 with GeoServerConnection

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());
}
Also used : SLDData(com.sldeditor.common.data.SLDData) GeoServerConnection(com.sldeditor.common.data.GeoServerConnection) Test(org.junit.Test)

Example 37 with GeoServerConnection

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

Example 38 with GeoServerConnection

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());
}
Also used : FileSystemInterface(com.sldeditor.common.filesystem.FileSystemInterface) StyleWrapper(com.sldeditor.common.data.StyleWrapper) GeoServerConnection(com.sldeditor.common.data.GeoServerConnection) GeoServerStyleNode(com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerStyleNode) Test(org.junit.Test)

Example 39 with GeoServerConnection

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());
    }
}
Also used : GeoServerConnection(com.sldeditor.common.data.GeoServerConnection)

Example 40 with GeoServerConnection

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;
}
Also used : ArrayList(java.util.ArrayList) GeoServerConnection(com.sldeditor.common.data.GeoServerConnection)

Aggregations

GeoServerConnection (com.sldeditor.common.data.GeoServerConnection)50 Test (org.junit.Test)31 URL (java.net.URL)12 ArrayList (java.util.ArrayList)11 StyleWrapper (com.sldeditor.common.data.StyleWrapper)10 GeoServerInput (com.sldeditor.extension.filesystem.geoserver.GeoServerInput)9 SLDFileHandlerTest (com.sldeditor.test.unit.extension.filesystem.file.sld.SLDFileHandlerTest)9 MalformedURLException (java.net.MalformedURLException)9 GeoServerNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode)8 SLDData (com.sldeditor.common.data.SLDData)7 GeoServerLayer (com.sldeditor.common.data.GeoServerLayer)5 GeoServerOverallNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode)5 GeoServerWorkspaceNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerWorkspaceNode)5 GeoServerReadProgress (com.sldeditor.extension.filesystem.geoserver.GeoServerReadProgress)5 GeoServerClientInterface (com.sldeditor.extension.filesystem.geoserver.client.GeoServerClientInterface)5 HashMap (java.util.HashMap)5 List (java.util.List)5 SLDDataInterface (com.sldeditor.common.SLDDataInterface)4 ActionEvent (java.awt.event.ActionEvent)4 ActionListener (java.awt.event.ActionListener)4