Java Code Examples for org.springframework.shell.support.util.OsUtils#LINE_SEPARATOR

The following examples show how to use org.springframework.shell.support.util.OsUtils#LINE_SEPARATOR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataStoreCommandsTest.java    From geoserver-shell with MIT License 6 votes vote down vote up
@Test
public void getDataStore() throws Exception {
    String url = "/geoserver/rest/workspaces/topp/datastores/taz_shapes.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("datastore.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    DataStoreCommands commands = new DataStoreCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.get("topp", "taz_shapes");
    String expected = "taz_shapes" + OsUtils.LINE_SEPARATOR +
            "   Enabled? true" + OsUtils.LINE_SEPARATOR +
            "   Description: null" + OsUtils.LINE_SEPARATOR +
            "   Store Type: null" + OsUtils.LINE_SEPARATOR +
            "   Type: UNKNOWN" + OsUtils.LINE_SEPARATOR +
            "   Workspace: topp" + OsUtils.LINE_SEPARATOR +
            "   Connection Parameters:" + OsUtils.LINE_SEPARATOR +
            "      namespace: http://www.openplans.org/topp" + OsUtils.LINE_SEPARATOR +
            "      url: file:data/taz_shapes" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 2
Source File: GeoWebCacheCommandsTest.java    From geoserver-shell with MIT License 6 votes vote down vote up
@Test
public void getLayer() throws Exception {
    String url = "/geoserver/gwc/rest/layers/sf:roads.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("gwc_layer.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    GeoWebCacheCommands commands = new GeoWebCacheCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.getLayer("sf:roads");
    String expected = "sf:roads" + OsUtils.LINE_SEPARATOR +
            "   Enabled: true" + OsUtils.LINE_SEPARATOR +
            "   Gutter: 0" + OsUtils.LINE_SEPARATOR +
            "   Auto Cache Styles: true" + OsUtils.LINE_SEPARATOR +
            "   Mime Formats:" + OsUtils.LINE_SEPARATOR +
            "      image/png" + OsUtils.LINE_SEPARATOR +
            "      image/jpeg" + OsUtils.LINE_SEPARATOR +
            "   Grid Subsets:" + OsUtils.LINE_SEPARATOR +
            "      EPSG:900913" + OsUtils.LINE_SEPARATOR +
            "      EPSG:4326" + OsUtils.LINE_SEPARATOR +
            "   Meta Dimensions:" + OsUtils.LINE_SEPARATOR +
            "      Width: 4" + OsUtils.LINE_SEPARATOR +
            "      Height: 4" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 3
Source File: SettingsCommandsTest.java    From geoserver-shell with MIT License 6 votes vote down vote up
@Test
public void listContactSettings() throws Exception {
    String url = "/geoserver/rest/settings/contact.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("contactSettings.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    SettingsCommands commands = new SettingsCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.listContact();
    String expected = "City: Somewhere" + OsUtils.LINE_SEPARATOR +
            "Country: USA" + OsUtils.LINE_SEPARATOR +
            "Type: Home" + OsUtils.LINE_SEPARATOR +
            "Email: [email protected]" + OsUtils.LINE_SEPARATOR +
            "Organization: Geoserver" + OsUtils.LINE_SEPARATOR +
            "Name: John Doe" + OsUtils.LINE_SEPARATOR +
            "Position: Map Maker" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 4
Source File: SettingsCommandsTest.java    From geoserver-shell with MIT License 6 votes vote down vote up
@Test
public void listLocalSettings() throws Exception {
    String url = "/geoserver/rest/workspaces/topp/settings.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("localSettings.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    SettingsCommands commands = new SettingsCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.listLocal("topp");
    String expected = "Settings" + OsUtils.LINE_SEPARATOR +
            "   Charset: UTF-8" + OsUtils.LINE_SEPARATOR +
            "   Number of Decimals: 4" + OsUtils.LINE_SEPARATOR +
            "   Online Resource: null" + OsUtils.LINE_SEPARATOR +
            "   Verbose: false" + OsUtils.LINE_SEPARATOR +
            "   Verbose Exceptions: false" + OsUtils.LINE_SEPARATOR +
            "" + OsUtils.LINE_SEPARATOR +
            "Contact" + OsUtils.LINE_SEPARATOR +
            "   City: null" + OsUtils.LINE_SEPARATOR +
            "   Country: null" + OsUtils.LINE_SEPARATOR +
            "   Type: work" + OsUtils.LINE_SEPARATOR +
            "   Email: null" + OsUtils.LINE_SEPARATOR +
            "   Organization: Work" + OsUtils.LINE_SEPARATOR +
            "   Name: John Doe" + OsUtils.LINE_SEPARATOR +
            "   Position: null" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 5
Source File: OWSCommandsTest.java    From geoserver-shell with MIT License 6 votes vote down vote up
@Test
public void listWcsSettingsForWorkspace() throws Exception {
    String url = "/geoserver/rest/services/wcs/workspaces/topp/settings.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("wcs.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    OWSCommands commands = new OWSCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.wcsList("topp");
    String expected = "WCS" + OsUtils.LINE_SEPARATOR +
            "   Enabled: true" + OsUtils.LINE_SEPARATOR +
            "   Cite Compliant: false" + OsUtils.LINE_SEPARATOR +
            "   Schema Base URL: http://schemas.opengis.net" + OsUtils.LINE_SEPARATOR +
            "   Verbose: false" + OsUtils.LINE_SEPARATOR +
            "   GML Prefixing: false" + OsUtils.LINE_SEPARATOR +
            "   LatLon: false" + OsUtils.LINE_SEPARATOR +
            "   Max Input Memory: -1" + OsUtils.LINE_SEPARATOR +
            "   Max Output Memory: -1" + OsUtils.LINE_SEPARATOR +
            "   Subsampling Enabled: false" + OsUtils.LINE_SEPARATOR +
            "   Versions:" + OsUtils.LINE_SEPARATOR +
            "      1.0.0" + OsUtils.LINE_SEPARATOR +
            "      1.1.1" + OsUtils.LINE_SEPARATOR +
            "      2.0.1" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 6
Source File: LayerCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void listLayers() throws Exception {
    String url = "/geoserver/rest/layers.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("layers.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    LayerCommands commands = new LayerCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.list();
    String expected = "lines" + OsUtils.LINE_SEPARATOR +
            "points" + OsUtils.LINE_SEPARATOR +
            "polygons" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 7
Source File: GeoWebCacheCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void listLayers() throws Exception {
    String url = "/geoserver/gwc/rest/layers";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("gwc_layers.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    GeoWebCacheCommands commands = new GeoWebCacheCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.listLayers();
    String expected = "nurc:Arc_Sample" + OsUtils.LINE_SEPARATOR +
            "nurc:Img_Sample" + OsUtils.LINE_SEPARATOR +
            "nurc:Pk50095" + OsUtils.LINE_SEPARATOR +
            "nurc:mosaic" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 8
Source File: WmsStoreCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void listStores() throws Exception {
    String url = "/geoserver/rest/workspaces/topp/wmsstores.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("wmsStores.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    WmsStoreCommands commands = new WmsStoreCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.listStores("topp");
    String expected = "massgis" + OsUtils.LINE_SEPARATOR +
            "usgs" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 9
Source File: CoverageCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void getCoverage() throws Exception {
    String url = "/geoserver/rest/workspaces/nurc/coveragestores/mosaic/coverages/mosaic.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("coverage.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    CoverageCommands commands = new CoverageCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.get("nurc", "mosaic", "mosaic");
    String expected = "mosaic" + OsUtils.LINE_SEPARATOR +
            "   Namespace: nurc" + OsUtils.LINE_SEPARATOR +
            "   Title: mosaic" + OsUtils.LINE_SEPARATOR +
            "   Abstract: null" + OsUtils.LINE_SEPARATOR +
            "   Native Name: mosaic" + OsUtils.LINE_SEPARATOR +
            "   Native Format: ImageMosaic" + OsUtils.LINE_SEPARATOR +
            "   Store Name: mosaic" + OsUtils.LINE_SEPARATOR +
            "   BBox: 6.346,36.492,20.83,46.591" + OsUtils.LINE_SEPARATOR +
            "   SRS: EPSG:4326" + OsUtils.LINE_SEPARATOR +
            "   Native CRS: GEOGCS[\"WGS 84\"," + OsUtils.LINE_SEPARATOR +
            "\t\tDATUM[\"World Geodetic System 1984\"," + OsUtils.LINE_SEPARATOR +
            "\t\tSPHEROID[\"WGS 84\", 6378137.0, 298.257223563, AUTHORITY[\"EPSG\",\"7030\"]]," + OsUtils.LINE_SEPARATOR +
            "\t\tAUTHORITY[\"EPSG\",\"6326\"]]," + OsUtils.LINE_SEPARATOR +
            "\t\tPRIMEM[\"Greenwich\", 0.0, AUTHORITY[\"EPSG\",\"8901\"]]," + OsUtils.LINE_SEPARATOR +
            "\t\tUNIT[\"degree\", 0.017453292519943295]," + OsUtils.LINE_SEPARATOR +
            "\t\tAXIS[\"Geodetic longitude\", EAST]," + OsUtils.LINE_SEPARATOR +
            "\t\tAXIS[\"Geodetic latitude\", NORTH]," + OsUtils.LINE_SEPARATOR +
            "\t\tAUTHORITY[\"EPSG\",\"4326\"]]" + OsUtils.LINE_SEPARATOR +
            "\t" + OsUtils.LINE_SEPARATOR +
            "   Dimension Info: " + OsUtils.LINE_SEPARATOR +
            "   Metadata List: " + OsUtils.LINE_SEPARATOR +
            "      dirName: mosaic_mosaic" + OsUtils.LINE_SEPARATOR +
            "   Attribute List: " + OsUtils.LINE_SEPARATOR;
    assertStringsEquals(expected, actual, true);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 10
Source File: GeoWebCacheCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void getStatus() throws Exception {
    String url = "/geoserver/gwc/rest/seed.json";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("gwc_status.json")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    GeoWebCacheCommands commands = new GeoWebCacheCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.status(null);
    String expected = "Tasks:" + OsUtils.LINE_SEPARATOR +
            "   Task ID: 1" + OsUtils.LINE_SEPARATOR +
            "      Status: Running" + OsUtils.LINE_SEPARATOR +
            "      # Tile Processed: 17888" + OsUtils.LINE_SEPARATOR +
            "      Total # of Tiles to Process: 44739250" + OsUtils.LINE_SEPARATOR +
            "      # of Remaining Tiles: 18319" + OsUtils.LINE_SEPARATOR +
            "   Task ID: 2" + OsUtils.LINE_SEPARATOR +
            "      Status: Running" + OsUtils.LINE_SEPARATOR +
            "      # Tile Processed: 17744" + OsUtils.LINE_SEPARATOR +
            "      Total # of Tiles to Process: 44739250" + OsUtils.LINE_SEPARATOR +
            "      # of Remaining Tiles: 18468" + OsUtils.LINE_SEPARATOR +
            "   Task ID: 3" + OsUtils.LINE_SEPARATOR +
            "      Status: Pending" + OsUtils.LINE_SEPARATOR +
            "      # Tile Processed: 16608" + OsUtils.LINE_SEPARATOR +
            "      Total # of Tiles to Process: 44739250" + OsUtils.LINE_SEPARATOR +
            "      # of Remaining Tiles: 19733" + OsUtils.LINE_SEPARATOR +
            "   Task ID: 4" + OsUtils.LINE_SEPARATOR +
            "      Status: Pending" + OsUtils.LINE_SEPARATOR +
            "      # Tile Processed: 0" + OsUtils.LINE_SEPARATOR +
            "      Total # of Tiles to Process: 1000" + OsUtils.LINE_SEPARATOR +
            "      # of Remaining Tiles: 1000" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 11
Source File: NamespaceCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void getDefaultNamespace() throws Exception {
    whenHttp(server).match(get("/geoserver/rest/namespaces/default.xml")).then(stringContent("<namespace><prefix>cite</prefix><uri>http://cite.org</uri></namespace>"), status(HttpStatus.OK_200));

    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    NamespaceCommands commands = new NamespaceCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.getDefault();
    String expected = "cite" + OsUtils.LINE_SEPARATOR + "http://cite.org";
    assertEquals(expected, actual);

    verifyHttp(server).once(method(Method.GET), uri("/geoserver/rest/namespaces/default.xml"));
}
 
Example 12
Source File: LayerCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void listLayerStyles() throws Exception {
    String url = "/geoserver/rest/layers/streams/styles.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("layerStyles.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    LayerCommands commands = new LayerCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.listStyles("streams");
    String expected = "highway" + OsUtils.LINE_SEPARATOR +
            "interstate" + OsUtils.LINE_SEPARATOR +
            "road" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 13
Source File: CoverageStoreCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void getCoverageStore() throws Exception {
    String url = "/geoserver/rest/workspaces/nurc/coveragestores/arcGridSample.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("coveragestore.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    CoverageStoreCommands commands = new CoverageStoreCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.get("nurc", "arcGridSample");
    String expected = "arcGridSample" + OsUtils.LINE_SEPARATOR +
            "   Type: ArcGrid" + OsUtils.LINE_SEPARATOR +
            "   URL: file:coverages/arc_sample/precip30min.asc" + OsUtils.LINE_SEPARATOR +
            "   Enabled: true" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 14
Source File: LayerGroupCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void getLayerGroupWithWorkspace() throws Exception {
    String url = "/geoserver/rest/workspaces/topp/layergroups/spearfish.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("layergroup.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    LayerGroupCommands commands = new LayerGroupCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.get("spearfish", "topp");
    String expected = "spearfish" + OsUtils.LINE_SEPARATOR +
            "   Title: null" + OsUtils.LINE_SEPARATOR +
            "   Abstract: null" + OsUtils.LINE_SEPARATOR +
            "   Workspace: null" + OsUtils.LINE_SEPARATOR +
            "   Mode: SINGLE" + OsUtils.LINE_SEPARATOR +
            "   CRS: EPSG:26713" + OsUtils.LINE_SEPARATOR +
            "   Bounds: 589425.9342365642, 4913959.224611808, 609518.6719560538, 4928082.949945881" + OsUtils.LINE_SEPARATOR +
            "   Layers: " + OsUtils.LINE_SEPARATOR +
            "      None" + OsUtils.LINE_SEPARATOR +
            "   Publishables: " + OsUtils.LINE_SEPARATOR +
            "      sfdem" + OsUtils.LINE_SEPARATOR +
            "      streams" + OsUtils.LINE_SEPARATOR +
            "      roads" + OsUtils.LINE_SEPARATOR +
            "      restricted" + OsUtils.LINE_SEPARATOR +
            "      archsites" + OsUtils.LINE_SEPARATOR +
            "      bugsites" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 15
Source File: FeatureTypeCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void listFeatureTypes() throws Exception {
    String url = "/geoserver/rest/workspaces/topp/datastores/taz_shapes/featuretypes.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("featuretypes.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    FeatureTypeCommands commands = new FeatureTypeCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.list("topp", "taz_shapes", "configured");
    String expected = "tasmania_cities" + OsUtils.LINE_SEPARATOR + "tasmania_hydro" + OsUtils.LINE_SEPARATOR + "tasmania_parcels" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);
    assertEquals("configured", server.getCalls().get(0).getParameters().get("list")[0]);
    verifyHttp(server).once(method(Method.GET), uri(url));
}
 
Example 16
Source File: ScriptCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void getSession() throws Exception {
    whenHttp(server).match(get("/geoserver/rest/sessions/groovy/1")).then(stringContent(getResourceString("session.json")), status(HttpStatus.OK_200));

    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    ScriptCommands commands = new ScriptCommands();
    commands.setGeoserver(geoserver);

    String actual = commands.getSession("groovy","1");
    String expected = "1 groovy" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);

    verifyHttp(server).once(method(Method.GET), uri("/geoserver/rest/sessions/groovy/1"));
}
 
Example 17
Source File: ScriptCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void listApp() throws Exception {
    whenHttp(server).match(get("/geoserver/rest/scripts/apps.json")).then(stringContent(getResourceString("scripts.json")), status(HttpStatus.OK_200));

    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    ScriptCommands commands = new ScriptCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.listApps();
    String expected = "buffer.groovy" + OsUtils.LINE_SEPARATOR + "merge.groovy" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);

    verifyHttp(server).once(method(Method.GET), uri("/geoserver/rest/scripts/apps.json"));
}
 
Example 18
Source File: ScriptCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void listWfsTx() throws Exception {
    whenHttp(server).match(get("/geoserver/rest/scripts/wfs/tx.json")).then(stringContent(getResourceString("scripts.json")), status(HttpStatus.OK_200));

    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    ScriptCommands commands = new ScriptCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.listWfsTx();
    String expected = "buffer.groovy" + OsUtils.LINE_SEPARATOR + "merge.groovy" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);

    verifyHttp(server).once(method(Method.GET), uri("/geoserver/rest/scripts/wfs/tx.json"));
}
 
Example 19
Source File: FontCommandsTest.java    From geoserver-shell with MIT License 5 votes vote down vote up
@Test
public void fontListWithSearch() throws Exception {
    whenHttp(server).match(get("/geoserver/rest/fonts.xml")).then(stringContent(getResourceString("fonts.xml")), status(HttpStatus.OK_200));

    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    FontCommands commands = new FontCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.list("Lu");
    String expected = "Lucida Bright Demibold Italic" + OsUtils.LINE_SEPARATOR +
            "LucidaSans" + OsUtils.LINE_SEPARATOR;
    assertEquals(expected, actual);

    verifyHttp(server).once(method(Method.GET), uri("/geoserver/rest/fonts.xml"));
}
 
Example 20
Source File: WmsStoreCommandsTest.java    From geoserver-shell with MIT License 4 votes vote down vote up
@Test
public void getLayer() throws Exception {
    String url = "/geoserver/rest/workspaces/topp/wmsstores/massgis/wmslayers/massgis:WELLS.WELLS_PT.xml";
    whenHttp(server).match(get(url)).then(stringContent(getResourceString("wms_layer.xml")), status(HttpStatus.OK_200));
    Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
    WmsStoreCommands commands = new WmsStoreCommands();
    commands.setGeoserver(geoserver);
    String actual = commands.getLayer("topp", "massgis", "massgis:WELLS.WELLS_PT");
    String expected = "massgis:WELLS.WELLS_PT" + OsUtils.LINE_SEPARATOR +
            "   Native Name: massgis:WELLS.WELLS_PT" + OsUtils.LINE_SEPARATOR +
            "   Title: DCR Well Points" + OsUtils.LINE_SEPARATOR +
            "   Description: Generated from webeditor_sde" + OsUtils.LINE_SEPARATOR +
            "   Enabled: true" + OsUtils.LINE_SEPARATOR +
            "   Advertised: true" + OsUtils.LINE_SEPARATOR +
            "   Namespace: topp" + OsUtils.LINE_SEPARATOR +
            "   Keywords: " + OsUtils.LINE_SEPARATOR +
            "      WELLS.WELLS_PT" + OsUtils.LINE_SEPARATOR +
            "      webeditor_sde" + OsUtils.LINE_SEPARATOR +
            "   Native CRS: PROJCS[\"NAD83 / Massachusetts Mainland\"," + OsUtils.LINE_SEPARATOR +
            "		GEOGCS[\"NAD83\"," + OsUtils.LINE_SEPARATOR +
            "		DATUM[\"North American Datum 1983\"," + OsUtils.LINE_SEPARATOR +
            "		SPHEROID[\"GRS 1980\", 6378137.0, 298.257222101, AUTHORITY[\"EPSG\",\"7019\"]]," + OsUtils.LINE_SEPARATOR +
            "		TOWGS84[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]," + OsUtils.LINE_SEPARATOR +
            "		AUTHORITY[\"EPSG\",\"6269\"]]," + OsUtils.LINE_SEPARATOR +
            "		PRIMEM[\"Greenwich\", 0.0, AUTHORITY[\"EPSG\",\"8901\"]]," + OsUtils.LINE_SEPARATOR +
            "		UNIT[\"degree\", 0.017453292519943295]," + OsUtils.LINE_SEPARATOR +
            "		AXIS[\"Geodetic longitude\", EAST]," + OsUtils.LINE_SEPARATOR +
            "		AXIS[\"Geodetic latitude\", NORTH]," + OsUtils.LINE_SEPARATOR +
            "		AUTHORITY[\"EPSG\",\"4269\"]]," + OsUtils.LINE_SEPARATOR +
            "		PROJECTION[\"Lambert_Conformal_Conic_2SP\", AUTHORITY[\"EPSG\",\"9802\"]]," + OsUtils.LINE_SEPARATOR +
            "		PARAMETER[\"central_meridian\", -71.5]," + OsUtils.LINE_SEPARATOR +
            "		PARAMETER[\"latitude_of_origin\", 41.0]," + OsUtils.LINE_SEPARATOR +
            "		PARAMETER[\"standard_parallel_1\", 42.68333333333334]," + OsUtils.LINE_SEPARATOR +
            "		PARAMETER[\"false_easting\", 200000.0]," + OsUtils.LINE_SEPARATOR +
            "		PARAMETER[\"false_northing\", 750000.0]," + OsUtils.LINE_SEPARATOR +
            "		PARAMETER[\"scale_factor\", 1.0]," + OsUtils.LINE_SEPARATOR +
            "		PARAMETER[\"standard_parallel_2\", 41.71666666666667]," + OsUtils.LINE_SEPARATOR +
            "		UNIT[\"m\", 1.0]," + OsUtils.LINE_SEPARATOR +
            "		AXIS[\"Easting\", EAST]," + OsUtils.LINE_SEPARATOR +
            "		AXIS[\"Northing\", NORTH]," + OsUtils.LINE_SEPARATOR +
            "		AUTHORITY[\"EPSG\",\"26986\"]]" + OsUtils.LINE_SEPARATOR +
            "	" + OsUtils.LINE_SEPARATOR +
            "   SRS: EPSG:26986" + OsUtils.LINE_SEPARATOR +
            "   Projection Policy: FORCE_DECLARED" + OsUtils.LINE_SEPARATOR +
            "   Native Bounding Box: 33863.73245999857,777606.3746099799,330836.9724600009,959743.0446099902 EPSG:26986" + OsUtils.LINE_SEPARATOR +
            "   LatLon Bounding Box: -73.53331821222113,41.23116987753426,-69.89858964987232,42.88811062709496 EPSG:26986" + OsUtils.LINE_SEPARATOR +
            "   Store: massgis" + OsUtils.LINE_SEPARATOR;
    assertStringsEquals(expected, actual, true);
    verifyHttp(server).once(method(Method.GET), uri(url));
}