Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug252308.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CorruptedJar.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/LocationTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferExceptionsTest.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/ResumeDownloadTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileInfoReaderTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileReaderTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/TimeoutTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java54
14 files changed, 85 insertions, 64 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
index deccc2bc2..74f4c09fb 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
@@ -23,6 +23,7 @@ import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.p2.metadata.InstallableUnit;
import org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager;
+import org.eclipse.equinox.internal.p2.repository.Transport;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
import org.eclipse.equinox.internal.provisional.p2.director.IDirector;
import org.eclipse.equinox.p2.core.*;
@@ -856,6 +857,10 @@ public abstract class AbstractProvisioningTest extends TestCase {
return (IProfileRegistry) getAgent().getService(IProfileRegistry.SERVICE_NAME);
}
+ protected Transport getTransport() {
+ return (Transport) getAgent().getService(Transport.SERVICE_NAME);
+ }
+
protected IMetadataRepository createMetadataRepository(URI location, Map properties) throws ProvisionException {
IMetadataRepositoryManager metadataRepositoryManager = getMetadataRepositoryManager();
IMetadataRepository repo = metadataRepositoryManager.createRepository(location, "metadata", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java
index 0d2cd95f1..f00cd1e2e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java
@@ -18,6 +18,7 @@ import java.util.*;
import junit.framework.Assert;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRequest;
+import org.eclipse.equinox.internal.p2.repository.AuthenticationFailedException;
import org.eclipse.equinox.internal.p2.repository.Transport;
import org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler;
@@ -69,6 +70,21 @@ public class TestArtifactRepository extends AbstractArtifactRepository {
}
return Status.OK_STATUS;
}
+
+ @Override
+ public IStatus download(URI toDownload, OutputStream target, long startPos, IProgressMonitor monitor) {
+ throw new IllegalStateException("Method should not be called");
+ }
+
+ @Override
+ public InputStream stream(URI toDownload, IProgressMonitor monitor) throws FileNotFoundException, CoreException, AuthenticationFailedException {
+ throw new IllegalStateException("Method should not be called");
+ }
+
+ @Override
+ public long getLastModified(URI toDownload, IProgressMonitor monitor) throws CoreException, FileNotFoundException, AuthenticationFailedException {
+ throw new IllegalStateException("Method should not be called");
+ }
};
public TestArtifactRepository(IProvisioningAgent agent, URI location) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug252308.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug252308.java
index dbafd27d7..4158ed7a3 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug252308.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug252308.java
@@ -127,7 +127,7 @@ public class Bug252308 extends AbstractProvisioningTest {
targetDescriptor.setRepositoryProperty("artifact.folder", "true");
class TestRequest extends MirrorRequest {
public TestRequest(IArtifactKey key, IArtifactRepository targetRepository, Map<String, String> targetDescriptorProperties, Map<String, String> targetRepositoryProperties) {
- super(key, targetRepository, targetDescriptorProperties, targetRepositoryProperties);
+ super(key, targetRepository, targetDescriptorProperties, targetRepositoryProperties, getTransport());
}
public void setSource(IArtifactRepository source) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java
index dd143b22b..30018d278 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java
@@ -21,6 +21,7 @@ import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifact
import org.eclipse.equinox.internal.p2.core.helpers.OrderedProperties;
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState;
+import org.eclipse.equinox.internal.p2.repository.Transport;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.internal.repository.comparator.MD5ArtifactComparator;
import org.eclipse.equinox.p2.internal.repository.tools.ArtifactRepositoryValidator;
@@ -1028,7 +1029,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
source.addChild(child.getLocation());
// Create mirror request
- MirrorRequest request = new MirrorRequest(descriptor.getArtifactKey(), destination, null, null);
+ MirrorRequest request = new MirrorRequest(descriptor.getArtifactKey(), destination, null, null, (Transport) getAgent().getService(Transport.SERVICE_NAME));
request.perform(source, new NullProgressMonitor());
IStatus status = request.getResult();
// The download should have completed 'successfully'
@@ -1115,7 +1116,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
dest = new BadSite(new URI("memory:/in/memory/dest"));
// Create mirror request
- MirrorRequest request = new MirrorRequest(descriptor.getArtifactKey(), dest, null, null);
+ MirrorRequest request = new MirrorRequest(descriptor.getArtifactKey(), dest, null, null, getTransport());
request.perform(source, new NullProgressMonitor());
IStatus status = request.getResult();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CorruptedJar.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CorruptedJar.java
index f026990b9..35fb85a34 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CorruptedJar.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CorruptedJar.java
@@ -47,7 +47,7 @@ public class CorruptedJar extends AbstractProvisioningTest {
ctx.setArtifactRepositories(new URI[] {getTestData("CorruptedJar repo", testDataLocation).toURI()});
DownloadManager mgr = new DownloadManager(ctx, getAgent());
IArtifactKey key = (IArtifactKey) source.query(ArtifactKeyQuery.ALL_KEYS, null).iterator().next();
- mgr.add(new MirrorRequest(key, target, null, null));
+ mgr.add(new MirrorRequest(key, target, null, null, getTransport()));
IStatus s = mgr.start(new NullProgressMonitor());
assertNotOK(s);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/LocationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/LocationTest.java
index bf42d4204..0fd31ed55 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/LocationTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/LocationTest.java
@@ -39,7 +39,7 @@ public class LocationTest extends AbstractProvisioningTest {
public void testLocation() throws Exception {
IArtifactKey key = new ArtifactKey("osgi.bundle", "org.springframework.ide.eclipse", Version.parseVersion("2.3.2.201003220227-RELEASE"));
assertTrue(sourceRepository.contains(key));
- MirrorRequest req = new MirrorRequest(key, targetRepository, null, null);
+ MirrorRequest req = new MirrorRequest(key, targetRepository, null, null, getTransport());
req.perform(sourceRepository, new NullProgressMonitor());
IStatus status = req.getResult();
assertTrue(status.getMessage(), status.isOK());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java
index 2f4521676..f26ad6cb2 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java
@@ -22,6 +22,7 @@ import org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest;
import org.eclipse.equinox.internal.p2.artifact.repository.MirrorSelector;
import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository;
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
+import org.eclipse.equinox.internal.p2.repository.Transport;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.Version;
@@ -68,7 +69,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
IArtifactKey key = new ArtifactKey("org.eclipse.update.feature", "HelloWorldFeature", Version.createOSGi(1, 0, 0));
Map<String, String> targetProperties = new HashMap<String, String>();
targetProperties.put("artifact.folder", "true");
- MirrorRequest request = new MirrorRequest(key, targetRepository, null, targetProperties);
+ MirrorRequest request = new MirrorRequest(key, targetRepository, null, targetProperties, (Transport) getAgent().getService(Transport.SERVICE_NAME));
request.perform(sourceRepository, new NullProgressMonitor());
assertTrue(request.getResult().matches(IStatus.ERROR));
@@ -79,7 +80,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
IArtifactKey key = new ArtifactKey("org.eclipse.update.feature", "Missing", Version.createOSGi(1, 0, 0));
Map<String, String> targetProperties = new HashMap<String, String>();
targetProperties.put("artifact.folder", "true");
- MirrorRequest request = new MirrorRequest(key, targetRepository, null, targetProperties);
+ MirrorRequest request = new MirrorRequest(key, targetRepository, null, targetProperties, getTransport());
request.perform(sourceRepository, new NullProgressMonitor());
assertTrue(request.getResult().matches(IStatus.ERROR));
@@ -90,7 +91,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
RemoteRepo src = new RemoteRepo((SimpleArtifactRepository) sourceRepository);
IArtifactKey key = new ArtifactKey("test.txt", "fail_to_canonical", Version.parseVersion("1.0.0"));
- MirrorRequest request = new MirrorRequest(key, targetRepository, null, null);
+ MirrorRequest request = new MirrorRequest(key, targetRepository, null, null, getTransport());
request.perform(src, new NullProgressMonitor());
assertTrue(request.getResult().toString(), request.getResult().isOK());
@@ -104,7 +105,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
// call test
IArtifactKey key = new ArtifactKey("test.txt", "HelloWorldText", Version.parseVersion("1.0.0"));
- MirrorRequest request = new MirrorRequest(key, targetRepository, null, null);
+ MirrorRequest request = new MirrorRequest(key, targetRepository, null, null, getTransport());
request.perform(sourceRepository, new NullProgressMonitor());
// The download succeeded
@@ -132,7 +133,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
assertTrue("Unable to obtain artifact keys", keys != null && !keys.isEmpty());
IArtifactKey key = (IArtifactKey) keys.iterator().next();
- MirrorRequest req = new MirrorRequest(key, targetRepository, null, null);
+ MirrorRequest req = new MirrorRequest(key, targetRepository, null, null, getTransport());
// Set Status sequence
seq.add(new Status(IStatus.ERROR, "Activator", "Message"));
@@ -144,7 +145,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
// Remove key from repo so the same one can be used
targetRepository.removeDescriptor(key);
// Set Status sequence
- req = new MirrorRequest(key, targetRepository, null, null);
+ req = new MirrorRequest(key, targetRepository, null, null, getTransport());
seq.add(new Status(IStatus.WARNING, "Activator", "Message"));
seq.add(new Status(IStatus.INFO, "Activator", "Message"));
@@ -155,7 +156,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
// Remove key from repo so the same one can be used
targetRepository.removeDescriptor(key);
// Set Status sequence
- req = new MirrorRequest(key, targetRepository, null, null);
+ req = new MirrorRequest(key, targetRepository, null, null, getTransport());
seq.add(new Status(IStatus.INFO, "Activator", "Message"));
req.perform(source, new NullProgressMonitor());
@@ -182,7 +183,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
IArtifactRepository target = getArtifactRepositoryManager().createRepository(destination, "Destination", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
IArtifactKey key = new ArtifactKey("osgi.bundle", "org.eclipse.ve.jfc", Version.parseVersion("1.4.0.HEAD"));
- MirrorRequest req = new MirrorRequest(key, target, null, null);
+ MirrorRequest req = new MirrorRequest(key, target, null, null, getTransport());
req.perform(source, new NullProgressMonitor());
IStatus result = req.getResult();
@@ -314,7 +315,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
IArtifactRepository repo;
OrderedMirrorSelector(IArtifactRepository repo) {
- super(repo);
+ super(repo, getTransport());
this.repo = repo;
// Setting this property forces SimpleArtifactRepository to use mirrors despite being a local repo
// Alternatively we could use reflect to change "location" of the repo
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferExceptionsTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferExceptionsTest.java
index 777a3a576..270dda1b3 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferExceptionsTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferExceptionsTest.java
@@ -14,7 +14,6 @@ import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.p2.repository.RepositoryTransport;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.osgi.framework.BundleException;
@@ -37,25 +36,25 @@ public class TransferExceptionsTest extends AbstractProvisioningTest {
fail("1.5", e);
}
try {
- IStatus s = RepositoryTransport.getInstance().download(new URI("bogus!bogus"), fos, new NullProgressMonitor());
+ IStatus s = getTransport().download(new URI("bogus!bogus"), fos, new NullProgressMonitor());
assertNotOK(s);
printStatus("1", s);
- s = RepositoryTransport.getInstance().download(new URI("bogus://somewhere.else"), fos, new NullProgressMonitor());
+ s = getTransport().download(new URI("bogus://somewhere.else"), fos, new NullProgressMonitor());
assertNotOK(s);
printStatus("2", s);
- s = RepositoryTransport.getInstance().download(new URI("http:bogusURL"), fos, new NullProgressMonitor());
+ s = getTransport().download(new URI("http:bogusURL"), fos, new NullProgressMonitor());
assertNotOK(s);
printStatus("3", s);
- s = RepositoryTransport.getInstance().download(new URI("http://bogusURL:80/"), fos, new NullProgressMonitor());
+ s = getTransport().download(new URI("http://bogusURL:80/"), fos, new NullProgressMonitor());
assertNotOK(s);
printStatus("4", s);
- s = RepositoryTransport.getInstance().download(new URI("http:/bogusURL:999999999999/"), fos, new NullProgressMonitor());
+ s = getTransport().download(new URI("http:/bogusURL:999999999999/"), fos, new NullProgressMonitor());
assertNotOK(s);
printStatus("5", s);
- s = RepositoryTransport.getInstance().download(new URI("http://bogus.nowhere"), fos, new NullProgressMonitor());
+ s = getTransport().download(new URI("http://bogus.nowhere"), fos, new NullProgressMonitor());
assertNotOK(s);
printStatus("6", s);
- s = RepositoryTransport.getInstance().download(new URI("http://www.eclipse.org/AFileThatDoesNotExist.foo"), fos, new NullProgressMonitor());
+ s = getTransport().download(new URI("http://www.eclipse.org/AFileThatDoesNotExist.foo"), fos, new NullProgressMonitor());
assertNotOK(s);
printStatus("7", s);
} catch (URISyntaxException e) {
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 6c3983a9f..4b62c8a99 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
@@ -13,7 +13,6 @@ package org.eclipse.equinox.p2.tests.artifact.repository;
import java.io.*;
import java.net.*;
import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.p2.repository.RepositoryTransport;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -33,7 +32,7 @@ public class TransferTest extends AbstractProvisioningTest {
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");
- IStatus s = RepositoryTransport.getInstance().download(toDownload, fos, new NullProgressMonitor());
+ IStatus s = getTransport().download(toDownload, fos, new NullProgressMonitor());
assertOK("2.0", s);
int httpSize = -1;
URL u;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/ResumeDownloadTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/ResumeDownloadTest.java
index e0b8d9b19..fed8cccdf 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/ResumeDownloadTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/ResumeDownloadTest.java
@@ -13,7 +13,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.ecf.filetransfer.IFileRangeSpecification;
import org.eclipse.ecf.filetransfer.IIncomingFileTransfer;
-import org.eclipse.equinox.internal.p2.repository.FileReader;
+import org.eclipse.equinox.internal.p2.transport.ecf.FileReader;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileInfoReaderTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileInfoReaderTest.java
index cbaeb7f90..c755b5d54 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileInfoReaderTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileInfoReaderTest.java
@@ -15,7 +15,7 @@ import java.net.ConnectException;
import java.net.URI;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.repository.AuthenticationFailedException;
-import org.eclipse.equinox.internal.p2.repository.RepositoryTransport;
+import org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport;
import org.eclipse.equinox.p2.tests.testserver.helper.AbstractTestServerClientCase;
/**
@@ -24,7 +24,7 @@ import org.eclipse.equinox.p2.tests.testserver.helper.AbstractTestServerClientCa
public class FileInfoReaderTest extends AbstractTestServerClientCase {
public void testUnknownHost() throws Exception {
- RepositoryTransport transport = RepositoryTransport.getInstance();
+ RepositoryTransport transport = new RepositoryTransport();
URI toDownload = new URI("http://bogus.nowhere/nothing.xml");
IStatus status = null;
try {
@@ -37,7 +37,7 @@ public class FileInfoReaderTest extends AbstractTestServerClientCase {
}
public void testBadPort() throws Exception {
- RepositoryTransport transport = RepositoryTransport.getInstance();
+ RepositoryTransport transport = new RepositoryTransport();
URI toDownload = new URI("http://localhost:1/nothing.xml");
IStatus status = null;
try {
@@ -53,7 +53,7 @@ public class FileInfoReaderTest extends AbstractTestServerClientCase {
public void testRedirect() throws Exception {
this.setAladdinLoginService();
- RepositoryTransport transport = RepositoryTransport.getInstance();
+ RepositoryTransport transport = new RepositoryTransport();
// apache http client accepts 100 redirects
URI toDownload = new URI(getBaseURL() + "/redirect/101/public/index.html");
boolean caught = false;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileReaderTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileReaderTest.java
index b0d20809a..d0fa83611 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileReaderTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileReaderTest.java
@@ -14,7 +14,7 @@ package org.eclipse.equinox.p2.tests.repository;
import java.io.*;
import java.net.*;
import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.p2.repository.RepositoryTransport;
+import org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport;
import org.eclipse.equinox.p2.tests.testserver.helper.AbstractTestServerClientCase;
/**
@@ -23,7 +23,7 @@ import org.eclipse.equinox.p2.tests.testserver.helper.AbstractTestServerClientCa
public class FileReaderTest extends AbstractTestServerClientCase {
public void testUnknownHost() throws URISyntaxException {
- RepositoryTransport transport = RepositoryTransport.getInstance();
+ RepositoryTransport transport = new RepositoryTransport();
URI toDownload = new URI("http://bogus.nowhere/nothing.xml");
OutputStream target = new ByteArrayOutputStream();
IStatus status = transport.download(toDownload, target, new NullProgressMonitor());
@@ -33,7 +33,7 @@ public class FileReaderTest extends AbstractTestServerClientCase {
}
public void testBadPort() throws URISyntaxException {
- RepositoryTransport transport = RepositoryTransport.getInstance();
+ RepositoryTransport transport = new RepositoryTransport();
URI toDownload = new URI("http://localhost:1/nothing.xml");
OutputStream target = new ByteArrayOutputStream();
IStatus status = transport.download(toDownload, target, new NullProgressMonitor());
@@ -47,7 +47,7 @@ public class FileReaderTest extends AbstractTestServerClientCase {
* Tests a successful read.
*/
public void testReadStream() throws URISyntaxException, CoreException, IOException {
- RepositoryTransport transport = RepositoryTransport.getInstance();
+ RepositoryTransport transport = new RepositoryTransport();
URI toDownload = new URI("http://localhost:8080/public/index.html");
final NullProgressMonitor monitor = new NullProgressMonitor();
InputStream stream = transport.stream(toDownload, monitor);
@@ -59,7 +59,7 @@ public class FileReaderTest extends AbstractTestServerClientCase {
* Tests a successful read.
*/
public void testRead() throws URISyntaxException, CoreException, IOException {
- RepositoryTransport transport = RepositoryTransport.getInstance();
+ RepositoryTransport transport = new RepositoryTransport();
URI toDownload = new URI("http://localhost:8080/public/index.html");
OutputStream target = new ByteArrayOutputStream();
final NullProgressMonitor monitor = new NullProgressMonitor();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/TimeoutTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/TimeoutTest.java
index c58334633..033303f1b 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/TimeoutTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/TimeoutTest.java
@@ -12,7 +12,7 @@ import java.io.ByteArrayOutputStream;
import java.net.URI;
import java.security.cert.Certificate;
import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.p2.repository.RepositoryTransport;
+import org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.core.UIServices;
import org.eclipse.equinox.p2.tests.metadata.repository.AllServerTests;
@@ -48,7 +48,7 @@ public class TimeoutTest extends AbstractTestServerClientCase {
public void doTimeout(int type) throws Exception {
System.out.print("Note that test takes at least 120 seconds before timing out\n");
AllServerTests.setServiceUI(new AladdinNotSavedService());
- RepositoryTransport transport = RepositoryTransport.getInstance();
+ RepositoryTransport transport = new RepositoryTransport();
URI toDownload = new URI(getBaseURL() + "/timeout/whatever.txt");
long startTime = System.currentTimeMillis();
boolean caught = false;
@@ -136,7 +136,7 @@ public class TimeoutTest extends AbstractTestServerClientCase {
System.out.print("Note that test takes at least 10 seconds before timing out (and >120 if it fails)\n");
AllServerTests.setServiceUI(new AladdinNotSavedService());
- RepositoryTransport transport = RepositoryTransport.getInstance();
+ RepositoryTransport transport = new RepositoryTransport();
URI toDownload = new URI(getBaseURL() + "/timeout/whatever.txt");
IProgressMonitor monitor = new NullProgressMonitor();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java
index 2f0fdc78d..e489d2276 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java
@@ -64,7 +64,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/siteurl");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -82,7 +82,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File siteDirectory = getTestData("0.1", "/testData/updatesite/siteurl2/siteurl/");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
updatesite.getSite().setLocationURIString(siteDirectory.toURI().toString());
} catch (ProvisionException e) {
fail("0.2", e);
@@ -100,7 +100,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/digest");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -118,7 +118,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
URI siteURI = new URI("jar:" + site.toURI() + "!/");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(siteURI, getMonitor());
+ updatesite = UpdateSite.load(siteURI, getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -135,7 +135,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/digesturl");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -153,7 +153,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File digestDirectory = getTestData("0.1", "/testData/updatesite/digesturl2/digesturl/");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
updatesite.getSite().setDigestURIString(digestDirectory.toURI().toString());
} catch (ProvisionException e) {
fail("0.2", e);
@@ -175,7 +175,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/site");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -192,7 +192,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
UpdateSite updatesite = null;
try {
URI siteURL = base.toURI().resolve("site");
- updatesite = UpdateSite.load(siteURL, getMonitor());
+ updatesite = UpdateSite.load(siteURL, getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -208,7 +208,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/site/site.xml");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -224,7 +224,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/site with spaces/");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -240,7 +240,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/xxxsitexxx/xxxsitexxx.xml");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -256,7 +256,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File siteDir = getTestData("0.1", "/testData/updatesite/xxxsitexxx");
File site = new File(siteDir, "site.xml");
try {
- UpdateSite.load(site.toURI(), getMonitor());
+ UpdateSite.load(site.toURI(), getTransport(), getMonitor());
fail("0.2");
} catch (ProvisionException e) {
// expected
@@ -267,7 +267,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/baddigestgoodsite");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -282,7 +282,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/corruptdigestgoodsite");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -302,7 +302,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
public void testBadDigestBadSite() {
File site = getTestData("0.1", "/testData/updatesite/baddigestbadsite");
try {
- UpdateSite.load(site.toURI(), getMonitor());
+ UpdateSite.load(site.toURI(), getTransport(), getMonitor());
fail("0.2");
} catch (ProvisionException e) {
// expected
@@ -313,7 +313,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
// handle the case where the site.xml doesn't parse correctly
File site = getTestData("0.1", "/testData/updatesite/badSiteXML");
try {
- UpdateSite.load(site.toURI(), getMonitor());
+ UpdateSite.load(site.toURI(), getTransport(), getMonitor());
fail("0.2");
} catch (ProvisionException e) {
// expected exception
@@ -328,7 +328,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File temp = getTempFolder();
temp.mkdirs();
try {
- UpdateSite.load(temp.toURI(), getMonitor());
+ UpdateSite.load(temp.toURI(), getTransport(), getMonitor());
fail("0.2");
} catch (ProvisionException e) {
// we expect an exception
@@ -337,7 +337,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
public void testNullSite() {
try {
- assertNull("1.0", UpdateSite.load(null, getMonitor()));
+ assertNull("1.0", UpdateSite.load(null, getTransport(), getMonitor()));
} catch (ProvisionException e) {
fail("1.99", e);
}
@@ -347,7 +347,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/badfeatureurl");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -370,7 +370,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/goodfeatureurl");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -388,7 +388,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
URI siteURI = new URI("jar:" + site.toURI() + "!/");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(siteURI, getMonitor());
+ updatesite = UpdateSite.load(siteURI, getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -405,7 +405,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/includedfeature");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -421,7 +421,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/includedfeaturearchive");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -437,7 +437,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/badincludedfeaturearchive");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -459,7 +459,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
File site = getTestData("0.1", "/testData/updatesite/nofeatureidandversion");
UpdateSite updatesite = null;
try {
- updatesite = UpdateSite.load(site.toURI(), getMonitor());
+ updatesite = UpdateSite.load(site.toURI(), getTransport(), getMonitor());
} catch (ProvisionException e) {
fail("0.2", e);
}
@@ -827,7 +827,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
if (descriptor == null)
fail("0.3");
- RawMirrorRequest mirror = new RawMirrorRequest(descriptor, new ArtifactDescriptor(descriptor), targetRepository);
+ RawMirrorRequest mirror = new RawMirrorRequest(descriptor, new ArtifactDescriptor(descriptor), targetRepository, getTransport());
mirror.perform(sourceRepo, getMonitor());
assertTrue(mirror.getResult().isOK());
@@ -851,7 +851,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
IArtifactRepository repo;
OrderedMirrorSelector(IArtifactRepository repo, String testDataLocation) throws Exception {
- super(repo);
+ super(repo, getTransport());
this.repo = repo;
// Alternatively we could use reflect to change "location" of the repo
setRepoSelector();

Back to the top