示例#1
0
  @Test
  public void testUpdateServer() throws IllegalParameterFault, ResourceNotFoundFault {
    final String serverUrlUpdated = serverUrlTest.replaceAll("org", "com");
    // Retrieve Server
    GeoPlatformServer serverTest = gpWSClient.getServerDetail(idServerTest);
    logger.debug("\n*** serverTest:\n{}\n***", serverTest);
    // Update Server
    serverTest.setServerUrl(serverUrlUpdated);
    gpWSClient.updateServer(serverTest);

    // Retrieve Server modified
    GeoPlatformServer serverModified = gpWSClient.getServerDetail(idServerTest);
    logger.debug("\n*** serverModified:\n{}\n***", serverModified);
    // Assert on Server modified
    Assert.assertNotNull(serverModified);
    Assert.assertEquals(serverTest.getServerUrl(), serverModified.getServerUrl());
  }
示例#2
0
 private GeoPlatformServer createServer(
     String serverUrl, GPCapabilityType serverType, GPOrganization organization) {
   // Create field's value from Regex on Server URL
   String serverName = serverUrl.replaceAll("http://(\\w+)\\.([^\\.]+)\\.(\\w+)", "$1.$2.$3");
   logger.trace("\n*** serverName: {} ***", serverName);
   String labelServer = serverName.replaceAll("(\\w+)\\.([^\\.]+)\\.(\\w+)", "$2");
   logger.trace("\n*** labelServer: {} ***", labelServer);
   // Create Server
   GeoPlatformServer server = new GeoPlatformServer();
   server.setServerUrl(serverUrl);
   server.setName(serverName);
   server.setTitle(labelServer);
   server.setAbstractServer("Abstract of " + labelServer);
   server.setServerType(serverType);
   server.setOrganization(organization);
   return server;
 }