summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkthoms2009-08-21 03:41:20 (EDT)
committer kthoms2009-08-21 03:41:20 (EDT)
commit26fa06d4288e0fb6dd23003e1856a1eef3735b01 (patch)
tree83a7e573eda80d6053c13a5e0dc65fc312240674
parent3af092d5042240829158cabfd430a3c4668831ef (diff)
downloadorg.eclipse.mwe-26fa06d4288e0fb6dd23003e1856a1eef3735b01.zip
org.eclipse.mwe-26fa06d4288e0fb6dd23003e1856a1eef3735b01.tar.gz
org.eclipse.mwe-26fa06d4288e0fb6dd23003e1856a1eef3735b01.tar.bz2
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=286478
Enabled the WorkflowAntTaskTest to be runnable as Plugin Test. Some implications: - moved WorkflowAntTask to separate source folder - packaged Task as Jar - declared task in plugin.xml of test project
-rw-r--r--plugins/org.eclipse.emf.mwe.core/.classpath1
-rw-r--r--plugins/org.eclipse.emf.mwe.core/.settings/org.eclipse.pde.core.prefs3
-rwxr-xr-x[-rw-r--r--]plugins/org.eclipse.emf.mwe.core/src-ant/org/eclipse/emf/mwe/core/ant/WorkflowAntTask.java (renamed from plugins/org.eclipse.emf.mwe.core/src/org/eclipse/emf/mwe/core/ant/WorkflowAntTask.java)0
-rwxr-xr-x[-rw-r--r--]plugins/org.eclipse.emf.mwe.core/src-ant/org/eclipse/emf/mwe/core/ant/package.html (renamed from plugins/org.eclipse.emf.mwe.core/src/org/eclipse/emf/mwe/core/ant/package.html)2
-rwxr-xr-x[-rw-r--r--]plugins/org.eclipse.emf.mwe.core/src-ant/org/eclipse/emf/mwe/internal/core/ant/Parameter.java (renamed from plugins/org.eclipse.emf.mwe.core/src/org/eclipse/emf/mwe/internal/core/ant/Parameter.java)0
-rw-r--r--tests/org.eclipse.emf.mwe.tests/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--tests/org.eclipse.emf.mwe.tests/META-INF/MANIFEST.MF4
-rw-r--r--tests/org.eclipse.emf.mwe.tests/build.properties3
-rw-r--r--tests/org.eclipse.emf.mwe.tests/export-ant.jardesc16
-rw-r--r--tests/org.eclipse.emf.mwe.tests/lib/mwe-ant.jarbin0 -> 4700 bytes
-rw-r--r--tests/org.eclipse.emf.mwe.tests/plugin.xml9
-rw-r--r--tests/org.eclipse.emf.mwe.tests/src/org/eclipse/emf/mwe/core/ant/WorkflowAntTaskTest.java25
-rw-r--r--tests/org.eclipse.emf.mwe.tests/src/org/eclipse/emf/mwe/tests/AllTests.java3
13 files changed, 58 insertions, 10 deletions
diff --git a/plugins/org.eclipse.emf.mwe.core/.classpath b/plugins/org.eclipse.emf.mwe.core/.classpath
index d524183..f2ca314 100644
--- a/plugins/org.eclipse.emf.mwe.core/.classpath
+++ b/plugins/org.eclipse.emf.mwe.core/.classpath
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="org/eclipse/emf/mwe/core/issues/Issue.java" kind="src" path="src"/>
+ <classpathentry kind="src" output="bin-ant" path="src-ant"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
diff --git a/plugins/org.eclipse.emf.mwe.core/.settings/org.eclipse.pde.core.prefs b/plugins/org.eclipse.emf.mwe.core/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 0000000..9c36b4f
--- /dev/null
+++ b/plugins/org.eclipse.emf.mwe.core/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+#Thu Aug 20 17:15:41 CEST 2009
+eclipse.preferences.version=1
+selfhosting.binExcludes=/org.eclipse.emf.mwe.core/bin-ant
diff --git a/plugins/org.eclipse.emf.mwe.core/src/org/eclipse/emf/mwe/core/ant/WorkflowAntTask.java b/plugins/org.eclipse.emf.mwe.core/src-ant/org/eclipse/emf/mwe/core/ant/WorkflowAntTask.java
index ec64cea..ec64cea 100644..100755
--- a/plugins/org.eclipse.emf.mwe.core/src/org/eclipse/emf/mwe/core/ant/WorkflowAntTask.java
+++ b/plugins/org.eclipse.emf.mwe.core/src-ant/org/eclipse/emf/mwe/core/ant/WorkflowAntTask.java
diff --git a/plugins/org.eclipse.emf.mwe.core/src/org/eclipse/emf/mwe/core/ant/package.html b/plugins/org.eclipse.emf.mwe.core/src-ant/org/eclipse/emf/mwe/core/ant/package.html
index b591737..71d047c 100644..100755
--- a/plugins/org.eclipse.emf.mwe.core/src/org/eclipse/emf/mwe/core/ant/package.html
+++ b/plugins/org.eclipse.emf.mwe.core/src-ant/org/eclipse/emf/mwe/core/ant/package.html
@@ -1,5 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<!-- $Id: package.html,v 1.1 2008/12/23 11:20:30 kthoms Exp $ -->
+<!-- $Id: package.html,v 1.1 2009/08/21 07:41:20 kthoms Exp $ -->
<html> <head>
<title></title>
</head>
diff --git a/plugins/org.eclipse.emf.mwe.core/src/org/eclipse/emf/mwe/internal/core/ant/Parameter.java b/plugins/org.eclipse.emf.mwe.core/src-ant/org/eclipse/emf/mwe/internal/core/ant/Parameter.java
index 505ffef..505ffef 100644..100755
--- a/plugins/org.eclipse.emf.mwe.core/src/org/eclipse/emf/mwe/internal/core/ant/Parameter.java
+++ b/plugins/org.eclipse.emf.mwe.core/src-ant/org/eclipse/emf/mwe/internal/core/ant/Parameter.java
diff --git a/tests/org.eclipse.emf.mwe.tests/.settings/org.eclipse.core.resources.prefs b/tests/org.eclipse.emf.mwe.tests/.settings/org.eclipse.core.resources.prefs
index 52164b2..bf30ef0 100644
--- a/tests/org.eclipse.emf.mwe.tests/.settings/org.eclipse.core.resources.prefs
+++ b/tests/org.eclipse.emf.mwe.tests/.settings/org.eclipse.core.resources.prefs
@@ -1,3 +1,3 @@
-#Tue Aug 18 18:37:57 CEST 2009
+#Thu Aug 20 16:52:19 CEST 2009
eclipse.preferences.version=1
encoding/<project>=ISO-8859-1
diff --git a/tests/org.eclipse.emf.mwe.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.mwe.tests/META-INF/MANIFEST.MF
index ea3abd9..9bb79a4 100644
--- a/tests/org.eclipse.emf.mwe.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.emf.mwe.tests/META-INF/MANIFEST.MF
@@ -10,5 +10,7 @@ Require-Bundle: org.junit,
org.apache.ant,
org.eclipse.emf.mwe.core,
org.eclipse.emf.ecore,
- org.eclipse.emf.mwe.utils
+ org.eclipse.emf.mwe.utils,
+ org.eclipse.ant.core,
+ org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/tests/org.eclipse.emf.mwe.tests/build.properties b/tests/org.eclipse.emf.mwe.tests/build.properties
index cefcbd5..76282dd 100644
--- a/tests/org.eclipse.emf.mwe.tests/build.properties
+++ b/tests/org.eclipse.emf.mwe.tests/build.properties
@@ -11,7 +11,8 @@ bin.includes = META-INF/,\
about.ini,\
about.html,\
test.xml,\
- testmodel.xmi
+ testmodel.xmi,\
+ plugin.xml
src.includes = about.html,\
resources/,\
test.xml,\
diff --git a/tests/org.eclipse.emf.mwe.tests/export-ant.jardesc b/tests/org.eclipse.emf.mwe.tests/export-ant.jardesc
new file mode 100644
index 0000000..f135c90
--- /dev/null
+++ b/tests/org.eclipse.emf.mwe.tests/export-ant.jardesc
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<jardesc>
+<jar path="mwe-ant.jar"/>
+<options buildIfNeeded="true" compress="true" descriptionLocation="/org.eclipse.emf.mwe.core/export-ant.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
+<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
+<selectedProjects/>
+<manifest generateManifest="true" manifestLocation="" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true">
+<sealing sealJar="false">
+<packagesToSeal/>
+<packagesToUnSeal/>
+</sealing>
+</manifest>
+<selectedElements exportClassFiles="true" exportJavaFiles="true" exportOutputFolder="false">
+<javaElement handleIdentifier="=org.eclipse.emf.mwe.core/src-ant"/>
+</selectedElements>
+</jardesc>
diff --git a/tests/org.eclipse.emf.mwe.tests/lib/mwe-ant.jar b/tests/org.eclipse.emf.mwe.tests/lib/mwe-ant.jar
new file mode 100644
index 0000000..04a92c9
--- /dev/null
+++ b/tests/org.eclipse.emf.mwe.tests/lib/mwe-ant.jar
Binary files differ
diff --git a/tests/org.eclipse.emf.mwe.tests/plugin.xml b/tests/org.eclipse.emf.mwe.tests/plugin.xml
new file mode 100644
index 0000000..0985cbf
--- /dev/null
+++ b/tests/org.eclipse.emf.mwe.tests/plugin.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ant.core.antTasks">
+ <antTask name="workflow" class="org.eclipse.emf.mwe.core.ant.WorkflowAntTask" library="lib/mwe-ant.jar" headless="false"/>
+
+ </extension>
+</plugin>
diff --git a/tests/org.eclipse.emf.mwe.tests/src/org/eclipse/emf/mwe/core/ant/WorkflowAntTaskTest.java b/tests/org.eclipse.emf.mwe.tests/src/org/eclipse/emf/mwe/core/ant/WorkflowAntTaskTest.java
index 4019258..5a9ef5c 100644
--- a/tests/org.eclipse.emf.mwe.tests/src/org/eclipse/emf/mwe/core/ant/WorkflowAntTaskTest.java
+++ b/tests/org.eclipse.emf.mwe.tests/src/org/eclipse/emf/mwe/core/ant/WorkflowAntTaskTest.java
@@ -1,20 +1,33 @@
package org.eclipse.emf.mwe.core.ant;
-import org.apache.tools.ant.Main;
+import java.io.File;
import junit.framework.TestCase;
+import org.eclipse.ant.core.AntRunner;
+
/**
- * This test cannot be executed as plugin test!
- * @author thoms
- *
+ * Test for {@link WorkflowAntTask}.
+ * @author kthoms
+ * @see http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ant/core/package-summary.html
*/
public class WorkflowAntTaskTest extends TestCase {
/**
* When adding more then one <tt>param</tt> tag the WorkflowAntTasks will fail with a Usage description.
* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=212994
*/
- public void testBug212994 () {
- Main.start(new String[]{"-f","resources/test/res/build.xml"}, null, WorkflowAntTaskTest.class.getClassLoader());
+ public void testBug212994 () throws Exception {
+ AntRunner runner = new AntRunner();
+ // Set up the Ant project with test workflow and use of WorkflowAntTask
+ File buildFile = new File("resources/test/res/build.xml");
+
+ runner.setBuildFileLocation(buildFile.getAbsolutePath());
+
+ // WorkflowRunner will fail with System.exit if something would be wrong.
+ // This would lead to failing unit test with stacktrace:
+ // Caused by: .../org.eclipse.emf.mwe.tests/resources/test/res/build.xml:5: Java returned: 1
+ // at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
+ // at org.eclipse.emf.mwe.core.ant.WorkflowAntTask.execute(WorkflowAntTask.java:71)
+ runner.run();
}
}
diff --git a/tests/org.eclipse.emf.mwe.tests/src/org/eclipse/emf/mwe/tests/AllTests.java b/tests/org.eclipse.emf.mwe.tests/src/org/eclipse/emf/mwe/tests/AllTests.java
index 0114dfa..1d8149c 100644
--- a/tests/org.eclipse.emf.mwe.tests/src/org/eclipse/emf/mwe/tests/AllTests.java
+++ b/tests/org.eclipse.emf.mwe.tests/src/org/eclipse/emf/mwe/tests/AllTests.java
@@ -1,5 +1,7 @@
package org.eclipse.emf.mwe.tests;
+import org.eclipse.emf.mwe.core.ant.WorkflowAntTaskTest;
+
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -11,6 +13,7 @@ public class AllTests {
//$JUnit-BEGIN$
suite.addTestSuite(WorkflowRunnerTest.class);
suite.addTestSuite(IssuesTest.class);
+ suite.addTestSuite(WorkflowAntTaskTest.class);
//$JUnit-END$
return suite;
}