diff options
author | Alexander Kurtakov | 2019-05-17 07:04:32 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2019-05-17 07:04:32 +0000 |
commit | b17e03bfe6e72a190c8d42f21a6d9616351b1f99 (patch) | |
tree | 95a2bc5276384995e46e328abf141568769a5e19 | |
parent | 0dd293eae66e10ee951031a3c5f78dc658b8114c (diff) | |
download | rt.equinox.p2-b17e03bfe6e72a190c8d42f21a6d9616351b1f99.tar.gz rt.equinox.p2-b17e03bfe6e72a190c8d42f21a6d9616351b1f99.tar.xz rt.equinox.p2-b17e03bfe6e72a190c8d42f21a6d9616351b1f99.zip |
Bug 545718 - Update prereqs for 4.12 release: ECFS4_12_0_RC1aS4_12_0_RC1S4_12_0_M3I20190531-0245I20190529-2005I20190529-1800I20190529-0600I20190528-1800I20190528-0915I20190528-0850I20190528-0600I20190527-1805I20190527-0600I20190526-1800I20190526-0600I20190525-1800I20190525-0600I20190524-1800I20190524-0135I20190522-1800I20190522-0600I20190521-1800I20190521-0600I20190520-1805I20190520-0600I20190519-1800I20190518-1800I20190517-1800
Fix transfer test to refer to the new bundle.
Simplify catch clauses.
Use StringBuilder.
Use foreach.
Use 4.11 jsp bundle to download as 3.4 is ancient one and it's better to
test latest one both for the sanity of the test and for network cache
reasons.
Change-Id: I21eee10fc13616b1e29a50d2bd14b3989d7bf5b0
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r-- | bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java | 33 |
1 files changed, 19 insertions, 14 deletions
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 index 1646bcfea..6af6b822c 100644 --- 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 IBM Corporation and others. + * Copyright (c) 2009, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -7,15 +7,22 @@ * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.equinox.p2.tests.artifact.repository; -import java.io.*; -import java.net.*; -import org.eclipse.core.runtime.*; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Platform; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; import org.osgi.framework.Bundle; import org.osgi.framework.BundleException; @@ -34,7 +41,7 @@ public class TransferTest extends AbstractProvisioningTest { } catch (BundleException e) { fail("1.5", e); } - final URI toDownload = new URI("http://download.eclipse.org/eclipse/updates/3.4/plugins/javax.servlet.jsp_2.0.0.v200806031607.jar.pack.gz"); + final URI toDownload = new URI("http://download.eclipse.org/eclipse/updates/4.11/R-4.11-201903070500/plugins/javax.servlet.jsp_2.2.0.v201112011158.jar.pack.gz"); IStatus s = getTransport().download(toDownload, fos, new NullProgressMonitor()); assertOK("2.0", s); int httpSize = -1; @@ -43,21 +50,19 @@ public class TransferTest extends AbstractProvisioningTest { u = toDownload.toURL(); HttpURLConnection c = (HttpURLConnection) u.openConnection(); httpSize = c.getContentLength(); - } catch (MalformedURLException e1) { - httpSize = -1; - } catch (IOException e) { + } catch (IOException e1) { httpSize = -1; } try { fos.close(); if (f != null) { - String[] ecfPlugins = new String[] {"org.eclipse.ecf", "org.eclipse.ecf.identity", "org.eclipse.ecf.filetransfer", "org.eclipse.ecf.provider.filetransfer", "org.eclipse.ecf.provider.filetransfer.httpclient4"}; - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < ecfPlugins.length; i++) { - Bundle bundle = Platform.getBundle(ecfPlugins[i]); + String[] ecfPlugins = new String[] {"org.eclipse.ecf", "org.eclipse.ecf.identity", "org.eclipse.ecf.filetransfer", "org.eclipse.ecf.provider.filetransfer", "org.eclipse.ecf.provider.filetransfer.httpclient45"}; + StringBuilder buffer = new StringBuilder(); + for (String ecfPlugin : ecfPlugins) { + Bundle bundle = Platform.getBundle(ecfPlugin); buffer.append(bundle.getSymbolicName()).append('-').append(bundle.getVersion()).append('\n'); } - assertTrue("4.0 - length found: " + f.length() + " using ECF bundles: " + buffer.toString(), f.length() < 50000); + assertTrue("4.0 - length found: " + f.length() + " using ECF bundles: " + buffer.toString(), f.length() < 60000); assertTrue("5.0", httpSize == -1 ? true : (httpSize == f.length())); } } catch (IOException e) { |