Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2009-02-26 23:07:25 +0000
committerSusan Franklin2009-02-26 23:07:25 +0000
commitc9c77e8a3919d363425dc36ad5ec1fc5bbd5c1d6 (patch)
treeb6ca937fbac306fc29e0e1be560f16d928043c34 /bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/repohandling
parent236f4495923ca88944e8ec7203374e93c0fc347c (diff)
downloadrt.equinox.p2-c9c77e8a3919d363425dc36ad5ec1fc5bbd5c1d6.tar.gz
rt.equinox.p2-c9c77e8a3919d363425dc36ad5ec1fc5bbd5c1d6.tar.xz
rt.equinox.p2-c9c77e8a3919d363425dc36ad5ec1fc5bbd5c1d6.zip
Bug 194224 - [ui] User nicknames for repositories
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/repohandling')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/repohandling/AllTests.java25
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/repohandling/SiteImportExportTest.java37
2 files changed, 62 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/repohandling/AllTests.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/repohandling/AllTests.java
new file mode 100644
index 000000000..3bfeca52b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/repohandling/AllTests.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.tests.ui.repohandling;
+
+import junit.framework.*;
+
+/**
+ * Performs all UI action tests.
+ */
+public class AllTests extends TestCase {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(AllTests.class.getName());
+ suite.addTestSuite(SiteImportExportTest.class);
+ return suite;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/repohandling/SiteImportExportTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/repohandling/SiteImportExportTest.java
new file mode 100644
index 000000000..48c8c6c76
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/repohandling/SiteImportExportTest.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.tests.ui.repohandling;
+
+import java.io.File;
+import org.eclipse.equinox.internal.p2.ui.model.MetadataRepositoryElement;
+import org.eclipse.equinox.internal.provisional.p2.ui.UpdateManagerCompatibility;
+import org.eclipse.equinox.p2.tests.ui.AbstractProvisioningUITest;
+
+public class SiteImportExportTest extends AbstractProvisioningUITest {
+ public void testUpdateManagerImport() {
+ int siteCount;
+ File bookmarks = getTestData("Getting site bookmarks", "/testData/siteBookmarks/siteexport33.xml/");
+ MetadataRepositoryElement[] elements = UpdateManagerCompatibility.readBookmarkFile(bookmarks);
+ siteCount = elements.length;
+ assertNotNull("1.0", elements);
+ assertTrue("1.1", siteCount > 0);
+ MetadataRepositoryElement element = elements[0];
+ element.setNickname("Foo");
+
+ File folder = getTempFolder();
+ File testExport = new File(folder, "testExport.xml");
+ UpdateManagerCompatibility.writeBookmarkFile(testExport.getAbsolutePath(), elements);
+
+ elements = UpdateManagerCompatibility.readBookmarkFile(testExport);
+ assertEquals("1.2", siteCount, elements.length);
+ assertEquals("1.3", elements[0].getName(), "Foo");
+ }
+}

Back to the top