Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-10-16 16:54:02 +0000
committerGerrit Code Review @ Eclipse.org2014-10-16 16:54:02 +0000
commitd55dd64cdf5dc5a3261c8bcb4f93e4ddc4ad876b (patch)
tree7643c03ecb92056d6e5121558fbae484644ed0ed /tests/junit
parent8084b03fbf8292516b56a2cf828c3a607af7a2f1 (diff)
parent675a4817c31596849911adb46edff2eb4612fa9a (diff)
downloadorg.eclipse.papyrus-d55dd64cdf5dc5a3261c8bcb4f93e4ddc4ad876b.tar.gz
org.eclipse.papyrus-d55dd64cdf5dc5a3261c8bcb4f93e4ddc4ad876b.tar.xz
org.eclipse.papyrus-d55dd64cdf5dc5a3261c8bcb4f93e4ddc4ad876b.zip
Merge "436952: [Submodel] Deletion of a model fragment does not delete the model fragment resources https://bugs.eclipse.org/bugs/show_bug.cgi?id=436952"
Diffstat (limited to 'tests/junit')
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelTest.java208
-rw-r--r--tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelWithProfileTest.java212
2 files changed, 210 insertions, 210 deletions
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelTest.java b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelTest.java
index ce839faf6ef..94664ed5b58 100644
--- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelTest.java
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelTest.java
@@ -1,104 +1,104 @@
-/*******************************************************************************
- * Copyright (c) 2014 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:
- * Juan Cadavid <juan.cadavid@cea.fr> implementation
- ******************************************************************************/
-package org.eclipse.papyrus.infra.services.controlmode.tests.control;
-
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.eclipse.core.commands.IParameter;
-import org.eclipse.core.commands.ParameterValuesException;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.papyrus.infra.services.controlmode.commands.ControlModeCommandParameterValues;
-import org.eclipse.papyrus.infra.services.controlmode.handlers.ControlCommandHandler;
-import org.eclipse.papyrus.infra.services.controlmode.tests.Messages;
-import org.eclipse.papyrus.junit.utils.HandlerUtils;
-import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
-import org.eclipse.papyrus.junit.utils.ProjectUtils;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
-import org.eclipse.uml2.uml.PackageableElement;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-
-public class ControlModelTest extends AbstractControlModeTest {
-
- private static final String PROJECT_NAME = "ControlModeTestProject"; //$NON-NLS-1$
-
- private static final String SOURCE_PATH = "/model/ControlModelTest/"; //$NON-NLS-1$
-
- private static final String FILE_ROOT_NAME = "ControlModeTestModel"; //$NON-NLS-1$
-
- protected void initTests(final Bundle bundle) throws CoreException, IOException {
- bot = new SWTWorkbenchBot();
- ProjectUtils.removeAllProjectFromTheWorkspace();
- IProject testProject = ProjectUtils.createProject(PROJECT_NAME);
- modelFile = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, FILE_ROOT_NAME);
- AbstractControlModeTest.bundle = bundle;
- }
-
- @Ignore @Test
- public void controlModelTest() {
- RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
-
- @Override
- public void run() {
- List<PackageableElement> elements = selectElementToControl();
- Assert.assertTrue(Messages.ControlModelTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
- // Click "ok" with SWTBot
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- fail(e.getLocalizedMessage());
- }
-
-
- bot.button("OK").click(); //$NON-NLS-1$
-
- }
- });
- controlAndSave(editor, model, elements, HandlerUtils.getCommand(COMMAND_ID));
- }
-
- };
- Display.getDefault().syncExec(runnableWithResult);
- }
-
- @Test
- public void controlModelTestWithoutDialog() throws NotDefinedException, ParameterValuesException {
- IParameter dialogParameter = HandlerUtils.getCommand(this.COMMAND_ID).getParameter(ControlCommandHandler.CONTROLMODE_USE_DIALOG_PARAMETER);
- ControlModeCommandParameterValues controlModePlatformValues = (ControlModeCommandParameterValues)dialogParameter.getValues();
- controlModePlatformValues.put("showDialog", false);
- RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
-
- @Override
- public void run() {
- List<PackageableElement> elements = selectElementToControl();
- Assert.assertTrue(Messages.ControlModelTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
-
- controlAndSave(editor, model, elements, HandlerUtils.getCommand(COMMAND_ID));
- }
-
- };
- Display.getDefault().syncExec(runnableWithResult);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2014 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:
+ * Juan Cadavid <juan.cadavid@cea.fr> implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.infra.services.controlmode.tests.control;
+
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.ParameterValuesException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.papyrus.infra.services.controlmode.commands.ControlModeCommandParameterValues;
+import org.eclipse.papyrus.infra.services.controlmode.tests.Messages;
+import org.eclipse.papyrus.junit.utils.HandlerUtils;
+import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
+import org.eclipse.papyrus.junit.utils.ProjectUtils;
+import org.eclipse.papyrus.views.modelexplorer.handler.ControlCommandHandler;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.uml2.uml.PackageableElement;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+public class ControlModelTest extends AbstractControlModeTest {
+
+ private static final String PROJECT_NAME = "ControlModeTestProject"; //$NON-NLS-1$
+
+ private static final String SOURCE_PATH = "/model/ControlModelTest/"; //$NON-NLS-1$
+
+ private static final String FILE_ROOT_NAME = "ControlModeTestModel"; //$NON-NLS-1$
+
+ protected void initTests(final Bundle bundle) throws CoreException, IOException {
+ bot = new SWTWorkbenchBot();
+ ProjectUtils.removeAllProjectFromTheWorkspace();
+ IProject testProject = ProjectUtils.createProject(PROJECT_NAME);
+ modelFile = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, FILE_ROOT_NAME);
+ AbstractControlModeTest.bundle = bundle;
+ }
+
+ @Ignore @Test
+ public void controlModelTest() {
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+ List<PackageableElement> elements = selectElementToControl();
+ Assert.assertTrue(Messages.ControlModelTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
+ // Click "ok" with SWTBot
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ fail(e.getLocalizedMessage());
+ }
+
+
+ bot.button("OK").click(); //$NON-NLS-1$
+
+ }
+ });
+ controlAndSave(editor, model, elements, HandlerUtils.getCommand(COMMAND_ID));
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ }
+
+ @Test
+ public void controlModelTestWithoutDialog() throws NotDefinedException, ParameterValuesException {
+ IParameter dialogParameter = HandlerUtils.getCommand(this.COMMAND_ID).getParameter(ControlCommandHandler.CONTROLMODE_USE_DIALOG_PARAMETER);
+ ControlModeCommandParameterValues controlModePlatformValues = (ControlModeCommandParameterValues)dialogParameter.getValues();
+ controlModePlatformValues.put("showDialog", false);
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+ List<PackageableElement> elements = selectElementToControl();
+ Assert.assertTrue(Messages.ControlModelTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
+
+ controlAndSave(editor, model, elements, HandlerUtils.getCommand(COMMAND_ID));
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ }
+
+}
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelWithProfileTest.java b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelWithProfileTest.java
index 4dd1ebceb34..a344ee0f611 100644
--- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelWithProfileTest.java
+++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/src/org/eclipse/papyrus/infra/services/controlmode/tests/control/ControlModelWithProfileTest.java
@@ -1,106 +1,106 @@
-/*******************************************************************************
- * Copyright (c) 2014 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:
- * Juan Cadavid <juan.cadavid@cea.fr> implementation
- ******************************************************************************/
-package org.eclipse.papyrus.infra.services.controlmode.tests.control;
-
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.eclipse.core.commands.IParameter;
-import org.eclipse.core.commands.ParameterValuesException;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.papyrus.infra.services.controlmode.commands.ControlModeCommandParameterValues;
-import org.eclipse.papyrus.infra.services.controlmode.handlers.ControlCommandHandler;
-import org.eclipse.papyrus.infra.services.controlmode.tests.Messages;
-import org.eclipse.papyrus.junit.utils.HandlerUtils;
-import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
-import org.eclipse.papyrus.junit.utils.ProjectUtils;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
-import org.eclipse.uml2.uml.PackageableElement;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-
-public class ControlModelWithProfileTest extends AbstractControlModeTest {
-
- static final String PROJECT_NAME = "ControlModeWithProfileTestProject"; //$NON-NLS-1$
-
- static final String SOURCE_PATH = "/model/ControlModeWithProfileTest/"; //$NON-NLS-1$
-
- static final String MODEL_FILE_NAME = "ControlModeWithProfileTestModel"; //$NON-NLS-1$
-
- static final String PROFILE_FILE_NAME = "testProfile.profile"; //$NON-NLS-1$
-
- @Override
- protected void initTests(final Bundle bundle) throws CoreException, IOException {
- bot = new SWTWorkbenchBot();
- ProjectUtils.removeAllProjectFromTheWorkspace();
- IProject testProject = ProjectUtils.createProject(PROJECT_NAME);
- modelFile = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, MODEL_FILE_NAME);
- PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, PROFILE_FILE_NAME);
- AbstractControlModeTest.bundle = bundle;
- }
-
- @Ignore @Test
- public void controlModelWithProfileTest() {
- RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
-
- @Override
- public void run() {
- List<PackageableElement> elements = selectElementToControl();
- Assert.assertTrue(Messages.ControlModelWithProfileTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
- // Click "ok" with SWTBot
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- fail(e.getLocalizedMessage());
- }
- bot.button("OK").click(); //$NON-NLS-1$
-
- }
- });
- controlAndSave(editor, model, elements, HandlerUtils.getCommand(COMMAND_ID));
- }
-
- };
- Display.getDefault().syncExec(runnableWithResult);
- }
-
- @Test
- public void controlModelTestWithProfileTestWithoutDialog() throws NotDefinedException, ParameterValuesException {
- IParameter dialogParameter = HandlerUtils.getCommand(this.COMMAND_ID).getParameter(ControlCommandHandler.CONTROLMODE_USE_DIALOG_PARAMETER);
- ControlModeCommandParameterValues controlModePlatformValues = (ControlModeCommandParameterValues)dialogParameter.getValues();
- controlModePlatformValues.put("showDialog", false);
- RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
-
- @Override
- public void run() {
- List<PackageableElement> elements = selectElementToControl();
- Assert.assertTrue(Messages.ControlModelTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
-
- controlAndSave(editor, model, elements, HandlerUtils.getCommand(COMMAND_ID));
- }
-
- };
- Display.getDefault().syncExec(runnableWithResult);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2014 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:
+ * Juan Cadavid <juan.cadavid@cea.fr> implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.infra.services.controlmode.tests.control;
+
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.ParameterValuesException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.papyrus.infra.services.controlmode.commands.ControlModeCommandParameterValues;
+import org.eclipse.papyrus.infra.services.controlmode.tests.Messages;
+import org.eclipse.papyrus.junit.utils.HandlerUtils;
+import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
+import org.eclipse.papyrus.junit.utils.ProjectUtils;
+import org.eclipse.papyrus.views.modelexplorer.handler.ControlCommandHandler;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.uml2.uml.PackageableElement;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+public class ControlModelWithProfileTest extends AbstractControlModeTest {
+
+ static final String PROJECT_NAME = "ControlModeWithProfileTestProject"; //$NON-NLS-1$
+
+ static final String SOURCE_PATH = "/model/ControlModeWithProfileTest/"; //$NON-NLS-1$
+
+ static final String MODEL_FILE_NAME = "ControlModeWithProfileTestModel"; //$NON-NLS-1$
+
+ static final String PROFILE_FILE_NAME = "testProfile.profile"; //$NON-NLS-1$
+
+ @Override
+ protected void initTests(final Bundle bundle) throws CoreException, IOException {
+ bot = new SWTWorkbenchBot();
+ ProjectUtils.removeAllProjectFromTheWorkspace();
+ IProject testProject = ProjectUtils.createProject(PROJECT_NAME);
+ modelFile = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, MODEL_FILE_NAME);
+ PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, PROFILE_FILE_NAME);
+ AbstractControlModeTest.bundle = bundle;
+ }
+
+ @Ignore @Test
+ public void controlModelWithProfileTest() {
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+ List<PackageableElement> elements = selectElementToControl();
+ Assert.assertTrue(Messages.ControlModelWithProfileTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
+ // Click "ok" with SWTBot
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ fail(e.getLocalizedMessage());
+ }
+ bot.button("OK").click(); //$NON-NLS-1$
+
+ }
+ });
+ controlAndSave(editor, model, elements, HandlerUtils.getCommand(COMMAND_ID));
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ }
+
+ @Test
+ public void controlModelTestWithProfileTestWithoutDialog() throws NotDefinedException, ParameterValuesException {
+ IParameter dialogParameter = HandlerUtils.getCommand(this.COMMAND_ID).getParameter(ControlCommandHandler.CONTROLMODE_USE_DIALOG_PARAMETER);
+ ControlModeCommandParameterValues controlModePlatformValues = (ControlModeCommandParameterValues)dialogParameter.getValues();
+ controlModePlatformValues.put("showDialog", false);
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+ List<PackageableElement> elements = selectElementToControl();
+ Assert.assertTrue(Messages.ControlModelTest_4, HandlerUtils.getActiveHandlerFor(COMMAND_ID).isEnabled());
+
+ controlAndSave(editor, model, elements, HandlerUtils.getCommand(COMMAND_ID));
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ }
+
+}

Back to the top