diff options
author | Christian W. Damus | 2014-03-07 19:47:50 +0000 |
---|---|---|
committer | Christian W. Damus | 2014-03-07 19:47:50 +0000 |
commit | 0e3b1dafcf4097397af1a2da6ae91de1a22de4f3 (patch) | |
tree | 4be621b8298fb813251d8ceedceda68469e5a6fa /tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests | |
parent | 88c526225da8a5742d19207f870ce037a39ff734 (diff) | |
download | org.eclipse.papyrus-0e3b1dafcf4097397af1a2da6ae91de1a22de4f3.tar.gz org.eclipse.papyrus-0e3b1dafcf4097397af1a2da6ae91de1a22de4f3.tar.xz org.eclipse.papyrus-0e3b1dafcf4097397af1a2da6ae91de1a22de4f3.zip |
429744: [UML 2.5] Migrate Papyrus to UML 2.5
https://bugs.eclipse.org/bugs/show_bug.cgi?id=429744
Fix JUnit tests broken by the fact that NamedElement::clientDependency is derived in UML 2.5.
Diffstat (limited to 'tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests')
2 files changed, 14 insertions, 13 deletions
diff --git a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/resources/writable.uml b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/resources/writable.uml index e7f94ac844b..3d7fc9e5296 100644 --- a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/resources/writable.uml +++ b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/resources/writable.uml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <uml:Model xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_h2dxAJo-EeOW4qDSrI_zog" name="writable"> - <packagedElement xmi:type="uml:Class" xmi:id="_lqVrQJo-EeOW4qDSrI_zog" clientDependency="_KFjrIJo_EeOW4qDSrI_zog" name="A"/> - <packagedElement xmi:type="uml:Class" xmi:id="_IX7rsJo_EeOW4qDSrI_zog" name="D"/> - <packagedElement xmi:type="uml:Dependency" xmi:id="_KFjrIJo_EeOW4qDSrI_zog" name="A-->D" client="_lqVrQJo-EeOW4qDSrI_zog" supplier="_IX7rsJo_EeOW4qDSrI_zog"/> + <packagedElement xmi:type="uml:Class" xmi:id="_lqVrQJo-EeOW4qDSrI_zog" clientDependency="_wxpSUKYwEeO-ZNuEJamMWA" name="A" useCase="_1HV8sKYvEeO-ZNuEJamMWA"/> + <packagedElement xmi:type="uml:Class" xmi:id="_uqtbAKYwEeO-ZNuEJamMWA" name="D"/> + <packagedElement xmi:type="uml:Dependency" xmi:id="_wxpSUKYwEeO-ZNuEJamMWA" name="A-->D" client="_lqVrQJo-EeOW4qDSrI_zog" supplier="_uqtbAKYwEeO-ZNuEJamMWA"/> + <packagedElement xmi:type="uml:UseCase" xmi:id="_1HV8sKYvEeO-ZNuEJamMWA" name="DoIt" subject="_lqVrQJo-EeOW4qDSrI_zog"/> </uml:Model> diff --git a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/tests/org/eclipse/papyrus/infra/emf/advice/ReadOnlyObjectEditAdviceTest.java b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/tests/org/eclipse/papyrus/infra/emf/advice/ReadOnlyObjectEditAdviceTest.java index f5e1a0e25aa..2d5d4270a7e 100644 --- a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/tests/org/eclipse/papyrus/infra/emf/advice/ReadOnlyObjectEditAdviceTest.java +++ b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/tests/org/eclipse/papyrus/infra/emf/advice/ReadOnlyObjectEditAdviceTest.java @@ -75,6 +75,7 @@ import org.eclipse.uml2.uml.Package; import org.eclipse.uml2.uml.Type; import org.eclipse.uml2.uml.UMLPackage; import org.eclipse.uml2.uml.Usage; +import org.eclipse.uml2.uml.UseCase; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -141,8 +142,8 @@ public class ReadOnlyObjectEditAdviceTest { */ @Test public void testSetCommand_referenceOppositeAdd() { - Dependency dep = classA.getClientDependency("A-->D"); //$NON-NLS-1$ - ICommand command = getEditCommand(dep, new SetRequest(dep, UMLPackage.Literals.DEPENDENCY__CLIENT, classB)); //$NON-NLS-1$ + UseCase doIt = classA.getUseCase("DoIt"); //$NON-NLS-1$ + ICommand command = getEditCommand(doIt, new SetRequest(doIt, UMLPackage.Literals.USE_CASE__SUBJECT, classB)); //$NON-NLS-1$ assertExecutability(command); } @@ -151,20 +152,19 @@ public class ReadOnlyObjectEditAdviceTest { */ @Test public void testSetCommand_referenceOppositeRemove() { - final Dependency dep = classA.getClientDependency("A-->D"); //$NON-NLS-1$ + final UseCase doIt = classA.getUseCase("DoIt"); //$NON-NLS-1$ // By-pass edit-helpers to set up the dependency executeUnprotected(new RecordingCommand(domain) { @Override protected void doExecute() { - dep.getClients().clear(); - dep.getClients().add(classB); // the read-only object + doIt.getSubjects().clear(); + doIt.getSubjects().add(classB); // the read-only object } }); - Type classD = writablePackage.getOwnedType("D"); //$NON-NLS-1$ - ICommand command = getEditCommand(dep, new SetRequest(dep, UMLPackage.Literals.DEPENDENCY__CLIENT, ImmutableList.of(classD))); //$NON-NLS-1$ + ICommand command = getEditCommand(doIt, new SetRequest(doIt, UMLPackage.Literals.USE_CASE__SUBJECT, ImmutableList.of(classA))); //$NON-NLS-1$ assertExecutability(command); } @@ -233,18 +233,18 @@ public class ReadOnlyObjectEditAdviceTest { @Test public void testDestroyReferenceCommand_referencedOpposite() { - final Dependency dep = classA.getClientDependency("A-->D"); //$NON-NLS-1$ + final UseCase doIt = classA.getUseCase("DoIt"); //$NON-NLS-1$ // By-pass edit-helpers to set up the relationship executeUnprotected(new RecordingCommand(domain) { @Override protected void doExecute() { - dep.getClients().add(classB); + doIt.getSubjects().add(classB); } }); - ICommand command = getEditCommand(writablePackage, new DestroyReferenceRequest(dep, UMLPackage.Literals.DEPENDENCY__CLIENT, classB, false)); //$NON-NLS-1$ + ICommand command = getEditCommand(doIt, new DestroyReferenceRequest(doIt, UMLPackage.Literals.USE_CASE__SUBJECT, classB, false)); //$NON-NLS-1$ assertExecutability(command); } |