Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMat Booth2018-10-22 12:01:02 +0000
committerAlexander Kurtakov2018-10-24 10:11:28 +0000
commit6ee06cff70e4c8db9b2d3c07d7a780487c9cdb89 (patch)
tree1e1116a8524a518f0718bf40b874c297a12499aa
parent6062b27722644e0b391dc27fbd3a8debca87293b (diff)
downloadrt.equinox.p2-6ee06cff70e4c8db9b2d3c07d7a780487c9cdb89.tar.gz
rt.equinox.p2-6ee06cff70e4c8db9b2d3c07d7a780487c9cdb89.tar.xz
rt.equinox.p2-6ee06cff70e4c8db9b2d3c07d7a780487c9cdb89.zip
Bug 540363 - An error in the p2 test suite
Have SimpleConfiguratorUtilsExtendedTest extend the correct class and remove a superfluous test added to the wrong test class. The removed test is completely duplicated by "testExtensionAdded" in the SimpleConfiguratorTestExtendedConfigured class. Change-Id: I0f416d865ccadcae0eeb093f8e4375604b9d055d Signed-off-by: Mat Booth <mat.booth@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsExtendedConfiguredTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsExtendedTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java23
3 files changed, 22 insertions, 15 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsExtendedConfiguredTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsExtendedConfiguredTest.java
index c60a2b089..cac1cecb0 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsExtendedConfiguredTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsExtendedConfiguredTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2017 IBM Corporation and others.
+ * Copyright (c) 2008, 2018 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -129,14 +129,6 @@ public class SimpleConfiguratorUtilsExtendedConfiguredTest extends SimpleConfigu
}
}
- //on adding extension master must be selected in order to create new profile with extensions!
- @Override
- public void testSharedConfigurationMasterUnmodified() throws IOException {
- storeTimestamp(new File(masterConfguration, relativeURL.getFile()).lastModified());
- assertEquals(sharedConfiguration[1], configurator.chooseConfigurationURL(relativeURL, sharedConfiguration));
- assertIsPropertySet(true);
- }
-
private BundleInfo getBundle(String name, List<BundleInfo> list) {
for (BundleInfo info : list) {
if (info.getSymbolicName().equals(name)) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsExtendedTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsExtendedTest.java
index be4f8138d..13e57ddad 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsExtendedTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsExtendedTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2018 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,7 +16,7 @@ package org.eclipse.equinox.p2.tests.simpleconfigurator;
import org.eclipse.equinox.internal.simpleconfigurator.Activator;
-public class SimpleConfiguratorUtilsExtendedTest extends SimpleConfiguratorTest {
+public class SimpleConfiguratorUtilsExtendedTest extends SimpleConfiguratorUtilsTest {
@Override
public void setUp() throws Exception {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java
index 88aa1cf19..abeb6f58c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/SimpleConfiguratorUtilsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 2018 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -15,8 +15,11 @@ package org.eclipse.equinox.p2.tests.simpleconfigurator;
import java.io.File;
import java.io.IOException;
-import java.net.*;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.util.List;
+import org.eclipse.equinox.internal.simpleconfigurator.Activator;
import org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo;
import org.eclipse.equinox.internal.simpleconfigurator.utils.SimpleConfiguratorUtils;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -162,7 +165,13 @@ public class SimpleConfiguratorUtilsTest extends AbstractProvisioningTest {
URI baseURI = baseFile.toURI();
try {
List<BundleInfo> infos = SimpleConfiguratorUtils.readConfiguration(data.toURL(), baseURI);
- assertEquals("1.1", 2, infos.size());
+ if (Activator.EXTENSIONS == null) {
+ // base bundles only
+ assertEquals("1.1", 2, infos.size());
+ } else {
+ // including bundles from configured extensions
+ assertEquals("1.1", 6, infos.size());
+ }
BundleInfo a = new BundleInfo("a", "1.0.0", new URI("plugins/a_1.0.0.jar"), 4, false);
a.setBaseLocation(baseURI);
@@ -198,7 +207,13 @@ public class SimpleConfiguratorUtilsTest extends AbstractProvisioningTest {
File bundleInfoFile = new File(getTempFolder(), "bundle.info");
assertFalse(bundleInfoFile.exists());
try {
- assertEquals(0, SimpleConfiguratorUtils.readConfiguration(bundleInfoFile.toURL(), null).size());
+ if (Activator.EXTENSIONS == null) {
+ // base bundles only
+ assertEquals(0, SimpleConfiguratorUtils.readConfiguration(bundleInfoFile.toURL(), null).size());
+ } else {
+ // including bundles from configured extensions
+ assertEquals(4, SimpleConfiguratorUtils.readConfiguration(bundleInfoFile.toURL(), null).size());
+ }
} catch (IOException e) {
fail();
}

Back to the top