use of org.geosdi.geoplatform.core.model.GPOrganization in project geo-platform by geosdi.
the class WSAccountTest method testAllOrganizationAccounts.
@Test
public void testAllOrganizationAccounts() throws Exception {
// Initial test
List<ShortAccountDTO> accountList = gpWSClient.getAccounts(organizationNameTest).getAccounts();
assertNotNull(accountList);
int numAccounts = accountList.size();
logger.info("\n*** Number of Accounts for Organization \"{}\": {} ***", organizationNameTest, numAccounts);
for (ShortAccountDTO account : accountList) {
assertEquals(organizationNameTest, account.getOrganization());
}
// Insert User of the organization for test
this.createAndInsertUser("to_search", organizationTest, USER);
// Insert the other Organization and a User for it
GPOrganization otherOrganization = new GPOrganization("other_organization_ws_test");
Long otherOrganizationID = gpWSClient.insertOrganization(otherOrganization);
this.createAndInsertUser("none_search", otherOrganization, USER);
// Final test
accountList = gpWSClient.getAccounts(organizationNameTest).getAccounts();
assertNotNull(accountList);
assertEquals(numAccounts + 1, accountList.size());
for (ShortAccountDTO account : accountList) {
assertEquals(organizationNameTest, account.getOrganization());
}
// Delete the other Organization
gpWSClient.deleteOrganization(otherOrganizationID);
}
use of org.geosdi.geoplatform.core.model.GPOrganization in project geo-platform by geosdi.
the class BasicRestServiceTest method setUpOrganization.
@Override
protected void setUpOrganization() throws IllegalParameterFault {
organizationTest = new GPOrganization(organizationNameRSTest);
organizationTest.setId(gpWSClient.insertOrganization(organizationTest));
}
use of org.geosdi.geoplatform.core.model.GPOrganization in project geo-platform by geosdi.
the class RSAccountTest method testAllOrganizationAccountsRest.
@Test
public void testAllOrganizationAccountsRest() throws Exception {
// Initial test
List<ShortAccountDTO> accountList = gpWSClient.getAccounts(organizationNameRSTest).getAccounts();
Assert.assertNotNull(accountList);
int numAccounts = accountList.size();
logger.info("\n*** Number of Accounts for Organization \"{}\": {} ***", organizationNameRSTest, numAccounts);
for (ShortAccountDTO account : accountList) {
Assert.assertEquals(organizationNameRSTest, account.getOrganization());
}
// Insert User of the organization for test
this.createAndInsertUser("to_search", organizationTest, GPRole.USER);
// Insert the other Organization and a User for it
GPOrganization otherOrganization = new GPOrganization("other_organization_ws_test");
Long otherOrganizationID = gpWSClient.insertOrganization(otherOrganization);
this.createAndInsertUser("none_search", otherOrganization, GPRole.USER);
// Final test
accountList = gpWSClient.getAccounts(organizationNameRSTest).getAccounts();
Assert.assertNotNull(accountList);
Assert.assertEquals(numAccounts + 1, accountList.size());
for (ShortAccountDTO account : accountList) {
Assert.assertEquals(organizationNameRSTest, account.getOrganization());
}
// Delete the other Organization
gpWSClient.deleteOrganization(otherOrganizationID);
}
use of org.geosdi.geoplatform.core.model.GPOrganization in project geo-platform by geosdi.
the class CSWEntityCorrectness method checkCSWServer.
// ==========================================================================
// === Server
// ==========================================================================
public static void checkCSWServer(GeoPlatformServer server) throws IllegalParameterFault {
if (server.getServerType() != GPCapabilityType.CSW) {
throw new IllegalParameterFault("Server is not a CSW server.");
}
String url = server.getServerUrl();
if (url == null) {
throw new IllegalParameterFault("Server URL must not be null.");
}
if (!url.startsWith("http://") && !url.startsWith("https://")) {
throw new IllegalParameterFault("URL must be start with \"http://\" or \"https://\".");
}
GPOrganization organization = server.getOrganization();
if (organization == null) {
throw new IllegalParameterFault("Server Organization must not be null.");
}
}
use of org.geosdi.geoplatform.core.model.GPOrganization in project geo-platform by geosdi.
the class ShortAccountDTOFactoryMassiveTest method createGPApplication.
private GPApplication createGPApplication(int i) {
int f = ++i * 20;
GPApplication application = new GPApplication();
application.setId(new Long(f));
application.setOrganization(new GPOrganization("ORGANIZATION_" + "APPLICATION_TEST"));
application.setAppID("APPLICATION_TEST" + f);
return application;
}
Aggregations