Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/load/Load300ComponentTest.java')
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/load/Load300ComponentTest.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/load/Load300ComponentTest.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/load/Load300ComponentTest.java
new file mode 100644
index 00000000000..5f53243544f
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/load/Load300ComponentTest.java
@@ -0,0 +1,54 @@
+/*****************************************************************************
+ * 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.component.test.load;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.papyrus.uml.diagram.component.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.component.test.canonical.AbstractPapyrusTestCase;
+import org.junit.Test;
+
+/**
+ * The Class Load300ComponentTest.
+ */
+public class Load300ComponentTest extends AbstractPapyrusTestCase {
+
+ /**
+ * Test to create a Component.
+ *
+ * @param type
+ * the type
+ */
+ public void testToCreateANode(IElementType type) {
+ CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(type, getDiagramEditPart().getDiagramPreferencesHint());
+ Command command = getDiagramEditPart().getCommand(requestcreation);
+ assertNotNull("CREATION: creation command null", command);
+ assertTrue("CREATION: test if the command is created", command != UnexecutableCommand.INSTANCE);
+ assertTrue("CREATION: test if the command can be executed", command.canExecute() == true);
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(command);
+
+ }
+
+ /**
+ * Test load300 Component.
+ */
+ @Test
+ public void testLoad300Component() {
+ for(int i = 0; i < 300; i++) {
+ testToCreateANode(UMLElementTypes.Component_2002);
+ }
+ }
+}

Back to the top