Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2009-01-13 02:09:13 +0000
committerPascal Rapicault2009-01-13 02:09:13 +0000
commitbf5c15d8fedda179257c426d5de131017927a792 (patch)
tree68bc9afd2ca2c08426ebd7fffdf0c8ad03934162
parentbeb875612e4718ffe00dbb80d4d950bacc7dcd33 (diff)
downloadrt.equinox.p2-bf5c15d8fedda179257c426d5de131017927a792.tar.gz
rt.equinox.p2-bf5c15d8fedda179257c426d5de131017927a792.tar.xz
rt.equinox.p2-bf5c15d8fedda179257c426d5de131017927a792.zip
Bug 260456 - Consume ECF 2.1R34x_v20090114
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/AllTests.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java36
3 files changed, 39 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF
index f7eeb603e..5da37e26c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF
@@ -52,7 +52,8 @@ Bundle-ClassPath: .
Require-Bundle: org.eclipse.equinox.p2.metadata.generator,
org.eclipse.equinox.frameworkadmin,
org.eclipse.equinox.common,
- org.junit
+ org.junit,
+ org.eclipse.core.runtime;bundle-version="3.4.0"
Bundle-ActivationPolicy: lazy
Eclipse-RegisterBuddy: org.eclipse.equinox.p2.artifact.repository
Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/AllTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/AllTests.java
index c927ec4a3..68e2353c4 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/AllTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/AllTests.java
@@ -20,6 +20,7 @@ public class AllTests extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite(AllTests.class.getName());
suite.addTestSuite(ArtifactOutputStreamTest.class);
+ suite.addTestSuite(TransferTest.class);
// DISABLING TEST UNTIL WE UPDATE REPOSITORY FILES
//suite.addTestSuite(JarURLRepositoryTest.class);
suite.addTestSuite(FoldersRepositoryTest.class);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java
new file mode 100644
index 000000000..0a8aa1a89
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java
@@ -0,0 +1,36 @@
+package org.eclipse.equinox.p2.tests.artifact.repository;
+
+import java.io.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.internal.p2.artifact.repository.ECFTransport;
+import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
+import org.osgi.framework.BundleException;
+
+public class TransferTest extends AbstractProvisioningTest {
+
+ public void testGZFileAreNotUnzipped() {
+ FileOutputStream fos = null;
+ File f = null;
+ try {
+ f = File.createTempFile("TransferTest", "pack.gz");
+ fos = new FileOutputStream(f);
+ System.out.println(f);
+ Platform.getBundle("org.eclipse.ecf.provider.filetransfer").start();
+ } catch (IOException e) {
+ fail("1.0", e);
+ } catch (BundleException e) {
+ fail("1.5", e);
+ }
+ IStatus s = ECFTransport.getInstance().download("http://download.eclipse.org/eclipse/updates/3.5-I-builds/plugins/javax.servlet.jsp_2.0.0.v200806031607.jar.pack.gz", fos, new NullProgressMonitor());
+ assertOK("2.0", s);
+ try {
+ fos.close();
+ if (f != null) {
+ System.out.println(f.length());
+ assertTrue("4.0", f.length() < 50000);
+ }
+ } catch (IOException e) {
+ fail("5.0", e);
+ }
+ }
+}

Back to the top