Search in sources :

Example 11 with FileSystemInterface

use of com.sldeditor.common.filesystem.FileSystemInterface 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 12 with FileSystemInterface

use of com.sldeditor.common.filesystem.FileSystemInterface in project sldeditor by robward-scisys.

the class FileSystemExtensionTest method testCreateMenus.

/**
 * Test method for
 * {@link com.sldeditor.extension.filesystem.FileSystemExtension#createMenus(javax.swing.JMenu)}.
 */
@Test
public void testCreateMenus() {
    FileSystemExtension fsExt = new FileSystemExtension();
    DummyExtension dummyExtension = new DummyExtension();
    List<FileSystemInterface> overrideExtensionList = new ArrayList<FileSystemInterface>();
    overrideExtensionList.add(dummyExtension);
    FileSystemExtensionFactory.override(overrideExtensionList);
    fsExt.initialise(null, null);
    fsExt.createMenus(null);
}
Also used : FileSystemExtension(com.sldeditor.extension.filesystem.FileSystemExtension) FileSystemInterface(com.sldeditor.common.filesystem.FileSystemInterface) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 13 with FileSystemInterface

use of com.sldeditor.common.filesystem.FileSystemInterface in project sldeditor by robward-scisys.

the class FileSystemExtensionTest method testGetExtensionArgPrefix.

/**
 * Test method for
 * {@link com.sldeditor.extension.filesystem.FileSystemExtension#getExtensionArgPrefix()}.
 */
@Test
public void testGetExtensionArgPrefix() {
    FileSystemExtension fsExt = new FileSystemExtension();
    DummyExtension dummyExtension = new DummyExtension();
    List<FileSystemInterface> overrideExtensionList = new ArrayList<FileSystemInterface>();
    overrideExtensionList.add(dummyExtension);
    FileSystemExtensionFactory.override(overrideExtensionList);
    fsExt.initialise(null, null);
    assertEquals("file", fsExt.getExtensionArgPrefix());
}
Also used : FileSystemExtension(com.sldeditor.extension.filesystem.FileSystemExtension) FileSystemInterface(com.sldeditor.common.filesystem.FileSystemInterface) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 14 with FileSystemInterface

use of com.sldeditor.common.filesystem.FileSystemInterface in project sldeditor by robward-scisys.

the class FileSystemExtensionTest method testGetName.

/**
 * Test method for {@link com.sldeditor.extension.filesystem.FileSystemExtension#getName()}.
 */
@Test
public void testGetName() {
    FileSystemExtension fsExt = new FileSystemExtension();
    DummyExtension dummyExtension = new DummyExtension();
    List<FileSystemInterface> overrideExtensionList = new ArrayList<FileSystemInterface>();
    overrideExtensionList.add(dummyExtension);
    FileSystemExtensionFactory.override(overrideExtensionList);
    fsExt.initialise(null, null);
    assertTrue(fsExt.getName() != null);
}
Also used : FileSystemExtension(com.sldeditor.extension.filesystem.FileSystemExtension) FileSystemInterface(com.sldeditor.common.filesystem.FileSystemInterface) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 15 with FileSystemInterface

use of com.sldeditor.common.filesystem.FileSystemInterface in project sldeditor by robward-scisys.

the class FileSystemExtensionTest method testGetTooltip.

/**
 * Test method for {@link com.sldeditor.extension.filesystem.FileSystemExtension#getTooltip()}.
 */
@Test
public void testGetTooltip() {
    FileSystemExtension fsExt = new FileSystemExtension();
    DummyExtension dummyExtension = new DummyExtension();
    List<FileSystemInterface> overrideExtensionList = new ArrayList<FileSystemInterface>();
    overrideExtensionList.add(dummyExtension);
    FileSystemExtensionFactory.override(overrideExtensionList);
    fsExt.initialise(null, null);
    assertTrue(fsExt.getTooltip() != null);
}
Also used : FileSystemExtension(com.sldeditor.extension.filesystem.FileSystemExtension) FileSystemInterface(com.sldeditor.common.filesystem.FileSystemInterface) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

FileSystemInterface (com.sldeditor.common.filesystem.FileSystemInterface)15 Test (org.junit.Test)12 ArrayList (java.util.ArrayList)8 FileSystemExtension (com.sldeditor.extension.filesystem.FileSystemExtension)7 GeoServerConnection (com.sldeditor.common.data.GeoServerConnection)3 TreePath (javax.swing.tree.TreePath)2 NodeInterface (com.sldeditor.common.NodeInterface)1 SLDDataInterface (com.sldeditor.common.SLDDataInterface)1 GeoServerLayer (com.sldeditor.common.data.GeoServerLayer)1 SLDData (com.sldeditor.common.data.SLDData)1 StyleWrapper (com.sldeditor.common.data.StyleWrapper)1 SelectedFiles (com.sldeditor.common.filesystem.SelectedFiles)1 FSTree (com.sldeditor.datasource.extension.filesystem.node.FSTree)1 GeoServerLayerNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerLayerNode)1 GeoServerNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerNode)1 GeoServerOverallNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerOverallNode)1 GeoServerStyleNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerStyleNode)1 GeoServerWorkspaceNode (com.sldeditor.datasource.extension.filesystem.node.geoserver.GeoServerWorkspaceNode)1 FileSystemInput (com.sldeditor.extension.filesystem.file.FileSystemInput)1 BorderLayout (java.awt.BorderLayout)1