Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (Ericsson)2012-11-27 10:41:54 -0500
committerPascal Rapicault2012-11-27 11:10:11 -0500
commit5f1e6d32abe31758d61924ab19d05dc78c8ef947 (patch)
tree929c005731d6f3b90cb604161a3b00ec78b19f8e /bundles/org.eclipse.equinox.p2.tests.ui
parentef6f9ae88e4a192e9f53f017db0e8a697b438e19 (diff)
downloadrt.equinox.p2-5f1e6d32abe31758d61924ab19d05dc78c8ef947.tar.gz
rt.equinox.p2-5f1e6d32abe31758d61924ab19d05dc78c8ef947.tar.xz
rt.equinox.p2-5f1e6d32abe31758d61924ab19d05dc78c8ef947.zip
Bug 387115 - [import/export] Enable "Import->Install->Install Software Items from File" without explicit locationsv20121127-161011
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.ui')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/ImportExportRemoteTests.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/ImportExportTests.java30
2 files changed, 41 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/ImportExportRemoteTests.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/ImportExportRemoteTests.java
index 616116f97..bc3401e88 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/ImportExportRemoteTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/ImportExportRemoteTests.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
package org.eclipse.equinox.p2.tests.importexport;
import java.io.*;
@@ -55,7 +65,7 @@ public class ImportExportRemoteTests extends ServerBasedTestCase {
assertNotNull("Fail to load remote repo", repo);
IInstallableUnit iu = AbstractProvisioningTest.createIU("A", Version.create("1.0.0"));
OutputStream output = new FileOutputStream(testFile);
- IStatus status = importexportService.exportP2F(output, new IInstallableUnit[] {iu}, null);
+ IStatus status = importexportService.exportP2F(output, new IInstallableUnit[] {iu}, false, null);
assertTrue("Not expected return result.", status.isOK());
output.close();
InputStream input = new FileInputStream(testFile);
@@ -101,7 +111,7 @@ public class ImportExportRemoteTests extends ServerBasedTestCase {
assertNotNull("Fail to load remote repo", repo);
IInstallableUnit iu = AbstractProvisioningTest.createIU("A", Version.create("1.0.0"));
OutputStream output = new FileOutputStream(testFile);
- IStatus status = importexportService.exportP2F(output, new IInstallableUnit[] {iu}, null);
+ IStatus status = importexportService.exportP2F(output, new IInstallableUnit[] {iu}, false, null);
assertTrue("Not expected return result.", status.isOK());
output.close();
InputStream input = new FileInputStream(testFile);
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/ImportExportTests.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/ImportExportTests.java
index b6ae1a5fb..12f4c3b16 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/ImportExportTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/ImportExportTests.java
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * WindRiver Corporation - initial API and implementation
+ * Ericsson AB (Pascal Rapicault) - Bug 387115 - Allow to export everything
+ *******************************************************************************/
package org.eclipse.equinox.p2.tests.importexport;
import java.io.*;
@@ -102,7 +113,7 @@ public class ImportExportTests extends AbstractProvisioningTest {
assertNotNull("Fail to load local repo", repo);
IInstallableUnit iu = createIU("A", Version.create("1.0.0"));
OutputStream output = new FileOutputStream(testFile);
- IStatus status = importexportService.exportP2F(output, new IInstallableUnit[] {iu}, null);
+ IStatus status = importexportService.exportP2F(output, new IInstallableUnit[] {iu}, false, null);
assertFalse("Not expected return result.", status.isOK());
assertTrue("Should be a multiple status", status.isMultiStatus());
boolean hasFeaturesIgnored = false;
@@ -115,4 +126,21 @@ public class ImportExportTests extends AbstractProvisioningTest {
testFile.delete();
}
}
+
+ public void testAllowExportFeaturesInstalledFromLocal() throws ProvisionException, OperationCanceledException, IOException {
+ File testFile = File.createTempFile("test", "p2f");
+ try {
+ IMetadataRepositoryManager metaManager = (IMetadataRepositoryManager) getAgent().getService(IMetadataRepositoryManager.SERVICE_NAME);
+ File localRepoFile = getTestData("Error load data", "testData/importexport/repo1");
+ IMetadataRepository repo = metaManager.loadRepository(localRepoFile.toURI(), null);
+ assertNotNull("Fail to load local repo", repo);
+ IInstallableUnit iu = createIU("A", Version.create("1.0.0"));
+ OutputStream output = new FileOutputStream(testFile);
+ IStatus status = importexportService.exportP2F(output, new IInstallableUnit[] {iu}, true, null);
+ assertTrue(status.isOK());
+ output.close();
+ } finally {
+ testFile.delete();
+ }
+ }
}

Back to the top