Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrschnekenbu2013-07-04 05:43:46 -0400
committerrschnekenbu2013-07-04 05:43:46 -0400
commit10037a0551348ab2b6632243c761008d9d23a2b0 (patch)
treecab64729d7d10d73776340d166605da76ac2be6c /tests/junit/plugins
parent7f593da4a3056d5cfeac72832be7659f1694b1d4 (diff)
downloadorg.eclipse.papyrus-10037a0551348ab2b6632243c761008d9d23a2b0.tar.gz
org.eclipse.papyrus-10037a0551348ab2b6632243c761008d9d23a2b0.tar.xz
org.eclipse.papyrus-10037a0551348ab2b6632243c761008d9d23a2b0.zip
412226: [Refactoring Tests] The Use Case diagram tests should be refactored
https://bugs.eclipse.org/bugs/show_bug.cgi?id=412226
Diffstat (limited to 'tests/junit/plugins')
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/IUseCaseDiagramTestsConstants.java22
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseChildNodeForClassSubject.java12
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseChildNodeForPackage.java12
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseLink.java12
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseLinkOwnedBySource.java11
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseTopNode.java12
6 files changed, 77 insertions, 4 deletions
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/IUseCaseDiagramTestsConstants.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/IUseCaseDiagramTestsConstants.java
new file mode 100644
index 00000000000..3996d577485
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/IUseCaseDiagramTestsConstants.java
@@ -0,0 +1,22 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nizar GUEDIDI (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.usecase.tests;
+
+public interface IUseCaseDiagramTestsConstants {
+
+ /** name of the test project */
+ public final String PROJECT_NAME = "UseCaseDiagramTestProject";
+
+ /** name of the test model */
+ public final String FILE_NAME = "UseCaseDiagramTest.di";
+}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseChildNodeForClassSubject.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseChildNodeForClassSubject.java
index bbfff3dc127..b78f3056ecb 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseChildNodeForClassSubject.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseChildNodeForClassSubject.java
@@ -24,6 +24,7 @@ import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.diagram.tests.canonical.TestChildNode;
import org.eclipse.papyrus.uml.diagram.usecase.CreateUseCaseDiagramCommand;
import org.eclipse.papyrus.uml.diagram.usecase.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.usecase.tests.IUseCaseDiagramTestsConstants;
import org.eclipse.uml2.uml.UMLPackage;
import org.junit.Test;
@@ -32,7 +33,6 @@ import org.junit.Test;
* The Class TestUseCaseChildNodeForPackage.
*/
public class TestUseCaseChildNodeForClassSubject extends TestChildNode {
-
@Override
protected CreateViewRequest createViewRequestShapeContainer() {
@@ -46,6 +46,15 @@ public class TestUseCaseChildNodeForClassSubject extends TestChildNode {
return requestcreation;
}
+ @Override
+ protected String getProjectName() {
+ return IUseCaseDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IUseCaseDiagramTestsConstants.FILE_NAME;
+ }
@Test
public void testToManageUseCaseForClassSubject() {
@@ -64,5 +73,4 @@ public class TestUseCaseChildNodeForClassSubject extends TestChildNode {
protected ICreationCommand getDiagramCommandCreation() {
return new CreateUseCaseDiagramCommand();
}
-
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseChildNodeForPackage.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseChildNodeForPackage.java
index f56738ee039..9197eff9c98 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseChildNodeForPackage.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseChildNodeForPackage.java
@@ -19,6 +19,7 @@ import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.diagram.tests.canonical.TestChildNode;
import org.eclipse.papyrus.uml.diagram.usecase.CreateUseCaseDiagramCommand;
import org.eclipse.papyrus.uml.diagram.usecase.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.usecase.tests.IUseCaseDiagramTestsConstants;
import org.eclipse.uml2.uml.UMLPackage;
import org.junit.Test;
@@ -28,13 +29,22 @@ import org.junit.Test;
* The Class TestUseCaseChildNodeForPackage.
*/
public class TestUseCaseChildNodeForPackage extends TestChildNode {
-
@Override
protected CreateViewRequest createViewRequestShapeContainer() {
return CreateViewRequestFactory.getCreateShapeRequest(UMLElementTypes.Package_2016, getDiagramEditPart().getDiagramPreferencesHint());
}
+ @Override
+ protected String getProjectName() {
+ return IUseCaseDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IUseCaseDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to manage component.
*/
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseLink.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseLink.java
index 2f0b4cf42e1..29edae425d4 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseLink.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseLink.java
@@ -17,6 +17,7 @@ import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.diagram.tests.canonical.TestLink;
import org.eclipse.papyrus.uml.diagram.usecase.CreateUseCaseDiagramCommand;
import org.eclipse.papyrus.uml.diagram.usecase.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.usecase.tests.IUseCaseDiagramTestsConstants;
import org.junit.Test;
@@ -25,7 +26,6 @@ import org.junit.Test;
*/
public class TestUseCaseLink extends TestLink {
-
@Override
protected ICreationCommand getDiagramCommandCreation() {
return new CreateUseCaseDiagramCommand();
@@ -38,6 +38,16 @@ public class TestUseCaseLink extends TestLink {
testToManageLink(UMLElementTypes.UseCase_2013,UMLElementTypes.UseCase_2013,UMLElementTypes.Dependency_4013,UMLElementTypes.Package_2016,true);
}
+ @Override
+ protected String getProjectName() {
+ return IUseCaseDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IUseCaseDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to manage component.
*/
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseLinkOwnedBySource.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseLinkOwnedBySource.java
index 6e43f6f94ea..850b7e7eb6d 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseLinkOwnedBySource.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseLinkOwnedBySource.java
@@ -17,6 +17,7 @@ import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.diagram.tests.canonical.TestLinkOwnedBySource;
import org.eclipse.papyrus.uml.diagram.usecase.CreateUseCaseDiagramCommand;
import org.eclipse.papyrus.uml.diagram.usecase.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.usecase.tests.IUseCaseDiagramTestsConstants;
import org.junit.Test;
@@ -30,6 +31,16 @@ public class TestUseCaseLinkOwnedBySource extends TestLinkOwnedBySource {
return new CreateUseCaseDiagramCommand();
}
+ @Override
+ protected String getProjectName() {
+ return IUseCaseDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IUseCaseDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to manage Association.
*/
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseTopNode.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseTopNode.java
index 4ee0ad6a999..8c4e1df2056 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseTopNode.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/canonical/TestUseCaseTopNode.java
@@ -16,6 +16,7 @@ package org.eclipse.papyrus.uml.diagram.usecase.tests.canonical;
import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.uml.diagram.usecase.CreateUseCaseDiagramCommand;
import org.eclipse.papyrus.uml.diagram.usecase.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.usecase.tests.IUseCaseDiagramTestsConstants;
import org.junit.Test;
@@ -24,11 +25,22 @@ import org.junit.Test;
* The Class TestUseCaseTopNode.
*/
public class TestUseCaseTopNode extends TestSpecificTopNode {
+
@Override
protected ICreationCommand getDiagramCommandCreation() {
return new CreateUseCaseDiagramCommand();
}
+ @Override
+ protected String getProjectName() {
+ return IUseCaseDiagramTestsConstants.PROJECT_NAME;
+ }
+
+ @Override
+ protected String getFileName() {
+ return IUseCaseDiagramTestsConstants.FILE_NAME;
+ }
+
/**
* Test to manage component.
*/

Back to the top