Search in sources :

Example 1 with WSSaveServerRequest

use of org.geosdi.geoplatform.request.server.WSSaveServerRequest in project geo-platform by geosdi.

the class RSServerTest method testSaveServerRest.

@Test
public void testSaveServerRest() throws ResourceNotFoundFault, IllegalParameterFault {
    logger.trace("\n@@@ testSaveServer @@@");
    // Server is into DB
    ServerDTO serverGeoSDI = gpWSClient.getShortServer(serverUrlGeoSDI);
    Assert.assertNotNull(serverGeoSDI);
    ServerDTO serverDTO = gpWSClient.saveServer(new WSSaveServerRequest(serverGeoSDI.getId(), "geoSDI", serverUrlGeoSDI, organizationTest.getName()));
    Assert.assertNotNull("ServerDTO geoSDI is NULL", serverDTO);
    Assert.assertEquals("ServerDTO geoSDI alias is wrong", "geoSDI", serverDTO.getAlias());
    // Server is NOT into DB
    String serverUrlEx = "http://iws.erdas.com/ecwp/ecw_wms.dll?request=GetCapabilities";
    serverDTO = gpWSClient.saveServer(new WSSaveServerRequest(null, "Erdas", serverUrlEx, organizationTest.getName()));
    Assert.assertNotNull("ServerDTO EX is NULL", serverDTO);
    // Check if the server was insert
    GeoPlatformServer serverEx = gpWSClient.getServerDetailByUrl(serverUrlEx);
    Assert.assertNotNull("Server Ex is NULL for URL", serverEx);
    Assert.assertEquals("Server Ex URL is NOT correct", serverUrlEx, serverEx.getServerUrl());
    Assert.assertEquals("Server Ex ID is NOT correct", serverDTO.getId(), serverEx.getId());
    // Delete server
    gpWSClient.deleteServer(serverEx.getId());
}
Also used : ServerDTO(org.geosdi.geoplatform.response.ServerDTO) GeoPlatformServer(org.geosdi.geoplatform.core.model.GeoPlatformServer) WSSaveServerRequest(org.geosdi.geoplatform.request.server.WSSaveServerRequest) Test(org.junit.Test)

Example 2 with WSSaveServerRequest

use of org.geosdi.geoplatform.request.server.WSSaveServerRequest in project geo-platform by geosdi.

the class SOAPServerTest method testSaveServer.

@Test
public void testSaveServer() throws ResourceNotFoundFault, IllegalParameterFault {
    logger.trace("\n@@@ testSaveServer @@@");
    // Server is into DB
    ServerDTO serverGeoSDI = gpWSClient.getShortServer(serverUrlGeoSDI);
    Assert.assertNotNull(serverGeoSDI);
    ServerDTO serverDTO = gpWSClient.saveServer(new WSSaveServerRequest(serverGeoSDI.getId(), "geoSDI", serverUrlGeoSDI, organizationTest.getName()));
    Assert.assertNotNull("ServerDTO geoSDI is NULL", serverDTO);
    Assert.assertEquals("ServerDTO geoSDI alias is wrong", serverDTO.getAlias(), "geoSDI");
    // Server is NOT into DB
    String serverUrlEx = "http://iws.erdas.com/ecwp/ecw_wms.dll?request=GetCapabilities";
    serverDTO = gpWSClient.saveServer(new WSSaveServerRequest(null, "Erdas", serverUrlEx, organizationTest.getName()));
    Assert.assertNotNull("ServerDTO EX is NULL", serverDTO);
    // Check if the server was insert
    GeoPlatformServer serverEx = gpWSClient.getServerDetailByUrl(serverUrlEx);
    Assert.assertNotNull("Server Ex is NULL for URL", serverEx);
    Assert.assertEquals("Server Ex URL is NOT correct", serverUrlEx, serverEx.getServerUrl());
    Assert.assertEquals("Server Ex ID is NOT correct", serverDTO.getId(), serverEx.getId());
    // Delete server
    gpWSClient.deleteServer(serverEx.getId());
}
Also used : ServerDTO(org.geosdi.geoplatform.response.ServerDTO) GeoPlatformServer(org.geosdi.geoplatform.core.model.GeoPlatformServer) WSSaveServerRequest(org.geosdi.geoplatform.request.server.WSSaveServerRequest) Test(org.junit.Test)

Aggregations

GeoPlatformServer (org.geosdi.geoplatform.core.model.GeoPlatformServer)2 WSSaveServerRequest (org.geosdi.geoplatform.request.server.WSSaveServerRequest)2 ServerDTO (org.geosdi.geoplatform.response.ServerDTO)2 Test (org.junit.Test)2