Search in sources :

Example 16 with GeoPlatformServer

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);
}
Also used : GeoPlatformServer(org.geosdi.geoplatform.core.model.GeoPlatformServer) Test(org.junit.Test)

Example 17 with GeoPlatformServer

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);
}
Also used : GeoPlatformServer(org.geosdi.geoplatform.core.model.GeoPlatformServer) Test(org.junit.Test)

Example 18 with GeoPlatformServer

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);
}
Also used : GeoPlatformServer(org.geosdi.geoplatform.core.model.GeoPlatformServer) Test(org.junit.Test)

Example 19 with GeoPlatformServer

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;
}
Also used : GeoPlatformServer(org.geosdi.geoplatform.core.model.GeoPlatformServer)

Example 20 with GeoPlatformServer

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);
    }
}
Also used : GeoPlatformServer(org.geosdi.geoplatform.core.model.GeoPlatformServer) GPDAOException(org.geosdi.geoplatform.persistence.dao.exception.GPDAOException) GPDAOException(org.geosdi.geoplatform.persistence.dao.exception.GPDAOException)

Aggregations

GeoPlatformServer (org.geosdi.geoplatform.core.model.GeoPlatformServer)40 Test (org.junit.Test)15 ResourceNotFoundFault (org.geosdi.geoplatform.exception.ResourceNotFoundFault)9 ServerDTO (org.geosdi.geoplatform.response.ServerDTO)8 GPOrganization (org.geosdi.geoplatform.core.model.GPOrganization)6 GPDAOException (org.geosdi.geoplatform.persistence.dao.exception.GPDAOException)6 ServerCSWDTO (org.geosdi.geoplatform.responce.ServerCSWDTO)3 Ignore (org.junit.Ignore)3 MalformedURLException (java.net.MalformedURLException)2 ArrayList (java.util.ArrayList)2 JAXBElement (javax.xml.bind.JAXBElement)2 IllegalParameterFault (org.geosdi.geoplatform.exception.IllegalParameterFault)2 ServerInternalFault (org.geosdi.geoplatform.exception.ServerInternalFault)2 PaginatedSearchRequest (org.geosdi.geoplatform.request.PaginatedSearchRequest)2 WSSaveServerRequest (org.geosdi.geoplatform.request.server.WSSaveServerRequest)2 RasterLayerDTO (org.geosdi.geoplatform.response.RasterLayerDTO)2 IOException (java.io.IOException)1 URL (java.net.URL)1 Calendar (java.util.Calendar)1 GregorianCalendar (java.util.GregorianCalendar)1