summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Daniel2013-10-23 15:02:25 (EDT)
committerKrzysztof Daniel2013-11-07 02:44:07 (EST)
commitce36d97d65c3ffea221d8c72c4e8fb398eb77788 (patch)
tree2d71d51c7f8e9b1f19959c9798e105fb77ce6348
parent8c9187a7cdfca9ae0c93566c5f383a6c7e6137bf (diff)
downloadrt.equinox.p2-ce36d97d65c3ffea221d8c72c4e8fb398eb77788.zip
rt.equinox.p2-ce36d97d65c3ffea221d8c72c4e8fb398eb77788.tar.gz
rt.equinox.p2-ce36d97d65c3ffea221d8c72c4e8fb398eb77788.tar.bz2
Bug 419419: test233240_artifactsDeleted fails when invoked with maven surefirerefs/changes/00/17700/3
Tycho surefire uses maven convention for bundles that constitute test environment, so every plugin has "-" instead of "_". This doesn't work for P2 test, because P2 generator generates bundles with "_". So, the test case has to explicitly use that character in bundle name. Change-Id: I1c01b979de2f5527d6f813272ecf27406a9813f2 Signed-off-by: Krzysztof Daniel <kdaniel@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java
index 88897c5..3e59bc0 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/GeneratorTests.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.generator;
+import org.osgi.framework.Bundle;
+
import java.io.File;
import java.io.PrintStream;
import java.util.Map;
@@ -84,18 +86,20 @@ public class GeneratorTests extends AbstractProvisioningTest {
int limit = 3;
for (int i = 0; i < limit; i++) {
BundleContext context = TestActivator.getContext();
- File bundle = FileLocator.getBundleFile(context.getBundle(i));
- if (!bundle.isFile()) {
+ Bundle bundle = context.getBundle(i);
+ File bundleFile = FileLocator.getBundleFile(bundle);
+ if (!bundleFile.isFile()) {
//only jars please
++limit;
continue;
}
- copy("1.0 Populating input bundles.", bundle, new File(plugins, bundle.getName()));
+ // tycho surefire uses rather "-" instead of "_" (maven convention). PDE uses "_". We need to be P2 compatible.
+ copy("1.0 Populating input bundles.", bundleFile, new File(plugins, bundle.getSymbolicName() + "_" + bundle.getVersion() + ".jar" ));
}
String[] arguments = new String[] {"-metadataRepository", rootFolder.toURL().toExternalForm().toString(), "-artifactRepository", rootFolder.toURL().toExternalForm().toString(), "-source", rootFolder.getAbsolutePath(), "-publishArtifacts", "-noDefaultIUs"};
TestGeneratorApplication application = new TestGeneratorApplication();
- application.go(arguments);
+ assertEquals(0, application.go(arguments));
assertTrue("2.0 - initial artifact repo existance", new File(rootFolder, "artifacts.xml").exists());
assertTrue("2.1 - initial artifact repo contents", plugins.listFiles().length > 0);
@@ -116,12 +120,12 @@ public class GeneratorTests extends AbstractProvisioningTest {
//with -updateSite
arguments = new String[] {"-metadataRepository", rootFolder.toURL().toExternalForm().toString(), "-artifactRepository", rootFolder.toURL().toExternalForm().toString(), "-updateSite", rootFolder.getAbsolutePath(), "-publishArtifacts", "-noDefaultIUs"};
- application.go(arguments);
+ assertEquals(0, application.go(arguments));
assertTrue("4.0 - artifact repo existance", new File(rootFolder, "artifacts.xml").exists());
assertTrue("4.1 - artifact repo contents", plugins.listFiles().length > 0);
- assertEquals(new File(rootFolder, "plugins").list().length, 3);
+ assertEquals(3, new File(rootFolder, "plugins").list().length);
delete(rootFolder);
}