use of org.geosdi.geoplatform.core.model.GPOrganization in project geo-platform by geosdi.
the class ShortAccountDTOFactoryMassiveTest method createGPUser.
private GPUser createGPUser(int i) {
GPUser user = new GPUser();
user.setId(new Long(i));
user.setName("TEST" + i);
user.setUsername("TEST" + i);
user.setEmailAddress("user@test.it");
user.setSendEmail(Boolean.FALSE);
user.setOrganization(new GPOrganization("ORGANIZATION_TEST"));
user.setName("USER_TEST" + i);
return user;
}
use of org.geosdi.geoplatform.core.model.GPOrganization in project geo-platform by geosdi.
the class CSWCatalogTest method setUp.
@Before
public void setUp() throws Exception {
logger.trace("\n\t@@@ {}.setUp @@@", this.getClass().getSimpleName());
organizationTest = new GPOrganization(organizationNameTest);
organizationTest.setId(gpWSClient.insertOrganization(organizationTest));
// Insert the servers test
serverTestOur = this.createCSWServer("CSW Server WS Test", geosdiProvider.getGeosdiUrl(), organizationTest);
serverTestOurID = cswService.insertServerCSW(serverTestOur);
serverTestOur.setId(serverTestOurID);
serverTestTrevisoID = cswService.insertServerCSW(this.createCSWServer("Provincia di Treviso", "http://ows.provinciatreviso.it/geonetwork/srv/it/csw", organizationTest));
// Create the CSW search parameters
catalogFinder = new CatalogFinderBean();
catalogFinder.setServerID(serverTestOurID);
TextInfo searchInfo = new TextInfo();
searchInfo.setText(null);
searchInfo.setSearchTitle(true);
searchInfo.setSearchAbstract(true);
searchInfo.setSearchSubjects(true);
catalogFinder.setTextInfo(searchInfo);
catalogFinder.setAreaInfo(new AreaInfo());
catalogFinder.setTimeInfo(new TimeInfo());
}
use of org.geosdi.geoplatform.core.model.GPOrganization in project geo-platform by geosdi.
the class BaseSoapServiceTest method setUpOrganization.
@Override
protected void setUpOrganization() throws IllegalParameterFault {
organizationTest = new GPOrganization(organizationNameTest);
organizationTest.setId(gpWSClient.insertOrganization(organizationTest));
}
use of org.geosdi.geoplatform.core.model.GPOrganization in project geo-platform by geosdi.
the class WSAccountTest method testInsertIncorrectUserWRTUOrganization.
@Test
public void testInsertIncorrectUserWRTUOrganization() {
GPUser user = super.createUser("no-organization", new GPOrganization("organization-inexistent"), USER);
try {
gpWSClient.insertAccount(new InsertAccountRequest(user, FALSE));
fail("User incorrect wrt organization");
} catch (IllegalParameterFault ex) {
if (!ex.getMessage().toLowerCase().contains("organization")) {
// Must be fail for other reasons
fail("Not fail for User incorrect wrt organization, but for: " + ex.getMessage());
}
}
}
use of org.geosdi.geoplatform.core.model.GPOrganization in project geo-platform by geosdi.
the class RSAccountTest method testInsertIncorrectUserWRTUOrganizationRest.
@Test
public void testInsertIncorrectUserWRTUOrganizationRest() throws Exception {
GPUser user = super.createUser("no-organization-rs", new GPOrganization("organization-inexistent-rs"), GPRole.USER);
try {
gpWSClient.insertAccount(new InsertAccountRequest(user, Boolean.FALSE));
Assert.fail("User incorrect wrt organization");
} catch (ClientErrorException ex) {
GPRestExceptionMessage exMess = ex.getResponse().readEntity(GPRestExceptionMessage.class);
logger.debug("\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ {}\n", exMess);
if (!exMess.getMessage().toLowerCase().contains("organization")) {
// Must be fail for other reasons
Assert.fail("Not fail for User incorrect wrt organization, but for: " + ex.getMessage());
}
}
}
Aggregations