Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2013-09-18 07:39:17 -0400
committerGerrit Code Review @ Eclipse.org2013-10-17 00:01:08 -0400
commit29bab1d77c5c8997b40b66a16897497d077cc7f9 (patch)
treea7210e252a8aeac4f4153bcb1eca858650b8e159 /bundles/org.eclipse.equinox.p2.tests.discovery
parentd0fea6d8c375c9a92388d4410eff486dcaf9177c (diff)
downloadrt.equinox.p2-29bab1d77c5c8997b40b66a16897497d077cc7f9.tar.gz
rt.equinox.p2-29bab1d77c5c8997b40b66a16897497d077cc7f9.tar.xz
rt.equinox.p2-29bab1d77c5c8997b40b66a16897497d077cc7f9.zip
Bug 417458: Remote bundle discovery is broken on JDK 7u40I20131023-2000I20131022-1300I20131022-0800
Change-Id: I8112dd677bb97b3ce2bdb7880054ff15815b80c0 Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.discovery')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/TransportUtilTest.java37
2 files changed, 40 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java
index 7d925b6eb..3eb3845ac 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Tasktop Technologies and others.
+ * Copyright (c) 2009, 2013 Tasktop Technologies 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
@@ -14,6 +14,7 @@ package org.eclipse.equinox.p2.discovery.tests;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.equinox.p2.discovery.tests.core.*;
+import org.eclipse.equinox.p2.discovery.tests.core.util.TransportUtilTest;
/**
* @author Steffen Pingel
@@ -27,6 +28,7 @@ public class AllDiscoveryTests {
suite.addTestSuite(BundleDiscoveryStrategyTest.class);
//suite.addTestSuite(RemoteBundleDiscoveryStrategyTest.class);
//suite.addTestSuite(ConnectorDiscoveryRemoteTest.class);
+ suite.addTestSuite(TransportUtilTest.class);
return suite;
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/TransportUtilTest.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/TransportUtilTest.java
new file mode 100644
index 000000000..725581720
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/util/TransportUtilTest.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.discovery.tests.core.util;
+
+import junit.framework.TestCase;
+import org.eclipse.equinox.internal.p2.discovery.compatibility.util.TransportUtil;
+
+public class TransportUtilTest extends TestCase {
+
+ public void testGetFileNameForJar() throws Exception {
+ assertEquals("lib_1.0.jar", TransportUtil.getFileNameFor("lib-1.0.jar")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void testGetFileNameForUrl() throws Exception {
+ assertEquals("lib_1.0.jar", TransportUtil.getFileNameFor("http://www.eclipse.org/downloads/download.php?file=/discovery/lib-1.0.jar")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void testGetFileNameForUrlWithQuery() throws Exception {
+ assertEquals("lib_1.0.jar_r_1_protocol_http", TransportUtil.getFileNameFor("http://www.eclipse.org/downloads/download.php?file=/discovery/lib-1.0.jar&r=1&protocol=http")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void testGetFileNameForUrlEndingWithSlash() throws Exception {
+ assertEquals("a.jar", TransportUtil.getFileNameFor("a.jar/")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void testGetFileNameForUrlWithFilesystemReservedCharacters() throws Exception {
+ assertEquals("1_2_3_4_5_6_7_8_9_", TransportUtil.getFileNameFor("1<2>3:4\"5\\6|7?8*9+")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+} \ No newline at end of file

Back to the top