diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAOTest.java index 75ae561b20058cfcd3c8dcd69279b17a9bac9dcc..51e4ff3a373bafa334ee8004b5e77a1cce886c01 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAOTest.java @@ -151,7 +151,7 @@ public class ExperimentDAOTest extends AbstractDAOTest List<ExperimentPE> experiments = daoFactory.getExperimentDAO().listExperiments(); Collections.sort(experiments); assertEqualsOrGreater(7, experiments.size()); - final ExperimentPE expInDefault = experiments.get(0); + final ExperimentPE expInDefault = experiments.get(8); assertEquals(CISD_CISD_DEFAULT_EXP_REUSE, expInDefault.getIdentifier()); final ProjectPE projectDefault = expInDefault.getProject(); @@ -201,7 +201,7 @@ public class ExperimentDAOTest extends AbstractDAOTest List<ExperimentPE> experiments = daoFactory.getExperimentDAO().listExperiments(); Collections.sort(experiments); assertEqualsOrGreater(7, experiments.size()); - final ExperimentPE exp = experiments.get(0); + final ExperimentPE exp = experiments.get(8); assertEquals(CISD_CISD_DEFAULT_EXP_REUSE, exp.getIdentifier()); final SpacePE spaceCisd = exp.getProject().getSpace(); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/GroupDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/GroupDAOTest.java index dde26a97a87711768fc5b2517707ba2f11ef8f8b..7b33b7794dd22e1ed8a1ddea9219907411d66ab4 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/GroupDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/GroupDAOTest.java @@ -63,10 +63,12 @@ public final class GroupDAOTest extends AbstractDAOTest { final List<SpacePE> groups = daoFactory.getSpaceDAO().listSpaces(); Collections.sort(groups); - assertEquals("CISD", groups.get(0).getCode()); - assertEquals("TEST-SPACE", groups.get(1).getCode()); - assertEquals("TESTGROUP", groups.get(2).getCode()); - assertEquals(3, groups.size()); + assertEquals("AUTH-SPACE-1", groups.get(0).getCode()); + assertEquals("AUTH-SPACE-2", groups.get(1).getCode()); + assertEquals("CISD", groups.get(2).getCode()); + assertEquals("TEST-SPACE", groups.get(3).getCode()); + assertEquals("TESTGROUP", groups.get(4).getCode()); + assertEquals(5, groups.size()); } @Test @@ -75,10 +77,12 @@ public final class GroupDAOTest extends AbstractDAOTest final List<SpacePE> groups = daoFactory.getSpaceDAO().listSpaces(); Collections.sort(groups); - assertEquals("CISD", groups.get(0).getCode()); - assertEquals("TEST-SPACE", groups.get(1).getCode()); - assertEquals("TESTGROUP", groups.get(2).getCode()); - assertEquals(3, groups.size()); + assertEquals("AUTH-SPACE-1", groups.get(0).getCode()); + assertEquals("AUTH-SPACE-2", groups.get(1).getCode()); + assertEquals("CISD", groups.get(2).getCode()); + assertEquals("TEST-SPACE", groups.get(3).getCode()); + assertEquals("TESTGROUP", groups.get(4).getCode()); + assertEquals(5, groups.size()); } @Test(groups = "broken") diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PersonDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PersonDAOTest.java index f06362c8d8245ff07a8d395a4975ffe38719cff0..6e094f5ade43b479d6361dfe680b21e23a3488b1 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PersonDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PersonDAOTest.java @@ -87,7 +87,7 @@ public final class PersonDAOTest extends AbstractDAOTest personDAO.createPerson(testPerson2); personDAO.createPerson(testPerson3); final List<PersonPE> persons = personDAO.listPersons(); - assertEquals(20, persons.size()); + assertEquals(22, persons.size()); final PersonPE testPersonFromDB = personDAO.getPerson(testPerson.getId()); assertEquals(testPerson, testPersonFromDB); final PersonPE testPersonFromDB2 = personDAO.getPerson(testPerson2.getId()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ProjectDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ProjectDAOTest.java index 87e08491ea971caef5298773c8e435fdd66d0b44..830f0d9fa7901b51a781d127296b0cadd942e4e8 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ProjectDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ProjectDAOTest.java @@ -44,8 +44,7 @@ import ch.systemsx.cisd.openbis.generic.shared.util.HibernateUtils; * * @author Izabela Adamczyk */ -@Test(groups = -{ "db", "project" }) +@Test(groups = { "db", "project" }) public class ProjectDAOTest extends AbstractDAOTest { @@ -65,8 +64,17 @@ public class ProjectDAOTest extends AbstractDAOTest public static final String PROJECT_TO_DELETE = "PROJECT-TO-DELETE"; + public static final String AUTH_PROJECT_11 = "AUTH-PROJECT-11"; + + public static final String AUTH_PROJECT_12 = "AUTH-PROJECT-12"; + + public static final String AUTH_PROJECT_21 = "AUTH-PROJECT-21"; + + public static final String AUTH_PROJECT_22 = "AUTH-PROJECT-22"; + static final String[] PRELOADED_PROJECTS = - { DEFAULT, NEMO, NOE, NOE, PROJECT_TO_DELETE, TEST_PROJECT, TESTPROJ }; + { AUTH_PROJECT_11, AUTH_PROJECT_12, AUTH_PROJECT_21, AUTH_PROJECT_22, DEFAULT, NEMO, NOE, NOE, PROJECT_TO_DELETE, TEST_PROJECT, + TESTPROJ }; @Test public void testListProjects() @@ -85,7 +93,7 @@ public class ProjectDAOTest extends AbstractDAOTest { final List<ProjectPE> allProjects = daoFactory.getProjectDAO().listProjects(); Collections.sort(allProjects); - final ProjectPE defaultProject = allProjects.get(0); + final ProjectPE defaultProject = allProjects.get(4); assertEquals(DEFAULT, defaultProject.getCode()); final List<ProjectPE> groupProjects = daoFactory.getProjectDAO().listProjects(defaultProject.getSpace()); @@ -101,7 +109,7 @@ public class ProjectDAOTest extends AbstractDAOTest { final List<ProjectPE> allProjects = daoFactory.getProjectDAO().listProjects(); Collections.sort(allProjects); - final ProjectPE testProject = allProjects.get(6); + final ProjectPE testProject = allProjects.get(10); assertEquals(testProject.getCode(), TESTPROJ); final List<ProjectPE> groupProjects = daoFactory.getProjectDAO().listProjects(testProject.getSpace()); @@ -115,7 +123,7 @@ public class ProjectDAOTest extends AbstractDAOTest { final List<ProjectPE> allProjects = daoFactory.getProjectDAO().listProjects(); Collections.sort(allProjects); - final ProjectPE templateProject = allProjects.get(6); + final ProjectPE templateProject = allProjects.get(10); assertEquals(templateProject.getCode(), TESTPROJ); @@ -130,7 +138,7 @@ public class ProjectDAOTest extends AbstractDAOTest { final List<ProjectPE> allProjects = daoFactory.getProjectDAO().listProjects(); Collections.sort(allProjects); - final ProjectPE templateProject = allProjects.get(6); + final ProjectPE templateProject = allProjects.get(10); assertEquals(templateProject.getCode(), TESTPROJ); AssertJUnit.assertNull(daoFactory.getProjectDAO().tryFindProject( @@ -146,8 +154,8 @@ public class ProjectDAOTest extends AbstractDAOTest final List<ProjectPE> allProjects = daoFactory.getProjectDAO().listProjects(); Collections.sort(allProjects); - final ProjectPE noe = allProjects.get(2); - final ProjectPE testproj = allProjects.get(6); + final ProjectPE noe = allProjects.get(6); + final ProjectPE testproj = allProjects.get(10); assertEquals(noe.getCode(), NOE); assertEquals(testproj.getCode(), TESTPROJ); @@ -168,7 +176,7 @@ public class ProjectDAOTest extends AbstractDAOTest final List<ProjectPE> allProjects = daoFactory.getProjectDAO().listProjects(); Collections.sort(allProjects); - final ProjectPE noe = allProjects.get(2); + final ProjectPE noe = allProjects.get(6); assertEquals(noe.getCode(), NOE); @@ -198,7 +206,7 @@ public class ProjectDAOTest extends AbstractDAOTest { final List<ProjectPE> allProjects = daoFactory.getProjectDAO().listProjects(); Collections.sort(allProjects); - final ProjectPE templateProject = allProjects.get(6); + final ProjectPE templateProject = allProjects.get(10); assertEquals(templateProject.getCode(), TESTPROJ); AssertJUnit.assertNull(daoFactory.getProjectDAO().tryFindProject( templateProject.getSpace().getCode(), NONEXISTENT)); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/api/v1/GeneralInformationServiceJsonApiTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/api/v1/GeneralInformationServiceJsonApiTest.java index cb78eca098f4ca7f92d92b4366ca5e40a55b0bab..cb167782201d50ddd32026e32bdabad3a6819c13 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/api/v1/GeneralInformationServiceJsonApiTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/api/v1/GeneralInformationServiceJsonApiTest.java @@ -149,10 +149,10 @@ public class GeneralInformationServiceJsonApiTest extends RemoteApiTestCase }); checkSpace("CISD", "[/CISD/DEFAULT, /CISD/NEMO, /CISD/NOE]", "[ADMIN(instance), ADMIN(space), ETL_SERVER(instance), ETL_SERVER(space)]", - spaces.get(0)); + spaces.get(2)); checkSpace("TESTGROUP", "[/TESTGROUP/TESTPROJ]", - "[ADMIN(instance), ADMIN(space), ETL_SERVER(instance)]", spaces.get(2)); - assertEquals(3, spaces.size()); + "[ADMIN(instance), ADMIN(space), ETL_SERVER(instance)]", spaces.get(4)); + assertEquals(5, spaces.size()); } @Test @@ -484,7 +484,7 @@ public class GeneralInformationServiceJsonApiTest extends RemoteApiTestCase List<Experiment> result = generalInformationService.listExperiments(sessionToken, projects, "SIRNA_HCS"); assertEquals(true, result.size() > 0); - Experiment resultExperiment = result.get(0); + Experiment resultExperiment = result.get(8); boolean identifierIsOk = "/CISD/DEFAULT/EXP-REUSE".equals(resultExperiment.getIdentifier()); identifierIsOk |= "/CISD/NEMO/EXP-TEST-2".equals(resultExperiment.getIdentifier()); identifierIsOk |= diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java index 583c9d42d56fa2b071ceb6dacabf981f708b11e0..8a5f346c46ba4b0544c406b9ecc099248b33aa35 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java @@ -136,7 +136,7 @@ public class GeneralInformationServiceTest extends SystemTestCase List<SpaceWithProjectsAndRoleAssignments> spaces = generalInformationService.listSpacesWithProjectsAndRoleAssignments(sessionToken, null); - assertEquals(3, spaces.size()); + assertEquals(5, spaces.size()); loginAsObserver(); spaces = @@ -160,7 +160,7 @@ public class GeneralInformationServiceTest extends SystemTestCase } }); assertEquals( - "[/CISD/DEFAULT, /CISD/NEMO, /CISD/NOE, /TEST-SPACE/NOE, /TEST-SPACE/PROJECT-TO-DELETE, /TEST-SPACE/TEST-PROJECT, /TESTGROUP/TESTPROJ]", + "[/AUTH-SPACE-1/AUTH-PROJECT-11, /AUTH-SPACE-1/AUTH-PROJECT-12, /AUTH-SPACE-2/AUTH-PROJECT-21, /AUTH-SPACE-2/AUTH-PROJECT-22, /CISD/DEFAULT, /CISD/NEMO, /CISD/NOE, /TEST-SPACE/NOE, /TEST-SPACE/PROJECT-TO-DELETE, /TEST-SPACE/TEST-PROJECT, /TESTGROUP/TESTPROJ]", projects.toString()); loginAsObserver();