Bug 561321 - Convert pde.build tests to JUnit 4
Change-Id: I101c14ea36be5d00368eac5445a258fafa26860b
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/org.eclipse.pde.build.tests/META-INF/MANIFEST.MF b/org.eclipse.pde.build.tests/META-INF/MANIFEST.MF
index cd695ec..40dc40e 100644
--- a/org.eclipse.pde.build.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.pde.build.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Tests Plug-in
Bundle-SymbolicName: org.eclipse.pde.build.tests;singleton:=true
-Bundle-Version: 1.2.600.qualifier
+Bundle-Version: 1.2.700.qualifier
Bundle-Activator: org.eclipse.pde.build.tests.Activator
Export-Package: org.eclipse.pde.build.internal.tests;x-internal:=true,
org.eclipse.pde.build.internal.tests.ant;x-internal:=true,
diff --git a/org.eclipse.pde.build.tests/pom.xml b/org.eclipse.pde.build.tests/pom.xml
index da51f30..fd6ca26 100644
--- a/org.eclipse.pde.build.tests/pom.xml
+++ b/org.eclipse.pde.build.tests/pom.xml
@@ -18,7 +18,7 @@
</parent>
<groupId>org.eclipse.pde</groupId>
<artifactId>org.eclipse.pde.build.tests</artifactId>
- <version>1.2.600-SNAPSHOT</version>
+ <version>1.2.700-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
<skipTests>true</skipTests>
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java
index 6929400..3e1a975 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java
@@ -13,15 +13,19 @@
package org.eclipse.pde.build.internal.tests;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
import java.io.File;
import java.util.*;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.pde.build.tests.BuildConfiguration;
import org.eclipse.pde.build.tests.PDETestCase;
+import org.junit.Test;
public class AssembleTests extends PDETestCase {
-
+ @Test
public void testCustomAssembly() throws Exception {
IFolder buildFolder = newTest("customAssembly");
@@ -50,6 +54,7 @@
assertLogContainsLines(buildFolder.getFile("log.log"), log);
}
+ @Test
public void testBug179612_default() throws Exception {
IFolder buildFolder = newTest("179612");
@@ -76,6 +81,7 @@
assertResourceFile(buildFolder, "I.TestBuild/sdk-TestBuild-win32.win32.x86_64.zip");
}
+ @Test
public void testBug179612_custom() throws Exception {
// we have a custom allElements.xml coming from the resources folder
IFolder buildFolder = newTest("179612_custom");
@@ -108,6 +114,7 @@
assertResourceFile(buildFolder, "I.TestBuild/MyCustomName.zip");
}
+ @Test
public void testBug196754() throws Exception {
IFolder buildFolder = newTest("196754");
@@ -136,6 +143,7 @@
}
}
+ @Test
public void testBug211605() throws Exception {
IFolder buildFolder = newTest("211605");
@@ -163,6 +171,7 @@
assertEquals(resultFolder.list().length, 3);
}
+ @Test
public void testBug255824() throws Exception {
IFolder buildFolder = newTest("255824");
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/FetchTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/FetchTests.java
index aa7ff67..eeb6dc1 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/FetchTests.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/FetchTests.java
@@ -13,6 +13,7 @@
package org.eclipse.pde.build.internal.tests;
+import static org.junit.Assert.*;
import static org.junit.Assume.assumeTrue;
import java.io.File;
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java
index 388d5f0..1a1b95b 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java
@@ -13,11 +13,12 @@
package org.eclipse.pde.build.internal.tests;
+import static org.junit.Assert.*;
+
import java.io.*;
import java.net.URL;
import java.util.*;
import java.util.jar.Attributes;
-import junit.framework.AssertionFailedError;
import org.apache.tools.ant.*;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
@@ -31,6 +32,7 @@
import org.eclipse.pde.build.tests.*;
import org.eclipse.pde.internal.build.*;
import org.eclipse.pde.internal.swt.tools.IconExe;
+import org.junit.Test;
import org.osgi.framework.Version;
public class ProductTests extends PDETestCase {
@@ -77,6 +79,7 @@
assertTrue(entries.size() == 1);
}
+ @Test
public void test218878() throws Exception {
// platform specific config.ini files
// files copied from resources folder
@@ -113,6 +116,7 @@
assertEquals("linux", props.getProperty("os"));
}
+ @Test
public void test234032() throws Exception {
IFolder buildFolder = newTest("234032");
@@ -136,6 +140,7 @@
assertLogContainsLine(iniFile, "-Dschemes2=archive zip jar");
}
+ @Test
public void test237922() throws Exception {
IFolder buildFolder = newTest("237922");
@@ -174,6 +179,7 @@
assertEquals(subTasks.length, 2);
}
+ @Test
public void test186224() throws Exception {
IFolder buildFolder = newTest("186224");
@@ -191,6 +197,7 @@
buildFolder.getLocation().toOSString(), properties);
}
+ @Test
public void test315792() throws Exception {
IFolder buildFolder = newTest("315792");
@@ -212,6 +219,7 @@
assertLogContainsLine(buildFolder.getFile("log.log"), "[eclipse.generateFeature] Incorrect directory entry");
}
+ @Test
public void test237747() throws Exception {
IFolder buildFolder = newTest("237747");
@@ -236,6 +244,7 @@
assertResourceFile(buildFolder, "I.TestBuild/eclipse-win32.win32.x86_64.zip");
}
+ @Test
public void testBug238001() throws Exception {
IFolder buildFolder = newTest("238001");
@@ -269,6 +278,7 @@
assertEquals(0, new File(buildFolder.getLocation().toOSString(), "out.out").length());
}
+ @Test
public void testBug249410() throws Exception {
IFolder buildFolder = newTest("249410");
IFile product = buildFolder.getFile("foo.product");
@@ -317,6 +327,7 @@
assertTrue(bundlesList.indexOf('c') > -1);
}
+ @Test
public void testBug252246() throws Exception {
IFolder buildFolder = newTest("252246");
@@ -364,7 +375,7 @@
try {
assertLogContainsLine(info, "org.eclipse.swt.gtk.linux.x86_64");
swtNotThere = false;
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
// good
}
assertTrue(swtNotThere);
@@ -375,6 +386,7 @@
assertLogContainsLine(gtkInfo, "org.eclipse.swt.gtk.linux.x86_64");
}
+ @Test
public void testBug271373() throws Exception {
IFolder buildFolder = newTest("271373");
@@ -402,6 +414,7 @@
assertResourceFile(buildFolder, "tmp/eclipse/plugins/A_1.0.0.jar");
}
+ @Test
public void testBug265438() throws Exception {
IFolder buildFolder = newTest("265438");
@@ -436,6 +449,7 @@
assertLogContainsLine(buildFolder.getFile("tmp/eclipse/configuration/config.ini"), "osgi.bundles=A@start");
}
+ @Test
public void testBug246060() throws Exception {
IFolder buildFolder = newTest("246060");
@@ -466,6 +480,7 @@
assertEquals(i.next().getVersion(), "1.2.1");
}
+ @Test
public void testBug262324() throws Exception {
IFolder buildFolder = newTest("262324");
@@ -486,6 +501,7 @@
generateScripts(buildFolder, properties);
}
+ @Test
public void testBug266056() throws Exception {
IFolder buildFolder = newTest("266056");
@@ -532,6 +548,7 @@
"org.eclipse.equinox.common_" + versions.get("org.eclipse.equinox.common") + ",1,true");
}
+ @Test
public void testBug266056_2() throws Exception {
IFolder buildFolder = newTest("266056_2");
@@ -565,6 +582,7 @@
}
+ @Test
public void testBug269540() throws Exception {
IFolder buildFolder = newTest("269540");
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java
index 241e877..4d934ea 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java
@@ -13,6 +13,8 @@
package org.eclipse.pde.build.internal.tests;
+import static org.junit.Assert.*;
+
import java.io.*;
import java.net.URL;
import java.util.*;
@@ -35,12 +37,15 @@
import org.eclipse.pde.internal.build.*;
import org.eclipse.pde.internal.build.builder.BuildDirector;
import org.eclipse.pde.internal.build.site.*;
+import org.junit.Ignore;
+import org.junit.Test;
import org.osgi.framework.Version;
public class ScriptGenerationTests extends PDETestCase {
// Test that script generation works when buildDirectory does not contain a
// plugins subdirectory
+ @Test
public void testBug147292() throws Exception {
IFolder buildFolder = newTest("147292");
@@ -58,6 +63,7 @@
// Test that the order in which archivesFormat and configInfo are set does not
// matter
+ @Test
public void testBug148288() throws Exception {
IProject buildProject = newTest();
@@ -101,6 +107,7 @@
// Test script generation for bundles using Bundle-RequiredExecutionEnvironment
// when the state does not contain org.eclipse.osgi
+ @Test
public void testBug178447() throws Exception {
IFolder buildFolder = newTest("178447");
@@ -119,6 +126,7 @@
}
// Test the use of customBuildCallbacks.buildpath
+ @Test
public void testBug183869() throws Exception {
IFolder buildFolder = newTest("183869");
@@ -142,7 +150,9 @@
* multiple features instead of just one. See
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=379182.
*/
- public void _testBug183924() throws Exception {
+ @Test
+ @Ignore
+ public void testBug183924() throws Exception {
IFolder buildFolder = newTest("183924");
IFolder configFolder = Utils.createFolder(buildFolder, "configuration/org.eclipse.update");
@@ -183,7 +193,9 @@
}
}
- public void _testBug221855() throws Exception {
+ @Test
+ @Ignore
+ public void testBug221855() throws Exception {
IFolder buildFolder = newTest("221855");
IFolder tempFolder = Utils.createFolder(buildFolder, "temp");
Utils.generateBundle(tempFolder, "org.eclipse.pde.build.test.221855");
@@ -233,6 +245,7 @@
}
// test that the order of features passed to FeatureGenerator is preserved
+ @Test
public void testBug187809() throws Exception {
IFolder buildFolder = newTest("187809");
@@ -250,6 +263,7 @@
assertEquals(included[2].getId(), "disco");
}
+ @Test
public void testBug203270() throws Exception {
// test the highest version of a bundle is selected when both are resolved
IFolder buildFolder = newTest("203270");
@@ -272,6 +286,7 @@
}
// Test that & characters in classpath are escaped properly
+ @Test
public void testBug125577() throws Exception {
IFolder buildFolder = newTest("125577");
Utils.createFolder(buildFolder, "plugins");
@@ -298,6 +313,7 @@
assertValidAntScript(bundleB.getFile("build.xml"));
}
+ @Test
public void testSimpleClasspath() throws Exception {
IFolder buildFolder = newTest("SimpleClasspath");
@@ -325,6 +341,7 @@
}
}
+ @Test
public void testBug207500() throws Exception {
IFolder buildFolder = newTest("207500");
@@ -351,6 +368,7 @@
assertTrue(path.indexOf(swtFragment) > 0);
}
+ @Test
public void testPluginPath() throws Exception {
IFolder buildFolder = newTest("PluginPath");
IFolder bundleA = Utils.createFolder(buildFolder, "plugins/bundleA");
@@ -367,6 +385,7 @@
generateScripts(buildFolder, props);
}
+ @Test
public void testBug128901_filteredDependencyCheck() throws Exception {
IFolder buildFolder = newTest("128901");
IFolder bundleFolder = Utils.createFolder(buildFolder, "plugins/bundle");
@@ -396,6 +415,7 @@
assertTrue(path.indexOf("org.eclipse.core.runtime.compatibility.registry") == -1);
}
+ @Test
public void testBug198536() throws Exception {
final IFolder buildFolder = newTest("198536");
@@ -439,6 +459,7 @@
assertEquals(pluginEntryModels[2].getVersion(), "2.1.2");
}
+ @Test
public void testBug207335() throws Exception {
IFolder buildFolder = newTest("207335");
@@ -456,6 +477,7 @@
generateScripts(buildFolder, properties);
}
+ @Test
public void testBug206679() throws Exception {
IFolder buildFolder = newTest("206679");
@@ -482,6 +504,7 @@
assertTrue(false);
}
+ @Test
public void testBug193393() throws Exception {
IFolder buildFolder = newTest("193393");
IFolder bundleA = Utils.createFolder(buildFolder, "bundleA");
@@ -533,7 +556,7 @@
// buildFolder.getFile("plugins/Plugin21/javaCompiler.Plugin21.jar.args");
// assertFalse(javaCompilerArgs.exists());
// }
-
+ @Test
public void testBug210464() throws Exception {
IFolder buildFolder = newTest("210464 space");
@@ -545,6 +568,7 @@
assertResourceFile(buildFolder, "features/featureA/build.xml");
}
+ @Test
public void testBug212920() throws Exception {
IFolder buildFolder = newTest("212920");
@@ -556,6 +580,7 @@
generateScripts(buildFolder, BuildConfiguration.getScriptGenerationProperties(buildFolder, "plugin", "bundle"));
}
+ @Test
public void testBug224098() throws Exception {
IFolder buildFolder = newTest("224098");
@@ -577,6 +602,7 @@
generateScripts(buildFolder, props);
}
+ @Test
public void testBug208011_simpleCycle() throws Exception {
IFolder buildFolder = newTest("208011");
@@ -589,6 +615,7 @@
runBuild(buildFolder);
}
+ @Test
public void testBug199241() throws Exception {
IFolder buildFolder = newTest("199241");
IFolder fooFolder = Utils.createFolder(buildFolder, "plugins/foo");
@@ -609,6 +636,7 @@
assertResourceFile(fooFolder, "foo_1.0.0.jar");
}
+ @Test
public void testBug237475() throws Exception {
IFolder buildFolder = newTest("237475");
@@ -616,6 +644,7 @@
generateScripts(buildFolder, BuildConfiguration.getScriptGenerationProperties(buildFolder, "feature", "f"));
}
+ @Test
public void testBug247091() throws Exception {
IFolder buildFolder = newTest("247091");
// also tests bug 250942
@@ -638,6 +667,7 @@
new String[] { "../F1", "../F2", "../F3" });
}
+ @Test
public void testBug247091_2() throws Exception {
VersionRange range = org.eclipse.pde.internal.build.Utils.createVersionRange("1.0.0");
assertTrue(range.getIncludeMinimum());
@@ -683,6 +713,7 @@
}
+ @Test
public void testBug246127() throws Exception {
IFolder buildFolder = newTest("246127");
@@ -708,6 +739,7 @@
// success if we found all the bundles and hence did not throw an exception
}
+ @Test
public void testBug247232() throws Exception {
IFolder buildFolder = newTest("247232");
@@ -725,6 +757,7 @@
"Problem occurred while considering plugin: Test Bundle org.foo.", "invalid qualifier" });
}
+ @Test
public void testBug248767_212467() throws Exception {
IFolder rootFolder = newTest("248767");
IFolder build1 = rootFolder.getFolder("build1");
@@ -760,6 +793,7 @@
runBuild(build2);
}
+ @Test
public void testBug238177() throws Exception {
IFolder buildFolder = newTest("238177");
IFolder a = Utils.createFolder(buildFolder, "plugins/A");
@@ -848,6 +882,7 @@
}
}
+ @Test
public void testQualifierSuffixes() throws Exception {
BuildTimeFeature f1 = new BuildTimeFeature("foo", "1.0.0.v1");
f1.addEntry(new FeatureEntry("a", "1.2.3.aaa-0z-aaa", true));
@@ -928,6 +963,7 @@
assertTrue(director.getQualifierSuffix(f1).compareTo(director.getQualifierSuffix(f2)) < 0);
}
+ @Test
public void testBug156043() throws Exception {
IFolder buildFolder = newTest("156043");
IFolder p1 = Utils.createFolder(buildFolder, "plugins/p1");
@@ -964,6 +1000,7 @@
assertZipContents(f1, "F1_1.0.0.log.zip", entries);
}
+ @Test
public void testBug239843_1() throws Exception {
IFolder buildFolder = newTest("239843_1");
@@ -999,6 +1036,7 @@
// NOTE: If this test fails, then the supported BREE probably increased and need
// to be adjusted below
+ @Test
public void testBug239843_2() throws Exception {
IFolder buildFolder = newTest("239843_2");
@@ -1031,6 +1069,7 @@
// NOTE: If this test fails, it might be because the supported BREE probably
// increased and need to be adjusted below
+ @Test
public void testBug239843_3() throws Exception {
IFolder buildFolder = newTest("239843_3");
@@ -1077,6 +1116,7 @@
generateScripts(buildFolder, buildProperties);
}
+ @Test
public void testBug262294() throws Exception {
IFolder buildFolder = newTest("262294");
@@ -1101,6 +1141,7 @@
generateProperties);
}
+ @Test
public void testRootFiles_1() throws Exception {
IFolder buildFolder = newTest("RootFiles_1");
IFolder f = Utils.createFolder(buildFolder, "features/F");
@@ -1141,6 +1182,7 @@
assertZipContents(buildFolder, "I.TestBuild/F-TestBuild.zip", zipEntries);
}
+ @Test
public void testBug256787() throws Exception {
IFolder buildFolder = newTest("256787");
@@ -1162,6 +1204,7 @@
"Bundle-RequiredExecutionEnvironment: J2SE-1.4");
}
+ @Test
public void testBug260634() throws Exception {
IFolder buildFolder = newTest("260634");
@@ -1182,6 +1225,7 @@
}
}
+ @Test
public void testBug217005() throws Exception {
IFolder buildFolder = newTest("217005");
IFolder f = Utils.createFolder(buildFolder, "features/f");
@@ -1212,6 +1256,7 @@
assertResourceFile(buildFolder, "tmp/eclipse/plugins/shape_1.0.0.jar");
}
+ @Test
public void testBug219832() throws Exception {
IFolder buildFolder = newTest("219832");
@@ -1245,6 +1290,7 @@
assertJarVerifies(result.getLocation().toFile(), true);
}
+ @Test
public void testBug190041() throws Exception {
IFolder buildFolder = newTest("190041");
@@ -1310,6 +1356,7 @@
assertJarVerifies(tempJar, true);
}
+ @Test
public void testBug279583() throws Exception {
IFolder buildFolder = newTest("279583");
@@ -1330,6 +1377,7 @@
}
}
+ @Test
public void testBug281592() throws Exception {
IFolder buildFolder = newTest("281592");
@@ -1392,6 +1440,7 @@
runBuild(buildFolder);
}
+ @Test
public void testBug279622() throws Exception {
IFolder buildFolder = newTest("279622");
@@ -1445,6 +1494,7 @@
runBuild(buildFolder);
}
+ @Test
public void testBug284721() throws Exception {
IFolder buildFolder = newTest("284721");
@@ -1541,6 +1591,7 @@
runBuild(buildFolder);
}
+ @Test
public void testBug252711() throws Exception {
IFolder buildFolder = newTest("252711");
@@ -1568,6 +1619,7 @@
&& failedMessage.indexOf("Another singleton version selected: a_3.4.2.v_833") > -1);
}
+ @Test
public void testCatchAllValue() throws Exception {
IFolder buildFolder = newTest("catchAll");
@@ -1592,6 +1644,7 @@
runBuild(buildFolder);
}
+ @Test
public void testBug291527() throws Exception {
IFolder buildFolder = newTest("291527");
@@ -1658,6 +1711,7 @@
new String[] { "Discouraged access: The type 'A'", "3 problems (3 errors)" });
}
+ @Test
public void testBug243582() throws Exception {
IFolder buildFolder = newTest("243582");
IFolder A = Utils.createFolder(buildFolder, "plugins/A");
@@ -1706,6 +1760,7 @@
assertEquals(m.getMainAttributes().getValue(IPDEBuildConstants.ECLIPSE_SOURCE_REF), "foo.bar;type:=mine");
}
+ @Test
public void testBug284806() throws Exception {
IFolder buildFolder = newTest("284806");
IFolder A = Utils.createFolder(buildFolder, "plugins/A");
@@ -1745,6 +1800,7 @@
properties);
}
+ @Test
public void testBug301311() throws Exception {
Properties antProperties = new Properties();
antProperties.put(IBuildPropertiesConstants.PROPERTY_PACKAGER_AS_NORMALIZER, "true");
@@ -1775,6 +1831,7 @@
}
// Tests sourceFileExtensions attribute in build.properties
+ @Test
public void test303960sourceFileExtensions1() throws Exception {
IFolder buildFolder = newTest("303960_sourceFileExtensions1");
Utils.createFolder(buildFolder, "plugins");
@@ -1833,6 +1890,7 @@
}
// Tests sourceFileExtensions attribute in build.properties
+ @Test
public void test303960sourceFileExtensions2() throws Exception {
IFolder buildFolder = newTest("303960_sourceFileExtensions2");
Utils.createFolder(buildFolder, "plugins");
@@ -1878,6 +1936,7 @@
}
// Tests compilerAdapter attribute in build.properties
+ @Test
public void test303960compilerAdapter() throws Exception {
IFolder buildFolder = newTest("303960_compilerAdapter");
Utils.createFolder(buildFolder, "plugins");
@@ -1903,6 +1962,7 @@
}
// Tests compilerAdapter.useLog attribute in build.properties
+ @Test
public void test303960compilerAdapterUseLog1() throws Exception {
IFolder buildFolder = newTest("303960_compilerAdapterUseLog1");
Utils.createFolder(buildFolder, "plugins");
@@ -1940,6 +2000,7 @@
}
// Tests compilerAdapter.useLog attribute in build.properties
+ @Test
public void test303960compilerAdapterUseLog2() throws Exception {
IFolder buildFolder = newTest("303960_compilerAdapterUseLog2");
Utils.createFolder(buildFolder, "plugins");
@@ -1978,6 +2039,7 @@
}
// Tests compilerAdapter.useLog attribute in build.properties
+ @Test
public void test303960compilerAdapterUseLog3() throws Exception {
IFolder buildFolder = newTest("303960_compilerAdapterUseLog3");
Utils.createFolder(buildFolder, "plugins");
@@ -2015,6 +2077,7 @@
}
// Tests compilerAdapter.useArgFile attribute in build.properties
+ @Test
public void test303960compilerAdapterUseArgFile1() throws Exception {
IFolder buildFolder = newTest("303960_compilerAdapterUseArgFile1");
Utils.createFolder(buildFolder, "plugins");
@@ -2053,6 +2116,7 @@
}
// Tests compilerAdapter.useArgFile attribute in build.properties
+ @Test
public void test303960compilerAdapterUseArgFile2() throws Exception {
IFolder buildFolder = newTest("303960_compilerAdapterUseArgFile2");
Utils.createFolder(buildFolder, "plugins");
@@ -2092,6 +2156,7 @@
}
// Tests compilerAdapter.useArgFile attribute in build.properties
+ @Test
public void test303960compilerAdapterUseArgFile3() throws Exception {
IFolder buildFolder = newTest("303960_compilerAdapterUseArgFile3");
Utils.createFolder(buildFolder, "plugins");
@@ -2130,6 +2195,7 @@
}
// Tests compilerArgs attribute in build.properties
+ @Test
public void test303960compilerArgs1() throws Exception {
IFolder buildFolder = newTest("303960_compilerArgs1");
Utils.createFolder(buildFolder, "plugins");
@@ -2165,6 +2231,7 @@
}
// Tests compilerArgs attribute in build.properties
+ @Test
public void test303960compilerArgs2() throws Exception {
IFolder buildFolder = newTest("303960_compilerArgs2");
Utils.createFolder(buildFolder, "plugins");
@@ -2200,6 +2267,7 @@
fail("Should have found compiler log entry:\n-foo -bar baz");
}
+ @Test
public void testBug309572() throws Exception {
IFolder buildFolder = newTest("309572");
@@ -2224,6 +2292,7 @@
runBuild(buildFolder);
}
+ @Test
public void testBug265771() throws Exception {
IFolder buildFolder = newTest("265771");
@@ -2248,6 +2317,7 @@
runBuild(buildFolder);
}
+ @Test
public void testBug157375_NestedJars() throws Exception {
IFolder root = newTest("157375");
IFolder buildFolder = Utils.createFolder(root, "first");
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/SourceTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/SourceTests.java
index 83c60c8..869818e 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/SourceTests.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/SourceTests.java
@@ -13,6 +13,8 @@
package org.eclipse.pde.build.internal.tests;
+import static org.junit.Assert.*;
+
import java.io.*;
import java.util.*;
import java.util.jar.Attributes;
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/LicenseTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/LicenseTests.java
index 67e519a..dc131c6 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/LicenseTests.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/LicenseTests.java
@@ -12,6 +12,8 @@
*******************************************************************************/
package org.eclipse.pde.build.internal.tests.p2;
+import static org.junit.Assert.*;
+
import java.io.File;
import java.util.*;
import org.eclipse.core.resources.IFile;
@@ -28,6 +30,7 @@
import org.eclipse.pde.build.tests.BuildConfiguration;
import org.eclipse.pde.internal.build.site.BuildTimeFeature;
import org.eclipse.pde.internal.build.site.BuildTimeFeatureFactory;
+import org.junit.Test;
public class LicenseTests extends P2TestCase {
private static final int URL_EMPTY = 1;
@@ -36,6 +39,7 @@
private static final int DESC_EMPTY = 100;
private static final int DESC_NON_EMPTY = 101;
+ @Test
public void testLicenseFeatureOldP2() throws Exception {
IFolder buildFolder = newTest("testLicenseFeatureOldP2", "licenseFeature1");
IFolder repo = Utils.createFolder(buildFolder, "repo");
@@ -75,7 +79,8 @@
assertZipContents(buildFolder, "repo/features/F1_1.0.0.jar", entries);
- // Check that feature.properties contains all original properties PLUS properties from license
+ // Check that feature.properties contains all original properties PLUS
+ // properties from license
IFile licensePropertyFile = buildFolder.getFile("features/L1/feature.properties");
Properties licenseProperties = Utils.loadProperties(licensePropertyFile);
@@ -83,10 +88,12 @@
Properties originalProperties = Utils.loadProperties(originalPropertyFile);
IFile actualPropertiesFile = buildFolder.getFile("checkProperties");
- Utils.extractFromZip(buildFolder, "I.TestBuild/F1-TestBuild.zip", "eclipse/features/F1_1.0.0/feature.properties", actualPropertiesFile);
+ Utils.extractFromZip(buildFolder, "I.TestBuild/F1-TestBuild.zip",
+ "eclipse/features/F1_1.0.0/feature.properties", actualPropertiesFile);
Properties actualProperties = Utils.loadProperties(actualPropertiesFile);
- assertEquals("Result feature.properties has incorrect number of properties", originalProperties.size() + 2, actualProperties.size());
+ assertEquals("Result feature.properties has incorrect number of properties", originalProperties.size() + 2,
+ actualProperties.size());
Enumeration<Object> keys = originalProperties.keys();
while (keys.hasMoreElements()) {
@@ -114,7 +121,8 @@
// Check that license elements in feature.xml where changed.
IFile actualFeatureFile = buildFolder.getFile("checkFeature.xml");
- Utils.extractFromZip(buildFolder, "I.TestBuild/F1-TestBuild.zip", "eclipse/features/F1_1.0.0/feature.xml", actualFeatureFile);
+ Utils.extractFromZip(buildFolder, "I.TestBuild/F1-TestBuild.zip", "eclipse/features/F1_1.0.0/feature.xml",
+ actualFeatureFile);
BuildTimeFeature actualFeature = factory.parseBuildFeature(actualFeatureFile.getLocationURI().toURL());
assertNotNull(actualFeature.getLicense());
@@ -129,6 +137,7 @@
}
// Test various combinations of empty and non-empty license and payload values
+ @Test
public void testEmptyCombosPDE() throws Exception {
// Prepare
@@ -161,6 +170,7 @@
}
}
+ @Test
public void testRootUsedWithNoLicenseRefPDE() throws Exception {
boolean expectedExceptionCaught = false;
@@ -171,13 +181,15 @@
try {
runBuild(buildFolder);
} catch (Exception e) {
- assertTrue("Build throws wrong exception", e.getMessage().indexOf("uses 'license:' root keyword but does not reference a license feature") != -1);
+ assertTrue("Build throws wrong exception", e.getMessage()
+ .indexOf("uses 'license:' root keyword but does not reference a license feature") != -1);
expectedExceptionCaught = true;
}
assertTrue("Build should have failed", expectedExceptionCaught);
}
+ @Test
public void testLicenseFeaturePDE() throws Exception {
IFolder buildFolder = newTest("testLicenseFeaturePDE", "licenseFeature1");
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
@@ -196,7 +208,8 @@
assertZipContents(buildFolder, "I.TestBuild/F1-TestBuild.zip", entries);
- // Check that feature.properties contains all original properties PLUS properties from license
+ // Check that feature.properties contains all original properties PLUS
+ // properties from license
IFile licensePropertyFile = buildFolder.getFile("features/L1/feature.properties");
Properties licenseProperties = Utils.loadProperties(licensePropertyFile);
@@ -204,10 +217,12 @@
Properties originalProperties = Utils.loadProperties(originalPropertyFile);
IFile actualPropertiesFile = buildFolder.getFile("checkProperties");
- Utils.extractFromZip(buildFolder, "I.TestBuild/F1-TestBuild.zip", "eclipse/features/F1_1.0.0/feature.properties", actualPropertiesFile);
+ Utils.extractFromZip(buildFolder, "I.TestBuild/F1-TestBuild.zip",
+ "eclipse/features/F1_1.0.0/feature.properties", actualPropertiesFile);
Properties actualProperties = Utils.loadProperties(actualPropertiesFile);
- assertEquals("Result feature.properties has incorrect number of properties", originalProperties.size() + 2, actualProperties.size());
+ assertEquals("Result feature.properties has incorrect number of properties", originalProperties.size() + 2,
+ actualProperties.size());
Enumeration<Object> keys = originalProperties.keys();
while (keys.hasMoreElements()) {
@@ -224,6 +239,7 @@
checkBuiltFeature(buildFolder, "");
}
+ @Test
public void testP2Gathering() throws Exception {
IFolder buildFolder = newTest("licenseP2Gathering", "licenseFeature1");
@@ -245,30 +261,39 @@
entries.add("license.html");
assertZipContents(buildFolder, "buildRepo/features/F1_1.0.0.jar", entries);
- //also try using the gather task directly
+ // also try using the gather task directly
IFile testXML = buildFolder.getFile("test.xml");
IFolder repo2 = Utils.createFolder(buildFolder, "repo2");
StringBuffer test = new StringBuffer();
- test.append("<project default=\"publish\"> \n");
- test.append(" <target name=\"publish\"> \n");
- test.append(" <eclipse.gatherFeature metadataRepository=\"${repo}\" artifactRepository=\"${repo}\" \n");
- test.append(" buildResultFolder=\"${folder}\" baseDirectory=\"${folder}\" \n");
- test.append(" licenseDirectory=\"${license}\" /> \n");
- test.append(" </target> \n");
- test.append("</project> \n");
+ test.append(
+ "<project default=\"publish\"> \n");
+ test.append(
+ " <target name=\"publish\"> \n");
+ test.append(
+ " <eclipse.gatherFeature metadataRepository=\"${repo}\" artifactRepository=\"${repo}\" \n");
+ test.append(
+ " buildResultFolder=\"${folder}\" baseDirectory=\"${folder}\" \n");
+ test.append(
+ " licenseDirectory=\"${license}\" /> \n");
+ test.append(
+ " </target> \n");
+ test.append(
+ "</project> \n");
Utils.writeBuffer(testXML, test);
properties = new Properties();
properties.put("repo", URIUtil.toUnencodedString(repo2.getLocationURI()));
properties.put("folder", buildFolder.getFolder("features/F1").getLocation().toString());
properties.put("license", buildFolder.getFolder("features/L1").getLocation().toString());
- runAntScript(testXML.getLocation().toOSString(), new String[] {"publish"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(testXML.getLocation().toOSString(), new String[] { "publish" },
+ buildFolder.getLocation().toOSString(), properties);
entries = new HashSet<>();
entries.add("license.html");
assertZipContents(repo2, "features/F1_1.0.0.jar", entries);
}
+ @Test
public void testP2Gathering_Custom() throws Exception {
IFolder buildFolder = newTest("licenseP2GatheringCustom", "licenseFeature1");
@@ -314,6 +339,7 @@
assertZipContents(buildFolder, "buildRepo/binary/F1_root_1.0.0", entries);
}
+ @Test
public void testBinaryLicense() throws Exception {
IFolder buildFolder = newTest("binaryLicense", "licenseFeature1");
@@ -333,7 +359,8 @@
runBuild(buildFolder);
IFolder build2 = Utils.createFolder(buildFolder, "build2");
- Utils.copy(buildFolder.getFolder("features/F1").getLocation().toFile(), build2.getFolder("features/F1").getLocation().toFile());
+ Utils.copy(buildFolder.getFolder("features/F1").getLocation().toFile(),
+ build2.getFolder("features/F1").getLocation().toFile());
properties = BuildConfiguration.getBuilderProperties(build2);
properties.put("topLevelElementId", "F1");
@@ -347,7 +374,8 @@
assertFalse(build2.getFolder("tmp/eclipse/features/F1_1.0.0/META-INF").exists());
IFolder build3 = Utils.createFolder(buildFolder, "build3");
- Utils.copy(buildFolder.getFolder("features/F1").getLocation().toFile(), build3.getFolder("features/F1").getLocation().toFile());
+ Utils.copy(buildFolder.getFolder("features/F1").getLocation().toFile(),
+ build3.getFolder("features/F1").getLocation().toFile());
properties = BuildConfiguration.getBuilderProperties(build3);
properties.put("topLevelElementId", "F1");
@@ -363,23 +391,24 @@
assertResourceFile(build2, "tmp/eclipse/features/F1_1.0.0/sub/license.html");
assertFalse(build2.getFolder("tmp/eclipse/features/F1_1.0.0/META-INF").exists());
assertResourceFile(build3, "buildRepo/features/F1_1.0.0.jar");
- assertFalse(Utils.extractFromZip(build3, "buildRepo/features/F1_1.0.0.jar", "META-INF/ECLIPSEF.RSA", build3.getFile("rsa.txt")));
+ assertFalse(Utils.extractFromZip(build3, "buildRepo/features/F1_1.0.0.jar", "META-INF/ECLIPSEF.RSA",
+ build3.getFile("rsa.txt")));
}
private String getStateMessage(int state) {
switch (state) {
- case URL_NONE :
- return "No URL";
- case URL_EMPTY :
- return "URL Empty";
- case URL_NON_EMPTY :
- return "URL Not Empty";
- case DESC_EMPTY :
- return "Description Empty";
- case DESC_NON_EMPTY :
- return "Description Not Empty";
- default :
- return "unknown";
+ case URL_NONE:
+ return "No URL";
+ case URL_EMPTY:
+ return "URL Empty";
+ case URL_NON_EMPTY:
+ return "URL Not Empty";
+ case DESC_EMPTY:
+ return "Description Empty";
+ case DESC_NON_EMPTY:
+ return "Description Not Empty";
+ default:
+ return "unknown";
}
}
@@ -394,9 +423,11 @@
// Check that license elements in feature.xml where changed.
BuildTimeFeatureFactory factory = new BuildTimeFeatureFactory();
- //IFile actualFeatureFile = buildFolder.getFile("tmp/eclipse/features/F1_1.0.0/feature.xml");//buildFolder.getFile("checkFeature.xml");
+ // IFile actualFeatureFile =
+ // buildFolder.getFile("tmp/eclipse/features/F1_1.0.0/feature.xml");//buildFolder.getFile("checkFeature.xml");
IFile actualFeatureFile = buildFolder.getFile("checkFeature.xml");
- assertTrue(Utils.extractFromZip(buildFolder, "I.TestBuild/F1-TestBuild.zip", "eclipse/features/F1_1.0.0/feature.xml", actualFeatureFile));
+ assertTrue(Utils.extractFromZip(buildFolder, "I.TestBuild/F1-TestBuild.zip",
+ "eclipse/features/F1_1.0.0/feature.xml", actualFeatureFile));
BuildTimeFeature actualFeature = factory.parseBuildFeature(actualFeatureFile.getLocationURI().toURL());
IFile licenseFeatureFile = buildFolder.getFile("features/L1/feature.xml");
@@ -409,32 +440,35 @@
assertEquals(errorMessage + "license text not equal", licenseFeature.getLicense(), actualFeature.getLicense());
assertNotNull(errorMessage + "license url was null", actualFeature.getLicenseURL());
- assertEquals(errorMessage + "license url not equal", licenseFeature.getLicenseURL(), actualFeature.getLicenseURL());
+ assertEquals(errorMessage + "license url not equal", licenseFeature.getLicenseURL(),
+ actualFeature.getLicenseURL());
assertEquals(errorMessage + "feature ID corrupted", originalFeature.getId(), actualFeature.getId());
- assertEquals(errorMessage + "feature description corrupted", originalFeature.getDescription(), actualFeature.getDescription());
- assertEquals(errorMessage + "feature copyright corrupted", originalFeature.getCopyright(), actualFeature.getCopyright());
+ assertEquals(errorMessage + "feature description corrupted", originalFeature.getDescription(),
+ actualFeature.getDescription());
+ assertEquals(errorMessage + "feature copyright corrupted", originalFeature.getCopyright(),
+ actualFeature.getCopyright());
}
private void copyFeature(IFolder buildFolder, String featureID, int state) throws CoreException {
String sourceFileName = null;
switch (state) {
- case URL_EMPTY :
- sourceFileName = "emptyLicenseURLFeature.xml";
- break;
- case URL_NON_EMPTY :
- sourceFileName = "nonEmptyLicenseURLFeature.xml";
- break;
- case URL_NONE :
- sourceFileName = "noLicenseURLFeature.xml";
- break;
- case DESC_EMPTY :
- sourceFileName = "emptyLicenseDescFeature.xml";
- break;
- case DESC_NON_EMPTY :
- sourceFileName = "nonEmptyLicenseDescFeature.xml";
- break;
+ case URL_EMPTY:
+ sourceFileName = "emptyLicenseURLFeature.xml";
+ break;
+ case URL_NON_EMPTY:
+ sourceFileName = "nonEmptyLicenseURLFeature.xml";
+ break;
+ case URL_NONE:
+ sourceFileName = "noLicenseURLFeature.xml";
+ break;
+ case DESC_EMPTY:
+ sourceFileName = "emptyLicenseDescFeature.xml";
+ break;
+ case DESC_NON_EMPTY:
+ sourceFileName = "nonEmptyLicenseDescFeature.xml";
+ break;
}
IFile source = buildFolder.getFile("features/" + featureID + "/" + sourceFileName);
@@ -445,6 +479,7 @@
source.copy(dest.getFullPath(), true, null);
}
+ @Test
public void testBug338835_MissingLicenseSection() throws Exception {
IFolder buildFolder = newTest("338835");
IFolder featureFolder = Utils.createFolder(buildFolder, "feature");
@@ -469,17 +504,25 @@
Utils.writeBuffer(licenseFolder.getFile("feature.xml"), buffer);
buffer = new StringBuffer();
- buffer.append("<project name=\"build\" basedir=\".\" > \n");
- buffer.append(" <target name=\"test\"> \n");
- buffer.append(" <eclipse.licenseReplacer featureFilePath=\"" + featureFolder.getLocation().toOSString() + "\" \n");
- buffer.append(" licenseFilePath=\"" + licenseFolder.getLocation().toOSString() + "\" /> \n");
- buffer.append(" </target> \n");
- buffer.append("</project> \n");
+ buffer.append(
+ "<project name=\"build\" basedir=\".\" > \n");
+ buffer.append(
+ " <target name=\"test\"> \n");
+ buffer.append(" <eclipse.licenseReplacer featureFilePath=\"" + featureFolder.getLocation().toOSString()
+ + "\" \n");
+ buffer.append(" licenseFilePath=\"" + licenseFolder.getLocation().toOSString()
+ + "\" /> \n");
+ buffer.append(
+ " </target> \n");
+ buffer.append(
+ "</project> \n");
IFile buildXml = buildFolder.getFile("build.xml");
Utils.writeBuffer(buildXml, buffer);
- runAntScript(buildXml.getLocation().toOSString(), new String[] {"test"}, buildFolder.getLocation().toOSString(), null);
- BuildTimeFeature feature = new BuildTimeFeatureFactory().parseBuildFeature(featureFolder.getFile("feature.xml").getLocationURI().toURL());
+ runAntScript(buildXml.getLocation().toOSString(), new String[] { "test" },
+ buildFolder.getLocation().toOSString(), null);
+ BuildTimeFeature feature = new BuildTimeFeatureFactory()
+ .parseBuildFeature(featureFolder.getFile("feature.xml").getLocationURI().toURL());
assertEquals(feature.getLicense().trim(), "This is legal stuff");
}
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java
index 16c9101..03df25f 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java
@@ -12,6 +12,8 @@
*******************************************************************************/
package org.eclipse.pde.build.internal.tests.p2;
+import static org.junit.Assert.*;
+
import java.io.File;
import java.net.URI;
import java.util.*;
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java
index ee8b5e6..e9a3865 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java
@@ -13,13 +13,14 @@
package org.eclipse.pde.build.internal.tests.p2;
+import static org.junit.Assert.*;
+
import java.io.*;
import java.net.URI;
import java.net.URL;
import java.util.*;
import java.util.jar.Attributes;
import java.util.zip.ZipOutputStream;
-import junit.framework.AssertionFailedError;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.*;
@@ -35,6 +36,7 @@
import org.eclipse.pde.build.internal.tests.Utils;
import org.eclipse.pde.build.tests.BuildConfiguration;
import org.eclipse.pde.internal.build.site.QualifierReplacer;
+import org.junit.Test;
public class P2Tests extends P2TestCase {
@@ -144,6 +146,7 @@
assertLogContainsLine(iniFile, "-foo");
}
+ @Test
public void testBug237096() throws Exception {
IFolder buildFolder = newTest("237096");
IFolder repo = Utils.createFolder(buildFolder, "repo");
@@ -188,6 +191,7 @@
assertRequires(rootIU, ius, true);
}
+ @Test
public void testBug242346() throws Exception {
IFolder buildFolder = newTest("242346");
IFile productFile = buildFolder.getFile("rcp.product");
@@ -257,6 +261,7 @@
"org.eclipse.equinox.simpleconfigurator.configUrl=file\\:org.eclipse.equinox.simpleconfigurator");
}
+ @Test
public void testBug222962_305837() throws Exception {
IFolder buildFolder = newTest("222962");
IFolder repo = Utils.createFolder(buildFolder, "repo");
@@ -304,6 +309,7 @@
assertEquals(iu.getVersion().toString(), "1.2.3.456");
}
+ @Test
public void offBug237662() throws Exception {
IFolder buildFolder = newTest("237662");
IFolder repo = Utils.createFolder(buildFolder, "repo");
@@ -343,13 +349,14 @@
// bug 270524
getIU(repository, "tooling" + p2Config + EQUINOX_PREFERENCES);
fail = true;
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
// expected
}
if (fail)
fail("Unexpected CU found");
}
+ @Test
public void testBug255518() throws Exception {
IFolder buildFolder = newTest("255518");
IFolder repo = Utils.createFolder(buildFolder, "repo");
@@ -381,6 +388,7 @@
assertJarVerifies(bundles[1]);
}
+ @Test
public void testBug258126() throws Exception {
IFolder buildFolder = newTest("258126");
@@ -424,11 +432,12 @@
try {
assertTouchpoint(iu, "configure", "addProgramArg(programArg:-vmargs);");
fail("vmargs as program arg");
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
assertEquals(e.getMessage(), "Action not found:addProgramArg(programArg:-vmargs);");
}
}
+ @Test
public void testBug262421() throws Exception {
IFolder buildFolder = newTest("262421");
@@ -460,6 +469,7 @@
assertTouchpoint(iu, "configure", "addRepository");
}
+ @Test
public void testBug265526_265524() throws Exception {
IFolder buildFolder = newTest("265526");
IFolder a = Utils.createFolder(buildFolder, "plugins/a");
@@ -520,6 +530,7 @@
assertResourceFile(outRepo2, "content.jar");
}
+ @Test
public void testBug265564() throws Exception {
IFolder buildFolder = newTest("265564");
@@ -611,6 +622,7 @@
assertEquals(md5, actualMD5);
}
+ @Test
public void testBug263272() throws Exception {
IFolder buildFolder = newTest("263272");
@@ -766,12 +778,13 @@
try {
assertLogContainsLine(buildFolder.getFile("compare.log"), "build.properties");
failed = false;
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
// expected
}
assertTrue(failed);
}
+ @Test
public void testBug263272_2() throws Exception {
IFolder buildFolder = newTest("263272_2");
@@ -872,12 +885,13 @@
try {
assertLogContainsLine(buildFolder.getFile("log.log"), "Mirroring completed with warnings and/or errors.");
warnings = true;
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
// expected
}
assertFalse(warnings);
}
+ @Test
public void testBug267461() throws Exception {
IFolder buildFolder = newTest("267461");
File executable = Utils.findExecutable();
@@ -911,6 +925,7 @@
assertTouchpoint(iu, "configure", "setProgramProperty(propName:eclipse.product,propValue:rcp.product);");
}
+ @Test
public void testBug304736() throws Exception {
IFolder buildFolder = newTest("304736");
@@ -963,6 +978,7 @@
// test passes if there was no build failure
}
+ @Test
public void testBug271373() throws Exception {
IFolder buildFolder = newTest("271373_generator");
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java
index a0b8750..66b31b6 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java
@@ -13,6 +13,8 @@
package org.eclipse.pde.build.internal.tests.p2;
+import static org.junit.Assert.*;
+
import java.io.File;
import java.io.FilenameFilter;
import java.net.URI;
@@ -21,7 +23,6 @@
import java.util.jar.Attributes;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
-import junit.framework.AssertionFailedError;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
@@ -217,7 +218,7 @@
try {
assertTouchpoint(iu, "install", "chmod(targetDir:${installFolder}, targetFile:file, permissions:755)");
fail = true;
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
}
assertFalse(fail);
@@ -279,7 +280,7 @@
try {
assertTouchpoint(iu, "zipped", "true");
hasZipped = true;
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
}
assertFalse(hasZipped);
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/PDETestCase.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/PDETestCase.java
index b3f972d..3059601 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/PDETestCase.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/tests/PDETestCase.java
@@ -13,11 +13,12 @@
package org.eclipse.pde.build.tests;
+import static org.junit.Assert.*;
+
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.util.*;
-import junit.framework.TestCase;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.helper.AntXMLContext;
import org.apache.tools.ant.helper.ProjectHelper2;
@@ -34,10 +35,11 @@
import org.eclipse.pde.internal.build.builder.BuildDirector;
import org.eclipse.pde.internal.build.site.BuildTimeSiteFactory;
import org.eclipse.pde.internal.build.site.QualifierReplacer;
+import org.junit.After;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-public abstract class PDETestCase extends TestCase {
+public abstract class PDETestCase {
public static final String PROJECT_NAME = "pde.build";
public static final String EQUINOX_COMMON = "org.eclipse.equinox.common";
public static final String SIMPLE_CONFIGURATOR = "org.eclipse.equinox.simpleconfigurator";
@@ -60,10 +62,8 @@
BuildDirector.p2Gathering = false;
}
- @Override
- protected void runTest() throws Throwable {
- super.runTest();
-
+ @After
+ public void cleanup() {
// clean up after success
if (buildFolder != null && buildFolder.exists() && !Boolean.getBoolean("pde.build.noCleanup")) {
try {
@@ -71,6 +71,7 @@
} catch (CoreException e) {
}
}
+
}
protected IProject newTest() throws Exception {