aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael Istria2011-11-16 09:59:18 (EST)
committerMickael Istria2011-11-16 09:59:18 (EST)
commit4cf365e21b71c4f690da4bd00737137983e7843a (patch)
treee4e00d63039f244de77090796d4f36c4c0d2e1a6
parent67339d51f993e93dcf816c7feefdc16f51cede8a (diff)
downloadorg.eclipse.gmf-tooling-4cf365e21b71c4f690da4bd00737137983e7843a.zip
org.eclipse.gmf-tooling-4cf365e21b71c4f690da4bd00737137983e7843a.tar.gz
org.eclipse.gmf-tooling-4cf365e21b71c4f690da4bd00737137983e7843a.tar.bz2
Bug 267354: Test to highlight the bug
-rwxr-xr-xpom.xml16
-rw-r--r--tests/org.eclipse.gmf.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--tests/org.eclipse.gmf.tests/META-INF/MANIFEST.MF11
-rw-r--r--tests/org.eclipse.gmf.tests/pom.xml50
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/AllTests.java30
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/Utils.java46
-rwxr-xr-xtests/pom.xml8
7 files changed, 116 insertions, 48 deletions
diff --git a/pom.xml b/pom.xml
index 1652f3f..cce0cce 100755
--- a/pom.xml
+++ b/pom.xml
@@ -170,20 +170,25 @@
<profile>
<id>indigo</id>
<activation>
- <activeByDefault>false</activeByDefault>
+ <activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>Indigo</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/indigo</url>
- </repository>
+ </repository>
+ <repository>
+ <id>Orbit for Indigo</id>
+ <layout>p2</layout>
+ <url>http://download.eclipse.org/tools/orbit/downloads/drops/R20110523182458/repository/</url>
+ </repository>
</repositories>
</profile>
<profile>
<id>juno-staging</id>
<activation>
- <activeByDefault>true</activeByDefault>
+ <activeByDefault>false</activeByDefault>
</activation>
<repositories>
<repository>
@@ -191,6 +196,11 @@
<layout>p2</layout>
<url>http://download.eclipse.org/releases/staging/</url>
</repository>
+ <repository>
+ <id>orbit-staging</id>
+ <layout>p2</layout>
+ <url>http://download.eclipse.org/tools/orbit/downloads/drops/S20111018035124/repository/</url>
+ </repository>
</repositories>
</profile>
</profiles>
diff --git a/tests/org.eclipse.gmf.tests/.settings/org.eclipse.core.resources.prefs b/tests/org.eclipse.gmf.tests/.settings/org.eclipse.core.resources.prefs
index d5867d9..bcfc80a 100644
--- a/tests/org.eclipse.gmf.tests/.settings/org.eclipse.core.resources.prefs
+++ b/tests/org.eclipse.gmf.tests/.settings/org.eclipse.core.resources.prefs
@@ -1,3 +1,4 @@
-#Thu Mar 19 13:57:27 CET 2009
+#Tue Nov 15 17:44:50 CET 2011
eclipse.preferences.version=1
+encoding//models/tests/267354-FigureRefChildren.gmfgraph=UTF-8
encoding/templates=UTF-8
diff --git a/tests/org.eclipse.gmf.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.gmf.tests/META-INF/MANIFEST.MF
index d243ff5..360179b 100644
--- a/tests/org.eclipse.gmf.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.gmf.tests/META-INF/MANIFEST.MF
@@ -24,7 +24,14 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
org.eclipse.gmf.codegen;bundle-version="[2.0.0,3.0.0)",
org.eclipse.gmf.xpand;bundle-version="[2.1.0,3.0.0)",
org.eclipse.ant.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.pde.core
+ org.eclipse.pde.core,
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.5",
+ org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.5",
+ org.eclipse.swtbot.swt.finder;bundle-version="2.0.5",
+ org.eclipse.jdt.ui;bundle-version="3.7.1",
+ org.eclipse.gmf.graphdef.codegen.ui;bundle-version="1.0.100",
+ org.eclipse.gmf.graphdef.editor;bundle-version="1.1.0",
+ org.hamcrest;bundle-version="1.1.0"
Bundle-Activator: org.eclipse.gmf.tests.Plugin
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.gmf.tests;x-friends:="org.eclipse.gmf.tests.lite",
@@ -34,4 +41,4 @@ Export-Package: org.eclipse.gmf.tests;x-friends:="org.eclipse.gmf.tests.lite",
org.eclipse.gmf.tests.setup;x-friends:="org.eclipse.gmf.tests.lite",
org.eclipse.gmf.tests.setup.figures;x-friends:="org.eclipse.gmf.tests.lite",
org.eclipse.gmf.tests.tr;x-friends:="org.eclipse.gmf.tests.lite"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/tests/org.eclipse.gmf.tests/pom.xml b/tests/org.eclipse.gmf.tests/pom.xml
index cdf0f7b..2299afa 100644
--- a/tests/org.eclipse.gmf.tests/pom.xml
+++ b/tests/org.eclipse.gmf.tests/pom.xml
@@ -29,11 +29,33 @@
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
+ <executions>
+ <execution>
+ <id>SWTBot tests</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <testClass>org.eclipse.gmf.tests.AllSWTBotTests</testClass>
+ <useUIThread>false</useUIThread>
+ </configuration>
+ </execution>
+ <execution>
+ <id>non SWTBot tests</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <testClass>org.eclipse.gmf.tests.AllTests</testClass>
+ <useUIThread>true</useUIThread>
+ </configuration>
+ </execution>
+ </executions>
<configuration>
- <testSuite>org.eclipse.gmf.tests</testSuite>
- <testClass>org.eclipse.gmf.tests.AllTests</testClass>
<useUIHarness>true</useUIHarness>
- <useUIThread>true</useUIThread>
+ <testSuite>org.eclipse.gmf.tests</testSuite>
<argLine>${tycho.testArgLine} -Xmx512m -XX:MaxPermSize=128m -DbuildingWithTycho=true</argLine>
<bundleStartLevel>
<bundle>
@@ -44,17 +66,17 @@
</bundleStartLevel>
<dependencies>
<dependency>
- <type>p2-installable-unit</type>
- <artifactId>org.eclipse.gmf.feature.group</artifactId>
- </dependency>
- <dependency>
- <type>p2-installable-unit</type>
- <artifactId>org.eclipse.pde.feature.group</artifactId>
- </dependency>
- <dependency>
- <type>p2-installable-unit</type>
- <artifactId>org.eclipse.emf.validation.ocl</artifactId>
- </dependency>
+ <type>p2-installable-unit</type>
+ <artifactId>org.eclipse.gmf.feature.group</artifactId>
+ </dependency>
+ <dependency>
+ <type>p2-installable-unit</type>
+ <artifactId>org.eclipse.pde.feature.group</artifactId>
+ </dependency>
+ <dependency>
+ <type>p2-installable-unit</type>
+ <artifactId>org.eclipse.emf.validation.ocl</artifactId>
+ </dependency>
</dependencies>
</configuration>
</plugin>
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 bec657b..221c2f1 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
@@ -8,6 +8,7 @@
*
* Contributors:
* Artem Tikhomirov (Borland) - initial API and implementation
+ * Mickael Istria (EBM Websourcing) - Support for target platform creation
*/
package org.eclipse.gmf.tests;
@@ -83,38 +84,11 @@ import java.util.ArrayList;
public class AllTests {
- public static void setTargetPlatform() throws Exception {
- ITargetPlatformService tpService = TargetPlatformService.getDefault();
- ITargetDefinition targetDef = tpService.newTarget();
- targetDef.setName("Tycho platform");
- Bundle[] bundles = Platform.getBundle("org.eclipse.core.runtime").getBundleContext().getBundles();
- List<IBundleContainer> bundleContainers = new ArrayList<IBundleContainer>();
- Set<File> dirs = new HashSet<File>();
- for (Bundle bundle : bundles) {
- AbstractBundle aBundle = (AbstractBundle)bundle;
- final BaseData bundleData = (BaseData)aBundle.getBundleData();
- File file = bundleData.getBundleFile().getBaseFile();
- File folder = file.getParentFile();
- if (!dirs.contains(folder)) {
- dirs.add(folder);
- bundleContainers.add(tpService.newDirectoryContainer(folder.getAbsolutePath()));
- }
- }
- targetDef.setBundleContainers(bundleContainers.toArray(new IBundleContainer[0]));
- targetDef.setArch(Platform.getOSArch());
- targetDef.setOS(Platform.getOS());
- targetDef.setWS(Platform.getWS());
- targetDef.setNL(Platform.getNL());
- //targetDef.setJREContainer()
- tpService.saveTargetDefinition(targetDef);
- LoadTargetDefinitionJob.load(targetDef);
- }
-
public static Test suite() throws Exception {
if (System.getProperty("buildingWithTycho") != null) {
System.err.println("Generating a target platform");
- setTargetPlatform();
+ Utils.setTargetPlatform();
}
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/Utils.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/Utils.java
index da5d382..7eb18e9 100644
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/Utils.java
+++ b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/Utils.java
@@ -8,14 +8,21 @@
*
* Contributors:
* Artem Tikhomirov (Borland) - initial API and implementation
+ * Mickael Istria (EBM Websourcing) - Support for target platform creation
*/
package org.eclipse.gmf.tests;
+import java.io.File;
+import java.util.ArrayList;
import java.util.Calendar;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
import junit.framework.Assert;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
import org.eclipse.emf.codegen.ecore.genmodel.GenClassifier;
import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
@@ -24,7 +31,15 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.gmf.internal.bridge.genmodel.BasicGenModelAccess;
+import org.eclipse.osgi.baseadaptor.BaseData;
+import org.eclipse.osgi.framework.internal.core.AbstractBundle;
+import org.eclipse.pde.internal.core.target.TargetPlatformService;
+import org.eclipse.pde.internal.core.target.provisional.IBundleContainer;
+import org.eclipse.pde.internal.core.target.provisional.ITargetDefinition;
+import org.eclipse.pde.internal.core.target.provisional.ITargetPlatformService;
+import org.eclipse.pde.internal.core.target.provisional.LoadTargetDefinitionJob;
import org.eclipse.swt.widgets.Display;
+import org.osgi.framework.Bundle;
/**
* @author artem
@@ -119,4 +134,35 @@ public class Utils {
boolean conditionSatisfied = Utils.dispatchDisplayMessages(condition, 10);
Assert.assertTrue("Timeout while waiting for jobs to complete", conditionSatisfied);
}
+
+ /**
+ * Sets a target platform in the test platform to get workspace builds OK with PDE.
+ * @throws Exception
+ */
+ public static void setTargetPlatform() throws Exception {
+ ITargetPlatformService tpService = TargetPlatformService.getDefault();
+ ITargetDefinition targetDef = tpService.newTarget();
+ targetDef.setName("Tycho platform");
+ Bundle[] bundles = Platform.getBundle("org.eclipse.core.runtime").getBundleContext().getBundles();
+ List<IBundleContainer> bundleContainers = new ArrayList<IBundleContainer>();
+ Set<File> dirs = new HashSet<File>();
+ for (Bundle bundle : bundles) {
+ AbstractBundle aBundle = (AbstractBundle)bundle;
+ final BaseData bundleData = (BaseData)aBundle.getBundleData();
+ File file = bundleData.getBundleFile().getBaseFile();
+ File folder = file.getParentFile();
+ if (!dirs.contains(folder)) {
+ dirs.add(folder);
+ bundleContainers.add(tpService.newDirectoryContainer(folder.getAbsolutePath()));
+ }
+ }
+ targetDef.setBundleContainers(bundleContainers.toArray(new IBundleContainer[0]));
+ targetDef.setArch(Platform.getOSArch());
+ targetDef.setOS(Platform.getOS());
+ targetDef.setWS(Platform.getWS());
+ targetDef.setNL(Platform.getNL());
+ //targetDef.setJREContainer()
+ tpService.saveTargetDefinition(targetDef);
+ LoadTargetDefinitionJob.load(targetDef);
+ }
}
diff --git a/tests/pom.xml b/tests/pom.xml
index 7c892f3..735d425 100755
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -67,5 +67,13 @@
</build>
</profile>
</profiles>
+
+ <repositories>
+ <repository>
+ <id>SWTBot</id>
+ <layout>p2</layout>
+ <url>http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site/</url>
+ </repository>
+ </repositories>
</project> \ No newline at end of file