Skip to content

Commit

Permalink
last TEST_NAME variables removed from test classes
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Mar 10, 2020
1 parent 6d74fdf commit 6c7e7bf
Show file tree
Hide file tree
Showing 16 changed files with 393 additions and 686 deletions.
Expand Up @@ -45,14 +45,13 @@
import com.evolveum.midpoint.test.asserter.UserAsserter;
import com.evolveum.midpoint.test.util.MidPointTestConstants;
import com.evolveum.midpoint.test.util.TestUtil;
import com.evolveum.midpoint.tools.testng.UnusedTestElement;
import com.evolveum.midpoint.util.DOMUtil;
import com.evolveum.midpoint.util.MiscUtil;
import com.evolveum.midpoint.util.exception.*;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

/**
* @author Radovan Semancik
*/
@UnusedTestElement("disabled in suite in 2019-09, fails on setup")
@ContextConfiguration(locations = { "classpath:ctx-story-test-main.xml" })
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
public class TestVillage extends AbstractStoryTest {
Expand Down Expand Up @@ -205,7 +204,7 @@ protected void startResources() throws Exception {
}

@AfterClass
public static void stopResources() throws Exception {
public static void stopResources() {
openDJController.stop();
}

Expand Down Expand Up @@ -320,8 +319,7 @@ public void test020ResourceOpenDjGet() throws Exception {
*/
@Test
public void test022ResourceOpenDjRefinedSchema() throws Exception {
final String TEST_NAME = "test022ResourceOpenDjRefinedSchema";
Task task = taskManager.createTaskInstance(TestVillage.class.getName() + "." + TEST_NAME);
Task task = getTestTask();
OperationResult result = task.getResult();

PrismObject<ResourceType> resourceBefore = modelService.getObject(ResourceType.class, RESOURCE_OPENDJ_OID, null, task, result);
Expand Down Expand Up @@ -769,8 +767,7 @@ public void test300AddProjectJollyRoger() throws Exception {
*/
@Test
public void test310ProjectJollyRogerNestedGroup() throws Exception {
final String TEST_NAME = "test310ProjectJollyRogerNestedGroup";
Task task = taskManager.createTaskInstance(TestVillage.class.getName() + "." + TEST_NAME);
Task task = getTestTask();
OperationResult result = task.getResult();

openDJController.addEntry("dn: " + GROUP_JOLLYROGERS_DN + "\n" +
Expand Down Expand Up @@ -806,8 +803,7 @@ ShadowType.F_ATTRIBUTES, new QName(RESOURCE_OPENDJ_NAMESPACE, "cn")).eq("admins"

@Test
public void test319DeleteProjectJollyRoger() throws Exception {
final String TEST_NAME = "test319DeleteProjectJollyRoger";
Task task = taskManager.createTaskInstance(TestVillage.class.getName() + "." + TEST_NAME);
Task task = getTestTask();
OperationResult result = task.getResult();

// WHEN
Expand All @@ -830,8 +826,7 @@ public void test319DeleteProjectJollyRoger() throws Exception {
*/
@Test
public void test350AddRepoUserNoEmployeeNumberRecompute() throws Exception {
final String TEST_NAME = "test350AddRepoUserNoEmployeeNumberRecompute";
Task task = taskManager.createTaskInstance(TestVillage.class.getName() + "." + TEST_NAME);
Task task = getTestTask();
OperationResult result = task.getResult();

PrismObject<UserType> user = PrismTestUtil.parseObject(USER_MURRAY_FILE);
Expand Down
Expand Up @@ -6,7 +6,13 @@
*/
package com.evolveum.midpoint.testing.story;

import com.evolveum.icf.dummy.resource.DummyResource;
import java.io.File;

import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.Test;

import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
Expand All @@ -15,20 +21,13 @@
import com.evolveum.midpoint.test.util.TestUtil;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.Test;

import java.io.File;

/**
* Test with a resource that can only write. It cannot read the accounts. It has to cache the values.
*
* @author semancik
*
*/
@ContextConfiguration(locations = {"classpath:ctx-story-test-main.xml"})
@ContextConfiguration(locations = { "classpath:ctx-story-test-main.xml" })
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
public class TestWriter extends AbstractStoryTest {

Expand All @@ -41,26 +40,20 @@ public class TestWriter extends AbstractStoryTest {
private static final String USER_JACK_FULL_NAME_CAPTAIN = "Captain Jack Sparrow";
private static final String USER_JACK_LOCALITY = "Seven seas";

private DummyResourceContoller writerDummyController;
private DummyResource writerDummy;
private PrismObject<ResourceType> resourceWriter;

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
super.initSystem(initTask, initResult);

writerDummyController = DummyResourceContoller.create(RESOURCE_WRITER_DUMMY_NAME);
DummyResourceContoller writerDummyController = DummyResourceContoller.create(RESOURCE_WRITER_DUMMY_NAME);
writerDummyController.extendSchemaPirate();
writerDummy = writerDummyController.getDummyResource();
dummyResourceCollection.initDummyResource(RESOURCE_WRITER_DUMMY_NAME, writerDummyController);

resourceWriter = importAndGetObjectFromFile(ResourceType.class, RESOURCE_WRITER_FILE, RESOURCE_WRITER_OID, initTask, initResult);
PrismObject<ResourceType> resourceWriter = importAndGetObjectFromFile(ResourceType.class, RESOURCE_WRITER_FILE, RESOURCE_WRITER_OID, initTask, initResult);
writerDummyController.setResource(resourceWriter);
}

@Test
public void test000Sanity() throws Exception {
final String TEST_NAME = "test000Sanity";
Task task = getTestTask();

OperationResult testResultWriter = modelService.testResource(RESOURCE_WRITER_OID, task);
Expand All @@ -69,8 +62,6 @@ public void test000Sanity() throws Exception {

@Test
public void test100AssignJackDummyAccount() throws Exception {
final String TEST_NAME = "test100AssignJackDummyAccount";

Task task = getTestTask();
OperationResult result = task.getResult();

Expand All @@ -94,8 +85,6 @@ public void test100AssignJackDummyAccount() throws Exception {
*/
@Test
public void test110ModifyCaptainJack() throws Exception {
final String TEST_NAME = "test110ModifyCaptainJack";

Task task = getTestTask();
OperationResult result = task.getResult();

Expand Down

0 comments on commit 6c7e7bf

Please sign in to comment.