aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorghillairet2012-05-21 08:50:21 (EDT)
committermgolubev2012-05-21 08:50:21 (EDT)
commita1a6d493daeec629abc654fb2a65222b886927b3 (patch)
treed42256177981dd014b64d78b2b93d2ecdea81a01
parent84d530854f38c5569731a9711dd066e9b6351f94 (diff)
downloadorg.eclipse.gmf-tooling-a1a6d493daeec629abc654fb2a65222b886927b3.zip
org.eclipse.gmf-tooling-a1a6d493daeec629abc654fb2a65222b886927b3.tar.gz
org.eclipse.gmf-tooling-a1a6d493daeec629abc654fb2a65222b886927b3.tar.bz2
Updated tests for qvto bridge
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/AllTests.java2
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtGenModelTransformerTest.java6
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtGenModelTransformerVisualIDWithTraceTest.java349
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformModeledViewmapTest.java64
4 files changed, 281 insertions, 140 deletions
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/AllTests.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/AllTests.java
index 7f95496..4e2f6b1 100644
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/AllTests.java
+++ b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/AllTests.java
@@ -157,6 +157,8 @@ public class AllTests {
suite.addTestSuite(QvtGenModelTransformerBasicRTTest.class);
suite.addTestSuite(QvtLabelMappingTransformTest.class);
suite.addTestSuite(QvtPaletteTransformationTest.class);
+ suite.addTestSuite(QvtGenModelTransformerVisualIDWithTraceTest.class);
+ suite.addTestSuite(QvtTransformModeledViewmapTest.class);
suite.addTestSuite(CompareTransformationEngineTest.class);
suite.addTestSuite(EcoreGenModelMatcherTest.class);
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtGenModelTransformerTest.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtGenModelTransformerTest.java
index 1a4231c..56fc245 100644
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtGenModelTransformerTest.java
+++ b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtGenModelTransformerTest.java
@@ -134,7 +134,9 @@ public abstract class QvtGenModelTransformerTest extends AbstractMappingTransfor
for (TraceRecord record: trace.getTraceRecords()) {
if (record.getContext().getContext().getType().equals(GMFMapPackage.eINSTANCE.getLinkMapping().getName())) {
if (record.getContext().getContext().getValue().getModelElement().equals(linkMapping)) {
- return (GenLink) record.getResult().getResult().get(0).getValue().getModelElement();
+ EObject modelElement = record.getResult().getResult().get(0).getValue().getModelElement();
+ if (modelElement instanceof GenLink)
+ return (GenLink) modelElement ;
}
}
}
@@ -163,11 +165,13 @@ public abstract class QvtGenModelTransformerTest extends AbstractMappingTransfor
final NodeMapping nodeMapping = topNode.getChild();
GenTopLevelNode genNode = findTopNode(nodeMapping);
assertNotNull(genNode);
+ System.out.println(nodeMapping.getTool().eContainer());
assertEquals(nodeMapping.getTool() != null ? 1 : 0, countUses(genNode, palette));
}
for (LinkMapping linkMapping : getMapping().getLinks()) {
GenLink genLink = find(linkMapping);
assertNotNull(genLink);
+ System.out.println(linkMapping.getTool().eContainer());
assertEquals(linkMapping.getTool() != null ? 1 : 0, countUses(genLink, palette));
}
// TODO add grooping test
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtGenModelTransformerVisualIDWithTraceTest.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtGenModelTransformerVisualIDWithTraceTest.java
index f1d56c9..fbf7eec 100644
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtGenModelTransformerVisualIDWithTraceTest.java
+++ b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtGenModelTransformerVisualIDWithTraceTest.java
@@ -1,161 +1,238 @@
/*******************************************************************************
-* Copyright (c) 2011, 2012 Montages A.G.
-* 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:
-* Guillaume Hillairet (Montages A.G.) : initial implementation
-*******************************************************************************/
+ * Copyright (c) 2011, 2012 Montages A.G.
+ * 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:
+ * Guillaume Hillairet (Montages A.G.) : initial implementation
+ *******************************************************************************/
package org.eclipse.gmf.tests.tr;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
import org.eclipse.gmf.codegen.gmfgen.GenTopLevelNode;
+import org.eclipse.gmf.gmfgraph.Canvas;
+import org.eclipse.gmf.internal.bridge.StatefulVisualIdentifierDispencer;
import org.eclipse.gmf.mappings.CanvasMapping;
import org.eclipse.gmf.mappings.GMFMapFactory;
import org.eclipse.gmf.mappings.Mapping;
import org.eclipse.gmf.mappings.NodeMapping;
import org.eclipse.gmf.mappings.TopNodeReference;
import org.eclipse.gmf.tests.ConfiguredTestCase;
+import org.eclipse.gmf.tests.tr.TransformationTestSupport.Transformation;
public class QvtGenModelTransformerVisualIDWithTraceTest extends ConfiguredTestCase {
-
+ protected static String testFolder = "platform:/plugin/org.eclipse.gmf.tests/models/tests"; //$NON-NLS-1$
+
public QvtGenModelTransformerVisualIDWithTraceTest(String name) {
super(name);
}
+
+ private Mapping mapping;
+ private GenModel genModel;
+ private Canvas canvas;
+ private ResourceSet resoureSet;
+ private IProject myProject;
+ private URI projectURI;
-// @Override
-// protected Mapping loadMapping() {
-// Mapping mapping = GMFMapFactory.eINSTANCE.createMapping();
-// CanvasMapping cmap = GMFMapFactory.eINSTANCE.createCanvasMapping();
-// cmap.setDiagramCanvas(getCanvas());
-// mapping.setDiagram(cmap);
-//
-// EPackage ePackage = getGenModel().getGenPackages().get(0).getEcorePackage();
-// EClass container = (EClass) ePackage.getEClassifier("UltimateContainer");
-// EReference containment = (EReference) container.getEStructuralFeature("all");
-// EClass srcA = (EClass) ePackage.getEClassifier("NodeSrcA");
-// cmap.setDomainMetaElement(container);
-// cmap.setDomainModel(ePackage);
-//
-// TopNodeReference top1 = GMFMapFactory.eINSTANCE.createTopNodeReference();
-// top1.setContainmentFeature(containment);
-//
-// NodeMapping nmap = GMFMapFactory.eINSTANCE.createNodeMapping();
-// nmap.setDomainMetaElement(srcA);
-// nmap.setDiagramNode(getCanvas().getNodes().get(0));
-// top1.setOwnedChild(nmap);
-//
-// mapping.getNodes().add(top1);
-//
-// return mapping;
-// }
-
-// protected TopNodeReference createTopNode(String name) {
-// TopNodeReference existing = getMapping().getNodes().get(0);
-// EPackage ePackage = existing.getOwnedChild().getDomainMetaElement().getEPackage();
-// EClass eClass = (EClass) ePackage.getEClassifier(name);
-//
-// TopNodeReference node = GMFMapFactory.eINSTANCE.createTopNodeReference();
-// node.setContainmentFeature(existing.getContainmentFeature());
-//
-// NodeMapping nmap = GMFMapFactory.eINSTANCE.createNodeMapping();
-// nmap.setDomainMetaElement(eClass);
-// nmap.setDiagramNode(existing.getChild().getDiagramNode());
-// node.setOwnedChild(nmap);
-//
-// return node;
-// }
-//
-// public void testVisualIDWithNoTrace() {
-// Transformation java = getJavaTransformation(false);
-// Transformation qvt = getQvtTransformation(false);
-//
-// GenEditorGenerator expected = java.execute();
-// GenEditorGenerator actual = qvt.execute();
-//
-// EList<GenTopLevelNode> expNodes = expected.getDiagram().getTopLevelNodes();
-// EList<GenTopLevelNode> actNodes = actual.getDiagram().getTopLevelNodes();
-//
-// assertEquals(1, expNodes.size());
-// assertEquals(expNodes.size(), actNodes.size());
-//
-// assertEquals(2001, expNodes.get(0).getVisualID());
-//
-// for (int i=0;i<expNodes.size();i++){
-// GenTopLevelNode expNode = expNodes.get(i);
-// GenTopLevelNode actNode = actNodes.get(i);
-//
-// assertEquals(expNode.getVisualID(), actNode.getVisualID());
-// }
-//
-// java.saveGenEditor("java");
-// java.getDispencer().saveState();
-//
-// qvt.getDispencer().saveState();
-// qvt.saveGenEditor("qvt");
-//
-// TopNodeReference node = createTopNode("NodeTargetB");
-// getMapping().getNodes().add(node);
-//
-// expected = java.execute();
-// actual = qvt.execute();
-//
-// expNodes = expected.getDiagram().getTopLevelNodes();
-// actNodes = actual.getDiagram().getTopLevelNodes();
-//
-// assertEquals(2, expNodes.size());
-// assertEquals(expNodes.size(), actNodes.size());
-//
+ public void setUp() throws Exception {
+ super.setUp();
+
+ myProject = createProject();
+ projectURI = URI.createURI(myProject.getFullPath().toString());
+
+ resoureSet = new ResourceSetImpl();
+ Resource genModelResource = resoureSet.createResource(URI.createURI(testFolder).appendSegment("test.genmodel"));
+ genModelResource.load(null);
+ genModel = (GenModel) genModelResource.getContents().get(0);
+
+ Resource graphModelResource = resoureSet.createResource(URI.createURI(testFolder).appendSegment("test.gmfgraph"));
+ graphModelResource.load(null);
+ canvas = (Canvas) graphModelResource.getContents().get(0);
+
+ mapping = loadMapping();
+ }
+
+ public void tearDown() throws Exception {
+ deleteProject();
+ myProject = null;
+ super.tearDown();
+ }
+
+ protected Mapping loadMapping() {
+ Mapping mapping = GMFMapFactory.eINSTANCE.createMapping();
+ CanvasMapping cmap = GMFMapFactory.eINSTANCE.createCanvasMapping();
+ cmap.setDiagramCanvas(getCanvas());
+ mapping.setDiagram(cmap);
+
+ EPackage ePackage = getGenModel().getGenPackages().get(0).getEcorePackage();
+ EClass container = (EClass) ePackage.getEClassifier("UltimateContainer");
+ EReference containment = (EReference) container.getEStructuralFeature("all");
+ EClass srcA = (EClass) ePackage.getEClassifier("NodeSrcA");
+ cmap.setDomainMetaElement(container);
+ cmap.setDomainModel(ePackage);
+
+ TopNodeReference top1 = GMFMapFactory.eINSTANCE.createTopNodeReference();
+ top1.setContainmentFeature(containment);
+
+ NodeMapping nmap = GMFMapFactory.eINSTANCE.createNodeMapping();
+ nmap.setDomainMetaElement(srcA);
+ nmap.setDiagramNode(getCanvas().getNodes().get(0));
+ top1.setOwnedChild(nmap);
+
+ mapping.getNodes().add(top1);
+
+ return mapping;
+ }
+
+ private GenModel getGenModel() {
+ return genModel;
+ }
+
+ private Canvas getCanvas() {
+ return canvas;
+ }
+
+ private Mapping getMapping() {
+ return mapping;
+ }
+
+ protected TopNodeReference createTopNode(String name) {
+ TopNodeReference existing = getMapping().getNodes().get(0);
+ EPackage ePackage = existing.getOwnedChild().getDomainMetaElement().getEPackage();
+ EClass eClass = (EClass) ePackage.getEClassifier(name);
+
+ TopNodeReference node = GMFMapFactory.eINSTANCE.createTopNodeReference();
+ node.setContainmentFeature(existing.getContainmentFeature());
+
+ NodeMapping nmap = GMFMapFactory.eINSTANCE.createNodeMapping();
+ nmap.setDomainMetaElement(eClass);
+ nmap.setDiagramNode(existing.getChild().getDiagramNode());
+ node.setOwnedChild(nmap);
+
+ return node;
+ }
+
+ public void testVisualIDWithNoTrace() {
+ Transformation java = TransformationTestSupport.getJavaTransformation(getGenModel(), getMapping(), false);
+ Transformation qvt = TransformationTestSupport.getQvtTransformation(getGenModel(), getMapping(), false);
+
+ GenEditorGenerator expected = java.execute(projectURI.appendSegment("model.java.gmfgen"));
+ GenEditorGenerator actual = qvt.execute(projectURI.appendSegment("model.java.gmfgen"));
+
+ EList<GenTopLevelNode> expNodes = expected.getDiagram().getTopLevelNodes();
+ EList<GenTopLevelNode> actNodes = actual.getDiagram().getTopLevelNodes();
+
+ assertEquals(1, expNodes.size());
+ assertEquals(expNodes.size(), actNodes.size());
+
// assertEquals(2001, expNodes.get(0).getVisualID());
-// assertEquals(2002, expNodes.get(1).getVisualID());
-//
-// for (int i=0;i<expNodes.size();i++){
-// GenTopLevelNode expNode = expNodes.get(i);
-// GenTopLevelNode actNode = actNodes.get(i);
-//
-// assertEquals(expNode.getVisualID(), actNode.getVisualID());
-// }
-//
-// node = createTopNode("NodeTargetC");
-// getMapping().getNodes().add(0, node);
-//
-// java.saveGenEditor("java");
-// java.getDispencer().saveState();
-//
-// qvt.saveGenEditor("qvt");
-// qvt.getDispencer().saveState();
-//
-// expected = java.execute();
-// actual = qvt.execute();
-//
-// expNodes = expected.getDiagram().getTopLevelNodes();
-// actNodes = actual.getDiagram().getTopLevelNodes();
-//
-// assertEquals(3, expNodes.size());
-// assertEquals(expNodes.size(), actNodes.size());
-//
-// assertEquals(2003, expNodes.get(0).getVisualID());
-// assertEquals(2001, expNodes.get(1).getVisualID());
-// assertEquals(2002, expNodes.get(2).getVisualID());
-//
-// for (int i=0;i<expNodes.size();i++){
-// GenTopLevelNode expNode = expNodes.get(i);
-// GenTopLevelNode actNode = actNodes.get(i);
-//
+
+ for (int i=0;i<expNodes.size();i++){
+ GenTopLevelNode expNode = expNodes.get(i);
+ GenTopLevelNode actNode = actNodes.get(i);
+
// assertEquals(expNode.getVisualID(), actNode.getVisualID());
-// }
-//
-// java.saveGenEditor("java");
-// java.getDispencer().saveState();
-//
-// qvt.saveGenEditor("qvt");
-// qvt.getDispencer().saveState();
-// }
+ }
+
+ System.out.println(java.getDispencer());
+ System.out.println(qvt.getDispencer());
+
+ ((StatefulVisualIdentifierDispencer) java.getDispencer()).saveState();
+ ((StatefulVisualIdentifierDispencer) qvt.getDispencer()).saveState();
+
+ TopNodeReference node = createTopNode("NodeTargetB");
+ getMapping().getNodes().add(node);
+
+ expected = java.execute(projectURI.appendSegment("model.java.gmfgen"));
+ actual = qvt.execute(projectURI.appendSegment("model.java.gmfgen"));
+
+ expNodes = expected.getDiagram().getTopLevelNodes();
+ actNodes = actual.getDiagram().getTopLevelNodes();
+
+ assertEquals(2, expNodes.size());
+ assertEquals(expNodes.size(), actNodes.size());
+
+ assertEquals(2001, expNodes.get(0).getVisualID());
+ assertEquals(2002, expNodes.get(1).getVisualID());
+
+ for (int i=0;i<expNodes.size();i++){
+ GenTopLevelNode expNode = expNodes.get(i);
+ GenTopLevelNode actNode = actNodes.get(i);
+
+ assertEquals(expNode.getVisualID(), actNode.getVisualID());
+ }
+
+ node = createTopNode("NodeTargetC");
+ getMapping().getNodes().add(0, node);
+
+ ((StatefulVisualIdentifierDispencer) java.getDispencer()).saveState();
+ ((StatefulVisualIdentifierDispencer) qvt.getDispencer()).saveState();
+
+ expected = java.execute(projectURI.appendSegment("model.java.gmfgen"));
+ actual = qvt.execute(projectURI.appendSegment("model.java.gmfgen"));
+
+ expNodes = expected.getDiagram().getTopLevelNodes();
+ actNodes = actual.getDiagram().getTopLevelNodes();
+
+ assertEquals(3, expNodes.size());
+ assertEquals(expNodes.size(), actNodes.size());
+
+ assertEquals(2003, expNodes.get(0).getVisualID());
+ assertEquals(2001, expNodes.get(1).getVisualID());
+ assertEquals(2002, expNodes.get(2).getVisualID());
+
+ for (int i=0;i<expNodes.size();i++){
+ GenTopLevelNode expNode = expNodes.get(i);
+ GenTopLevelNode actNode = actNodes.get(i);
+
+ assertEquals(expNode.getVisualID(), actNode.getVisualID());
+ }
+
+ ((StatefulVisualIdentifierDispencer) java.getDispencer()).saveState();
+ ((StatefulVisualIdentifierDispencer) qvt.getDispencer()).saveState();
+ }
+
+ protected IProject createProject() {
+ String projectName = "TransformToGenModelOperationTest_" + String.valueOf(System.currentTimeMillis()); //$NON-NLS-1$
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ assertFalse("Project with this name already present in the workspace: " + projectName, project.exists());
+ try {
+ project.create(new NullProgressMonitor());
+ project.open(new NullProgressMonitor());
+ } catch (CoreException e) {
+ fail(e.getMessage());
+ }
+ assertTrue("Project was not created: " + projectName, project.exists());
+ return project;
+ }
+ protected void deleteProject() throws CoreException {
+ if (getProject() != null) {
+ if (getProject().isOpen()) {
+ getProject().close(new NullProgressMonitor());
+ }
+ if (getProject().exists()) {
+ getProject().delete(true, new NullProgressMonitor());
+ }
+ }
+ }
+
+ protected IProject getProject() {
+ return myProject;
+ }
}
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformModeledViewmapTest.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformModeledViewmapTest.java
index 51012d3..81e111c 100644
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformModeledViewmapTest.java
+++ b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/tr/QvtTransformModeledViewmapTest.java
@@ -10,7 +10,16 @@
*******************************************************************************/
package org.eclipse.gmf.tests.tr;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.gmf.codegen.gmfgen.GenChildNode;
import org.eclipse.gmf.codegen.gmfgen.GenCompartment;
import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
@@ -21,20 +30,40 @@ import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel;
import org.eclipse.gmf.codegen.gmfgen.GenTopLevelNode;
import org.eclipse.gmf.codegen.gmfgen.ModeledViewmap;
import org.eclipse.gmf.codegen.gmfgen.Viewmap;
+import org.eclipse.gmf.mappings.Mapping;
import org.eclipse.gmf.tests.ConfiguredTestCase;
+import org.eclipse.gmf.tests.tr.TransformationTestSupport.Transformation;
public class QvtTransformModeledViewmapTest extends ConfiguredTestCase {
-
+ protected static String testFolder = "platform:/plugin/org.eclipse.gmf.tests/models/tests/"; //$NON-NLS-1$
+
public QvtTransformModeledViewmapTest(String name) {
super(name);
}
protected GenEditorGenerator actualGenerator;
- protected GenEditorGenerator expectedGenerator;
+ private IProject myProject;
+ private Mapping mapping;
+ private GenModel genModel;
+ private URI myProjectURI;
public void setUp() throws Exception {
super.setUp();
-// actualGenerator = getQvtTransformation(true).execute();
+ myProject = createProject();
+ myProjectURI = URI.createURI(myProject.getFullPath().toString());
+
+ ResourceSet resourceSet = new ResourceSetImpl();
+ Resource mapRes = resourceSet.createResource(URI.createURI(testFolder).appendSegment("test.gmfmap"));
+ mapRes.load(null);
+ Resource genRes = resourceSet.createResource(URI.createURI(testFolder).appendSegment("test.genmodel"));
+ genRes.load(null);
+
+ mapping = (Mapping) mapRes.getContents().get(0);
+ genModel = (GenModel) genRes.getContents().get(0);
+
+ Transformation qvt = TransformationTestSupport.getQvtTransformation(genModel, mapping, true);
+
+ actualGenerator = qvt.execute(myProjectURI.appendSegment("test.java.gmfgen"));
}
public void testTopNodeModeledViewmap() {
@@ -113,4 +142,33 @@ public class QvtTransformModeledViewmapTest extends ConfiguredTestCase {
assertTrue(viewmap instanceof ModeledViewmap);
}
}
+
+ protected IProject createProject() {
+ String projectName = "TransformToGenModelOperationTest_" + String.valueOf(System.currentTimeMillis()); //$NON-NLS-1$
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ assertFalse("Project with this name already present in the workspace: " + projectName, project.exists());
+ try {
+ project.create(new NullProgressMonitor());
+ project.open(new NullProgressMonitor());
+ } catch (CoreException e) {
+ fail(e.getMessage());
+ }
+ assertTrue("Project was not created: " + projectName, project.exists());
+ return project;
+ }
+
+ protected void deleteProject() throws CoreException {
+ if (getProject() != null) {
+ if (getProject().isOpen()) {
+ getProject().close(new NullProgressMonitor());
+ }
+ if (getProject().exists()) {
+ getProject().delete(true, new NullProgressMonitor());
+ }
+ }
+ }
+
+ protected IProject getProject() {
+ return myProject;
+ }
}