Skip to content

Commit

Permalink
Test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Jan 8, 2015
1 parent d69921a commit fe03895
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 71 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2013 Evolveum
* Copyright (c) 2010-2015 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -113,10 +113,11 @@ public void test050AddResource() throws Exception {

@Test
public void test100ModifyUserAddAccount() throws Exception {
TestUtil.displayTestTile(this, "test100ModifyUserAddAccount");
final String TEST_NAME = "test100ModifyUserAddAccount";
TestUtil.displayTestTile(this, TEST_NAME);

// GIVEN
Task task = taskManager.createTaskInstance(TestModelCrudService.class.getName() + ".test100ModifyUserAddAccount");
Task task = taskManager.createTaskInstance(TestModelCrudService.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
assumeAssignmentPolicy(AssignmentPolicyEnforcementType.NONE);

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2013 Evolveum
* Copyright (c) 2010-2015 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1445,8 +1445,8 @@ private SearchResultEntry assertOpenDJAccountJack(SearchResultEntry entry, Strin
* should be also applied to the account (by schemaHandling).
*/
@Test
public void test022ChangePassword() throws Exception {
final String TEST_NAME = "test022ChangePassword";
public void test022ChangeUserPassword() throws Exception {
final String TEST_NAME = "test022ChangeUserPassword";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN

Expand All @@ -1467,8 +1467,8 @@ public void test022ChangePassword() throws Exception {
* Similar to previous test just the request is constructed a bit differently.
*/
@Test
public void test023ChangePasswordJAXB() throws Exception {
final String TEST_NAME = "test023ChangePasswordJAXB";
public void test023ChangeUserPasswordJAXB() throws Exception {
final String TEST_NAME = "test023ChangeUserPasswordJAXB";
TestUtil.displayTestTile(TEST_NAME);

// GIVEN
Expand Down Expand Up @@ -1553,9 +1553,9 @@ private void assertUserPasswordChange(String expectedUserPassword, OperationResu
* Try to disable user. As the user has an account, the account should be disabled as well.
*/
@Test
public void test030Disable() throws IOException, JAXBException, FaultMessage,
ObjectNotFoundException, SchemaException, DirectoryException {
TestUtil.displayTestTile("test030Disable");
public void test030DisableUser() throws Exception {
final String TEST_NAME = "test030DisableUser";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN

ObjectDeltaType objectChange = unmarshallValueFromFile(
Expand Down Expand Up @@ -1661,9 +1661,9 @@ public void test030Disable() throws IOException, JAXBException, FaultMessage,
* Try to enable user after it has been disabled. As the user has an account, the account should be enabled as well.
*/
@Test
public void test031Enable() throws IOException, JAXBException, FaultMessage,
ObjectNotFoundException, SchemaException, DirectoryException {
TestUtil.displayTestTile("test031Enable");
public void test031EnableUser() throws Exception {
final String TEST_NAME = "test031EnableUser";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN

ObjectDeltaType objectChange = unmarshallValueFromFile(
Expand Down Expand Up @@ -2036,10 +2036,9 @@ public void test049DeleteUser() throws SchemaException, FaultMessage, DirectoryE
}

@Test
public void test050AssignRolePirate() throws IOException, JAXBException, FaultMessage,
ObjectNotFoundException, SchemaException, EncryptionException, DirectoryException,
ObjectAlreadyExistsException {
TestUtil.displayTestTile("test050AssignRolePirate");
public void test100AssignRolePirate() throws Exception {
final String TEST_NAME = "test100AssignRolePirate";
TestUtil.displayTestTile(TEST_NAME);

// GIVEN

Expand Down Expand Up @@ -2133,8 +2132,9 @@ public void test050AssignRolePirate() throws IOException, JAXBException, FaultMe
}

@Test
public void test051AccountOwnerAfterRole() throws FaultMessage {
TestUtil.displayTestTile("test051AccountOwnerAfterRole");
public void test101AccountOwnerAfterRole() throws Exception {
final String TEST_NAME = "test101AccountOwnerAfterRole";
TestUtil.displayTestTile(TEST_NAME);

// GIVEN

Expand All @@ -2159,9 +2159,9 @@ public void test051AccountOwnerAfterRole() throws FaultMessage {


@Test
public void test052AssignRoleCaptain() throws IOException, JAXBException, FaultMessage,
ObjectNotFoundException, SchemaException, EncryptionException, DirectoryException {
TestUtil.displayTestTile("test052AssignRoleCaptain");
public void test102AssignRoleCaptain() throws Exception {
final String TEST_NAME = "test102AssignRoleCaptain";
TestUtil.displayTestTile(TEST_NAME);

// GIVEN

Expand Down Expand Up @@ -2241,9 +2241,9 @@ public void test052AssignRoleCaptain() throws IOException, JAXBException, FaultM
* Assign the same "captain" role again, this time with a slightly different assignment parameters.
*/
@Test
public void test053AssignRoleCaptainAgain() throws IOException, JAXBException, FaultMessage,
ObjectNotFoundException, SchemaException, EncryptionException, DirectoryException {
TestUtil.displayTestTile("test053AssignRoleCaptain");
public void test103AssignRoleCaptainAgain() throws Exception {
final String TEST_NAME = "test103AssignRoleCaptainAgain";
TestUtil.displayTestTile(TEST_NAME);

// GIVEN

Expand Down Expand Up @@ -2320,8 +2320,9 @@ public void test053AssignRoleCaptainAgain() throws IOException, JAXBException, F


@Test
public void test055ModifyAccount() throws Exception {
TestUtil.displayTestTile("test055ModifyAccount");
public void test105ModifyAccount() throws Exception {
final String TEST_NAME = "test105ModifyAccount";
TestUtil.displayTestTile(TEST_NAME);

// GIVEN

Expand All @@ -2333,7 +2334,7 @@ public void test055ModifyAccount() throws Exception {
OperationResultType result = modifyObjectViaModelWS(objectChange);

Task task = taskManager.createTaskInstance();
OperationResult parentResult = new OperationResult("test55ModifyAccount-get after first modify");
OperationResult parentResult = new OperationResult(TEST_NAME + "-get after first modify");
PrismObject<ShadowType> shadow= modelService.getObject(ShadowType.class, accountShadowOidGuybrushOpendj, null, task, parentResult);
assertNotNull("shadow must not be null", shadow);

Expand Down Expand Up @@ -2404,9 +2405,9 @@ public void test055ModifyAccount() throws Exception {
* Judge role excludes pirate role. This assignment should fail.
*/
@Test
public void test054AssignRoleJudge() throws IOException, JAXBException, FaultMessage,
ObjectNotFoundException, SchemaException, EncryptionException, DirectoryException {
TestUtil.displayTestTile("test054AssignRoleJudge");
public void test104AssignRoleJudge() throws Exception {
final String TEST_NAME = "test104AssignRoleJudge";
TestUtil.displayTestTile(TEST_NAME);

// GIVEN

Expand Down Expand Up @@ -2449,9 +2450,9 @@ public void test054AssignRoleJudge() throws IOException, JAXBException, FaultMes


@Test
public void test057UnassignRolePirate() throws IOException, JAXBException, FaultMessage,
ObjectNotFoundException, SchemaException, EncryptionException, DirectoryException {
TestUtil.displayTestTile("test057UnassignRolePirate");
public void test107UnassignRolePirate() throws Exception {
final String TEST_NAME = "test107UnassignRolePirate";
TestUtil.displayTestTile(TEST_NAME);

// GIVEN

Expand Down Expand Up @@ -2532,9 +2533,9 @@ public void test057UnassignRolePirate() throws IOException, JAXBException, Fault
}

@Test
public void test058UnassignRoleCaptain() throws IOException, JAXBException, FaultMessage,
ObjectNotFoundException, SchemaException, EncryptionException, DirectoryException {
TestUtil.displayTestTile("test058UnassignRoleCaptain");
public void test108UnassignRoleCaptain() throws Exception {
final String TEST_NAME = "test108UnassignRoleCaptain";
TestUtil.displayTestTile(TEST_NAME);

// GIVEN

Expand Down Expand Up @@ -2620,9 +2621,9 @@ public void test058UnassignRoleCaptain() throws IOException, JAXBException, Faul
* Captain role was assigned twice. It has to also be unassigned twice.
*/
@Test
public void test059UnassignRoleCaptainAgain() throws IOException, JAXBException, FaultMessage,
ObjectNotFoundException, SchemaException, EncryptionException, DirectoryException {
TestUtil.displayTestTile("test059UnassignRoleCaptain");
public void test109UnassignRoleCaptainAgain() throws Exception {
final String TEST_NAME = "test109UnassignRoleCaptainAgain";
TestUtil.displayTestTile(TEST_NAME);

// GIVEN

Expand Down Expand Up @@ -2687,8 +2688,9 @@ public void test059UnassignRoleCaptainAgain() throws IOException, JAXBException,
* check if the cycle executes No changes are synchronized yet.
*/
@Test
public void test100LiveSyncInit() throws Exception {
TestUtil.displayTestTile("test100LiveSyncInit");
public void test300LiveSyncInit() throws Exception {
final String TEST_NAME = "test300LiveSyncInit";
TestUtil.displayTestTile(TEST_NAME);
// Now it is the right time to add task definition to the repository
// We don't want it there any sooner, as it may interfere with the
// previous tests
Expand All @@ -2701,7 +2703,7 @@ public void test100LiveSyncInit() throws Exception {
assertSyncSettingsAssignmentPolicyEnforcement(AssignmentPolicyEnforcementType.POSITIVE);

final OperationResult result = new OperationResult(TestSanity.class.getName()
+ ".test100Synchronization");
+ "." + TEST_NAME);

repoAddObjectFromFile(TASK_OPENDJ_SYNC_FILENAME, TaskType.class, result);

Expand Down Expand Up @@ -2790,13 +2792,14 @@ public void timeout() {
* should be created in repo.
*/
@Test
public void test101LiveSyncCreate() throws Exception {
TestUtil.displayTestTile("test101LiveSyncCreate");
public void test301LiveSyncCreate() throws Exception {
final String TEST_NAME = "test301LiveSyncCreate";
TestUtil.displayTestTile(TEST_NAME);
// Sync task should be running (tested in previous test), so just create
// new LDAP object.

final OperationResult result = new OperationResult(TestSanity.class.getName()
+ ".test101LiveSyncCreate");
+ "." + TEST_NAME);
final Task syncCycle = taskManager.getTask(TASK_OPENDJ_SYNC_OID, result);
AssertJUnit.assertNotNull(syncCycle);

Expand Down Expand Up @@ -2828,11 +2831,12 @@ public void test101LiveSyncCreate() throws Exception {
}

@Test
public void test102LiveSyncModify() throws Exception {
TestUtil.displayTestTile("test102LiveSyncModify");
public void test302LiveSyncModify() throws Exception {
final String TEST_NAME = "test302LiveSyncModify";
TestUtil.displayTestTile(TEST_NAME);

final OperationResult result = new OperationResult(TestSanity.class.getName()
+ ".test102LiveSyncModify");
+ "." + TEST_NAME);
final Task syncCycle = taskManager.getTask(TASK_OPENDJ_SYNC_OID, result);
AssertJUnit.assertNotNull(syncCycle);

Expand Down Expand Up @@ -2860,8 +2864,9 @@ public void test102LiveSyncModify() throws Exception {
}

@Test
public void test103LiveSyncLink() throws Exception {
TestUtil.displayTestTile("test103LiveSyncLink");
public void test303LiveSyncLink() throws Exception {
final String TEST_NAME = "test303LiveSyncLink";
TestUtil.displayTestTile(TEST_NAME);

// GIVEN
assertNoRepoCache();
Expand All @@ -2885,7 +2890,7 @@ public void test103LiveSyncLink() throws Exception {
//WHEN
//create account for e which should be correlated
final OperationResult result = new OperationResult(TestSanity.class.getName()
+ ".test103LiveSyncLink");
+ "." + TEST_NAME);
final Task syncCycle = taskManager.getTask(TASK_OPENDJ_SYNC_OID, result);
AssertJUnit.assertNotNull(syncCycle);

Expand Down Expand Up @@ -2921,13 +2926,14 @@ public void test103LiveSyncLink() throws Exception {
* Also location (ldap l) should be updated through outbound
*/
@Test
public void test104LiveSyncCreateNoLocation() throws Exception {
TestUtil.displayTestTile("test104LiveSyncCreateNoLocation");
public void test304LiveSyncCreateNoLocation() throws Exception {
final String TEST_NAME = "test304LiveSyncCreateNoLocation";
TestUtil.displayTestTile(TEST_NAME);
// Sync task should be running (tested in previous test), so just create
// new LDAP object.

final OperationResult result = new OperationResult(TestSanity.class.getName()
+ ".test104LiveSyncCreateNoLocation");
+ "." + TEST_NAME);
final Task syncCycle = taskManager.getTask(TASK_OPENDJ_SYNC_OID, result);
AssertJUnit.assertNotNull(syncCycle);

Expand Down Expand Up @@ -2994,19 +3000,20 @@ private Object findSyncTokenObject(Task syncCycle) {
* Not really a test. Just cleans up after live sync.
*/
@Test
public void test199LiveSyncCleanup() throws Exception {
TestUtil.displayTestTile("test199LiveSyncCleanup");
public void test399LiveSyncCleanup() throws Exception {
final String TEST_NAME = "test399LiveSyncCleanup";
TestUtil.displayTestTile(TEST_NAME);
final OperationResult result = new OperationResult(TestSanity.class.getName()
+ ".test199LiveSyncCleanup");
+ "." + TEST_NAME);

taskManager.deleteTask(TASK_OPENDJ_SYNC_OID, result);

// TODO: check if the task is really stopped
}

@Test
public void test200ImportFromResource() throws Exception {
final String TEST_NAME = "test200ImportFromResource";
public void test400ImportFromResource() throws Exception {
final String TEST_NAME = "test400ImportFromResource";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN
checkAllShadows();
Expand Down Expand Up @@ -3212,12 +3219,13 @@ private String getUserLocality(UserType user){
}

@Test
public void test300RecomputeUsers() throws Exception {
TestUtil.displayTestTile("test300RecomputeUsers");
public void test420RecomputeUsers() throws Exception {
final String TEST_NAME = "test420RecomputeUsers";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN

final OperationResult result = new OperationResult(TestSanity.class.getName()
+ ".test300RecomputeUsers");
+ "." + TEST_NAME);

// Assign role to a user, but we do this using a repository instead of model.
// The role assignment will not be executed and this created an inconsistent state.
Expand Down Expand Up @@ -3354,12 +3362,13 @@ public void timeout() {
}

@Test
public void test310ReconcileResourceOpenDj() throws Exception {
TestUtil.displayTestTile("test310ReconcileResourceOpenDj");
public void test440ReconcileResourceOpenDj() throws Exception {
final String TEST_NAME = "test440ReconcileResourceOpenDj";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN

final OperationResult result = new OperationResult(TestSanity.class.getName()
+ ".test310ReconcileResourceOpenDj");
+ "." + TEST_NAME);

// Create LDAP account without an owner. The liveSync is off, so it will not be picked up

Expand Down Expand Up @@ -3572,8 +3581,8 @@ public void timeout() {
}

@Test
public void test400ListResources() throws Exception {
final String TEST_NAME = "test400ListResources";
public void test480ListResources() throws Exception {
final String TEST_NAME = "test480ListResources";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN
OperationResultType result = new OperationResultType();
Expand All @@ -3599,8 +3608,8 @@ public void test400ListResources() throws Exception {
}

@Test
public void test410ListResourcesWithBrokenResource() throws Exception {
TestUtil.displayTestTile("test410ListResourcesWithBrokenResource");
public void test485ListResourcesWithBrokenResource() throws Exception {
TestUtil.displayTestTile("test485ListResourcesWithBrokenResource");

// GIVEN
Task task = taskManager.createTaskInstance(TestSanity.class.getName() + ".test410ListResourcesWithBrokenResource");
Expand Down

0 comments on commit fe03895

Please sign in to comment.