use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class CSWCatalogServerTest method testGetServerDetailById.
@Test
public void testGetServerDetailById() throws Exception {
GeoPlatformServer retrievedServer = cswService.getServerDetailCSW(serverTestOurID);
this.compareServer(serverTestOur, retrievedServer);
}
use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class CSWCatalogServerTest method testInsertServer.
@Test
public void testInsertServer() throws Exception {
// Insert the server
GeoPlatformServer server = super.createCSWServer("server_test", "http://url.test", organizationTest);
Long serverID = cswService.insertServerCSW(server);
Assert.assertNotNull(serverID);
// Retrieve the server
GeoPlatformServer retrievedServer = cswService.getServerDetailCSW(serverID);
server.setId(serverID);
this.compareServer(server, retrievedServer);
// 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 GPJacksonServerSupportTest method serverDataMappingTest.
@Test
public void serverDataMappingTest() throws Exception {
GeoPlatformServer server = jacksonSupport.getDefaultMapper().readValue(Thread.currentThread().getContextClassLoader().getResourceAsStream(SERVER_DATA_JSON), GeoPlatformServer.class);
logger.info("\n\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@SERVER_DATA_MAPPING" + " : {}\n\n", server);
super.marshall(server);
}
use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class CSWCatalogTest method createCSWServer.
protected GeoPlatformServer createCSWServer(String title, String url, GPOrganization organization) {
GeoPlatformServer server = new GeoPlatformServer();
server.setServerType(GPCapabilityType.CSW);
server.setTitle(title);
server.setServerUrl(url);
server.setOrganization(organization);
return server;
}
use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class GPServerDAOImpl method findByServerName.
/**
* @param serverName
* @return {@link List<GeoPlatformServer>}
* @throws GPDAOException
*/
@Override
public List<GeoPlatformServer> findByServerName(String serverName) throws GPDAOException {
checkArgument(((serverName != null) && !(serverName.trim().isEmpty())), "The Parameter serveName must not be null or an empty string.");
try {
CriteriaBuilder builder = super.criteriaBuilder();
CriteriaQuery<GeoPlatformServer> criteriaQuery = super.createCriteriaQuery();
Root<GeoPlatformServer> root = criteriaQuery.from(this.persistentClass);
criteriaQuery.select(root);
criteriaQuery.where(builder.equal(root.get("name"), serverName));
return this.entityManager.createQuery(criteriaQuery).getResultList();
} catch (Exception ex) {
ex.printStackTrace();
throw new GPDAOException(ex);
}
}
Aggregations