use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class RSServerTest method testUpdateServerRest.
@Test
public void testUpdateServerRest() 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());
}
use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class SOAPServerTest method testGetServer.
@Test
public void testGetServer() throws ResourceNotFoundFault {
// Get Server from Id
GeoPlatformServer gpServer = gpWSClient.getServerDetail(idServerTest);
logger.debug("\n*** gpServer:\n{}\n***", gpServer);
Assert.assertNotNull(gpServer);
Assert.assertEquals("Id Server NOT match", idServerTest, gpServer.getId().longValue());
Assert.assertEquals("URL Server NOT match", serverUrlTest, gpServer.getServerUrl());
// Get Server from serverUrl
ServerDTO serverDTO = gpWSClient.getShortServer(serverUrlTest);
logger.debug("\n*** serverDTO:\n{}\n***", serverDTO);
Assert.assertNotNull(serverDTO);
Assert.assertEquals("Id Server NOT match", idServerTest, serverDTO.getId().longValue());
Assert.assertEquals("URL Server NOT match", serverUrlTest, serverDTO.getServerUrl());
}
use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class CSWCatalogServerTest method testSearchCSWServersMore.
@Test
public void testSearchCSWServersMore() throws Exception {
// Insert 27 servers (only 25 for matching wrt alias)
Long[] serverIDs = new Long[27];
for (int i = 1; i <= 27; i++) {
GeoPlatformServer server = super.createCSWServer("Mock title " + i, "http://url.mock-" + i, organizationTest);
if (i >= 3) {
server.setAliasName("Alias test " + i);
}
serverIDs[i - 1] = cswService.insertServerCSW(server);
Assert.assertNotNull(serverIDs[i - 1]);
}
// First page
// wrt title and alias
PaginatedSearchRequest request = new PaginatedSearchRequest("test", 10, 0);
List<ServerCSWDTO> search = cswService.searchCSWServers(request, super.organizationNameTest);
Assert.assertNotNull(search);
Assert.assertEquals(10, search.size());
// Second page
// wrt title and alias
request = new PaginatedSearchRequest("test", 10, 1);
search = cswService.searchCSWServers(request, super.organizationNameTest);
Assert.assertNotNull(search);
Assert.assertEquals(10, search.size());
// Third page
// wrt title and alias
request = new PaginatedSearchRequest("test", 10, 2);
search = cswService.searchCSWServers(request, super.organizationNameTest);
Assert.assertNotNull(search);
Assert.assertEquals(6, search.size());
// Delete the servers
for (Long serverID : serverIDs) {
boolean deleted = cswService.deleteServerCSW(serverID);
Assert.assertTrue(deleted);
}
}
use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class CSWCatalogServerTest method testCSWServersCountTwo.
@Test
public void testCSWServersCountTwo() throws Exception {
// Insert the server
GeoPlatformServer server = super.createCSWServer("Mock title", "http://url.mock", organizationTest);
server.setAliasName("Alias test");
Long serverID = cswService.insertServerCSW(server);
Assert.assertNotNull(serverID);
// wrt title and alias
SearchRequest request = new SearchRequest("test");
int count = cswService.getCSWServersCount(request, super.organizationNameTest);
Assert.assertEquals(2, count);
// Delete the server
boolean deleted = cswService.deleteServerCSW(serverID);
Assert.assertTrue(deleted);
}
use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class CSWCatalogServerTest method testGetServerDetailByUrl.
@Test
public void testGetServerDetailByUrl() throws Exception {
GeoPlatformServer retrievedServer = cswService.getServerDetailCSWByUrl(serverTestOur.getServerUrl());
this.compareServer(serverTestOur, retrievedServer);
}
Aggregations