Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hallgren2010-02-05 22:07:01 +0000
committerThomas Hallgren2010-02-05 22:07:01 +0000
commit9faaed06625f31f3e4f26f65c3cffe4e947604fd (patch)
tree162a1267d4429ff85e188de84970455c138abfa6 /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact
parente640f35a91169ce4ad67d674ba7b150b42450478 (diff)
downloadrt.equinox.p2-9faaed06625f31f3e4f26f65c3cffe4e947604fd.tar.gz
rt.equinox.p2-9faaed06625f31f3e4f26f65c3cffe4e947604fd.tar.xz
rt.equinox.p2-9faaed06625f31f3e4f26f65c3cffe4e947604fd.zip
299987 : Removal of p2 services in favor of always using an agent.
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/BatchExecuteArtifactRepositoryTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/JarURLArtifactRepositoryTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorSelectorTest.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Adder.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ByteShifter.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Counter.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Multiplier.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java22
14 files changed, 59 insertions, 62 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java
index 2c431c266..40ddbfb41 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java
@@ -11,10 +11,7 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.artifact.repository;
-import org.eclipse.equinox.p2.metadata.Version;
-
import java.io.*;
-import junit.framework.TestCase;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository;
import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.ArtifactOutputStream;
@@ -22,11 +19,12 @@ import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStep;
import org.eclipse.equinox.internal.provisional.p2.repository.IStateful;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
-public class ArtifactOutputStreamTest extends TestCase {
+public class ArtifactOutputStreamTest extends AbstractProvisioningTest {
private SimpleArtifactRepository sar = null;
private ProcessingStep destination = null;
@@ -42,7 +40,7 @@ public class ArtifactOutputStreamTest extends TestCase {
tempWritableLocation = File.createTempFile("artifact", ".repo");
tempWritableLocation.delete();
tempWritableLocation.mkdirs();
- sar = new SimpleArtifactRepository("name", tempWritableLocation.toURI(), null);
+ sar = new SimpleArtifactRepository(getAgent(), "name", tempWritableLocation.toURI(), null);
destination = new Destination();
ak = new ArtifactKey("classifier", "id", Version.create("1.0"));
ad = new ArtifactDescriptor(ak);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java
index c684762bc..52ebf6782 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java
@@ -134,7 +134,7 @@ public class ArtifactRepositoryManagerTest extends AbstractProvisioningTest {
}
//everybody's happy again
- manager = (IArtifactRepositoryManager) ServiceHelper.getService(TestActivator.context, IArtifactRepositoryManager.SERVICE_NAME);
+ manager = (IArtifactRepositoryManager) getAgent().getService(IArtifactRepositoryManager.SERVICE_NAME);
assertTrue("1.0", manager.contains(location));
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/BatchExecuteArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/BatchExecuteArtifactRepositoryTest.java
index adf8ba30d..bfd1d855d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/BatchExecuteArtifactRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/BatchExecuteArtifactRepositoryTest.java
@@ -222,7 +222,7 @@ public class BatchExecuteArtifactRepositoryTest extends AbstractProvisioningTest
* @param properties
*/
public FailingSimpleArtifactRepository(String repositoryName, URI location, Map properties) {
- super(repositoryName, location, properties);
+ super(getAgent(), repositoryName, location, properties);
}
public IStatus executeBatch(Runnable runnable) {
@@ -349,7 +349,7 @@ public class BatchExecuteArtifactRepositoryTest extends AbstractProvisioningTest
* @param properties
*/
public TrackSavignSimpleArtifactRepository(String repositoryName, URI location, Map properties) {
- super(repositoryName, location, properties);
+ super(getAgent(), repositoryName, location, properties);
}
public IStatus executeBatch(Runnable runnable) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java
index 20c87ce50..92b95a499 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java
@@ -13,7 +13,6 @@ package org.eclipse.equinox.p2.tests.artifact.repository;
import java.io.*;
import java.net.URI;
import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
@@ -25,7 +24,6 @@ import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
-import org.eclipse.equinox.p2.tests.TestActivator;
public class Bug265577 extends AbstractProvisioningTest {
IProfile profile;
@@ -38,7 +36,7 @@ public class Bug265577 extends AbstractProvisioningTest {
super.setUp();
profile = createProfile(Bug265577.class.getName());
- engine = (IEngine) ServiceHelper.getService(TestActivator.context, IEngine.SERVICE_NAME);
+ engine = (IEngine) getAgent().getService(IEngine.SERVICE_NAME);
// Load repositories
File repoLocation = getTestData("Repository location", "/testData/bug265577/zipRepo.zip");
if (repoLocation == null)
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 762e6590a..1d11d8c57 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
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.artifact.repository;
-import org.eclipse.equinox.p2.metadata.Version;
-
import java.io.*;
import java.lang.reflect.Field;
import java.net.URI;
@@ -27,6 +25,7 @@ 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;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.*;
@@ -939,7 +938,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
CompositeArtifactRepository repository = createRepository(new URI("memory:/in/memory"), "in memory test");
IArtifactRepository childOne = getArtifactRepositoryManager().loadRepository(childLocation, null);
- TestArtifactRepository childTwo = new TestArtifactRepository(new URI("memory:/in/memory/two"));
+ TestArtifactRepository childTwo = new TestArtifactRepository(getAgent(), new URI("memory:/in/memory/two"));
// Add to repo manager
assertTrue(childTwo.addToRepositoryManager());
@@ -980,7 +979,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
int downloadAttempts = 0;
public BadMirrorSite(URI location) {
- super(location);
+ super(getAgent(), location);
addToRepositoryManager();
}
@@ -1047,7 +1046,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
File location = new File(getTempFolder(), getUniqueString());
public BadSite(URI location) {
- super(location);
+ super(getAgent(), location);
}
public IStatus getArtifact(IArtifactDescriptor descriptor, OutputStream out, IProgressMonitor monitor) {
@@ -1088,7 +1087,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
source.addChild(childOne.getLocation());
// Create 'good' child which downloads successfully
- TestArtifactRepository childTwo = new TestArtifactRepository(new URI("memory:/in/memory/two"));
+ TestArtifactRepository childTwo = new TestArtifactRepository(getAgent(), new URI("memory:/in/memory/two"));
childTwo.addDescriptor(descriptor);
childTwo.addArtifact(descriptor.getArtifactKey(), contents);
childTwo.addToRepositoryManager();
@@ -1319,7 +1318,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
*/
protected IArtifactRepository createChild() {
try {
- TestArtifactRepository repo = new TestArtifactRepository(new URI("memory:/in/memory/" + childCount++)) {
+ TestArtifactRepository repo = new TestArtifactRepository(getAgent(), new URI("memory:/in/memory/" + childCount++)) {
public boolean contains(IArtifactDescriptor desc) {
return true;
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java
index c96ce06db..84c2e75b0 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java
@@ -10,26 +10,25 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.artifact.repository;
-import org.eclipse.equinox.p2.metadata.Version;
-
import java.io.File;
import java.io.FileFilter;
import java.net.URL;
import java.util.Iterator;
import junit.framework.TestCase;
import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestActivator;
-import org.osgi.framework.ServiceReference;
public class FoldersRepositoryTest extends TestCase {
- private ServiceReference managerRef;
private IArtifactRepositoryManager manager;
private File testRepo;
@@ -42,13 +41,12 @@ public class FoldersRepositoryTest extends TestCase {
}
protected void setUp() throws Exception {
- managerRef = TestActivator.getContext().getServiceReference(IArtifactRepositoryManager.SERVICE_NAME);
- manager = (IArtifactRepositoryManager) TestActivator.getContext().getService(managerRef);
+ IProvisioningAgent agent = (IProvisioningAgent) ServiceHelper.getService(TestActivator.getContext(), IProvisioningAgent.SERVICE_NAME);
+ manager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME);
}
protected void tearDown() throws Exception {
manager = null;
- TestActivator.getContext().ungetService(managerRef);
if (testRepo != null)
AbstractProvisioningTest.delete(testRepo);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/JarURLArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/JarURLArtifactRepositoryTest.java
index 99932a704..d20aef2c7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/JarURLArtifactRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/JarURLArtifactRepositoryTest.java
@@ -10,21 +10,20 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.artifact.repository;
-import org.eclipse.equinox.p2.metadata.Version;
-
import java.net.*;
import junit.framework.TestCase;
import org.eclipse.core.runtime.URIUtil;
+import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.ProvisionException;
+import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.tests.TestActivator;
-import org.osgi.framework.ServiceReference;
public class JarURLArtifactRepositoryTest extends TestCase {
- private ServiceReference managerRef;
private IArtifactRepositoryManager manager;
public JarURLArtifactRepositoryTest(String name) {
@@ -36,13 +35,12 @@ public class JarURLArtifactRepositoryTest extends TestCase {
}
protected void setUp() throws Exception {
- managerRef = TestActivator.getContext().getServiceReference(IArtifactRepositoryManager.SERVICE_NAME);
- manager = (IArtifactRepositoryManager) TestActivator.getContext().getService(managerRef);
+ IProvisioningAgent agent = (IProvisioningAgent) ServiceHelper.getService(TestActivator.getContext(), IProvisioningAgent.SERVICE_NAME);
+ manager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME);
}
protected void tearDown() throws Exception {
manager = null;
- TestActivator.getContext().ungetService(managerRef);
}
public void testJarURLRepository() throws ProvisionException, URISyntaxException {
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 f7e7b8017..b6140a8e1 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
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.artifact.repository;
-import org.eclipse.equinox.p2.metadata.Version;
-
import java.io.*;
import java.lang.reflect.Field;
import java.net.URI;
@@ -26,6 +24,7 @@ import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifact
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.*;
@@ -46,7 +45,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
targetLocation = File.createTempFile("target", ".repo");
targetLocation.delete();
targetLocation.mkdirs();
- targetRepository = new SimpleArtifactRepository("TargetRepo", targetLocation.toURI(), null);
+ targetRepository = new SimpleArtifactRepository(getAgent(), "TargetRepo", targetLocation.toURI(), null);
IArtifactRepositoryManager mgr = getArtifactRepositoryManager();
sourceRepository = mgr.loadRepository((getTestData("EmptyJar repo", testDataLocation).toURI()), null);
@@ -260,7 +259,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
int downloadCount = 0;
RemoteRepo(SimpleArtifactRepository repo) {
- super(repo.getName(), repo.getType(), repo.getVersion(), repo.getLocation(), repo.getDescription(), repo.getProvider(), repo.getProperties());
+ super(getAgent(), repo.getName(), repo.getType(), repo.getVersion(), repo.getLocation(), repo.getDescription(), repo.getProvider(), repo.getProperties());
delegate = repo;
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorSelectorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorSelectorTest.java
index 96dc81f02..3115f5871 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorSelectorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorSelectorTest.java
@@ -38,7 +38,7 @@ public class MirrorSelectorTest extends AbstractProvisioningTest {
one.incrementFailureCount();
two.incrementFailureCount();
Arrays.sort(sorted);
- assertOrder("1.2)", sorted, three, four, two, one);
+ assertOrder("1.2", sorted, three, four, two, one);
//go back to default order
one = new MirrorInfo("one", 0);
@@ -48,15 +48,18 @@ public class MirrorSelectorTest extends AbstractProvisioningTest {
sorted = new MirrorInfo[] {one, two, three, four};
//set bit rate and ensure order is updated
- two.setBytesPerSecond(200L);
+ one.setBytesPerSecond(100L);
+ two.setBytesPerSecond(400L);
+ three.setBytesPerSecond(800L);
+ four.setBytesPerSecond(600L);
Arrays.sort(sorted);
- assertOrder("1.2)", sorted, two, one, three, four);
+ assertOrder("1.3", sorted, three, four, two, one);
- one.setBytesPerSecond(100L);
- three.setBytesPerSecond(400L);
- four.setBytesPerSecond(300L);
+ //introduce a failure and ensure order is updated but that
+ //the failure isn't put last
+ three.incrementFailureCount();
Arrays.sort(sorted);
- assertOrder("1.2)", sorted, three, four, two, one);
+ assertOrder("1.4", sorted, four, two, three, one);
}
private void assertOrder(String message, MirrorInfo[] sorted, MirrorInfo one, MirrorInfo two, MirrorInfo three, MirrorInfo four) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Adder.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Adder.java
index c3394503b..f3d2bd5d0 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Adder.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Adder.java
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.artifact.repository.Activator;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStep;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
import org.eclipse.equinox.p2.repository.artifact.IProcessingStepDescriptor;
@@ -32,8 +33,8 @@ public class Adder extends ProcessingStep {
this.operand = operand;
}
- public void initialize(IProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
- super.initialize(descriptor, context);
+ public void initialize(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
+ super.initialize(agent, descriptor, context);
try {
operand = Integer.valueOf(descriptor.getData()).intValue();
} catch (NumberFormatException e) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ByteShifter.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ByteShifter.java
index 507d9283a..b391e3a02 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ByteShifter.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ByteShifter.java
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.artifact.repository.Activator;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStep;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
import org.eclipse.equinox.p2.repository.artifact.IProcessingStepDescriptor;
@@ -51,8 +52,8 @@ public class ByteShifter extends ProcessingStep {
setStatus(new Status(code, Activator.ID, "ByteShifter operand invalid: " + operand));
}
- public void initialize(IProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
- super.initialize(descriptor, context);
+ public void initialize(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
+ super.initialize(agent, descriptor, context);
try {
operand = Integer.valueOf(descriptor.getData()).intValue();
} catch (NumberFormatException e) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Counter.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Counter.java
index 0a033464e..4bc494975 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Counter.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Counter.java
@@ -15,6 +15,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.artifact.repository.Activator;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStep;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
import org.eclipse.equinox.p2.repository.artifact.IProcessingStepDescriptor;
@@ -51,8 +52,8 @@ public class Counter extends ProcessingStep {
setStatus(new Status(code, Activator.ID, "Counter size not set"));
}
- public void initialize(IProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
- super.initialize(descriptor, context);
+ public void initialize(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
+ super.initialize(agent, descriptor, context);
String data = descriptor.getData();
if (data == null)
return;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Multiplier.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Multiplier.java
index feb98171c..1b702d58e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Multiplier.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Multiplier.java
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.artifact.repository.Activator;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStep;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
import org.eclipse.equinox.p2.repository.artifact.IProcessingStepDescriptor;
@@ -32,8 +33,8 @@ public class Multiplier extends ProcessingStep {
this.operand = operand;
}
- public void initialize(IProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
- super.initialize(descriptor, context);
+ public void initialize(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
+ super.initialize(agent, descriptor, context);
try {
operand = Integer.valueOf(descriptor.getData()).intValue();
} catch (NumberFormatException e) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java
index d22e509fc..aa16f2543 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java
@@ -13,7 +13,6 @@ package org.eclipse.equinox.p2.tests.artifact.repository.processing;
import java.io.*;
import java.util.Arrays;
-import junit.framework.TestCase;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.artifact.processors.pack200.Pack200ProcessorStep;
import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
@@ -22,9 +21,10 @@ import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processin
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler;
import org.eclipse.equinox.p2.repository.artifact.IProcessingStepDescriptor;
import org.eclipse.equinox.p2.repository.artifact.spi.ProcessingStepDescriptor;
+import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestActivator;
-public class ProcessingStepHandlerTest extends TestCase {
+public class ProcessingStepHandlerTest extends AbstractProvisioningTest {
// private static final int BUFFER_SIZE = 8 * 1024;
@@ -34,7 +34,7 @@ public class ProcessingStepHandlerTest extends TestCase {
public void testExecuteNoPSs() throws IOException {
IProcessingStepDescriptor[] descriptors = new IProcessingStepDescriptor[0];
OutputStream result = new ByteArrayOutputStream(10);
- OutputStream testStream = handler.createAndLink(descriptors, null, result, monitor);
+ OutputStream testStream = handler.createAndLink(getAgent(), descriptors, null, result, monitor);
testStream.write("Test".getBytes());
testStream.close();
assertEquals("Test", result.toString());
@@ -129,7 +129,7 @@ public class ProcessingStepHandlerTest extends TestCase {
if (!PackStep.canPack())
return;
IProcessingStepDescriptor[] descriptors = new IProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true)};
- ProcessingStep[] steps = handler.create(descriptors, null);
+ ProcessingStep[] steps = handler.create(getAgent(), descriptors, null);
ByteArrayOutputStream result = new ByteArrayOutputStream(100000);
OutputStream testStream = handler.link(steps, result, monitor);
IStatus status = ProcessingStepHandler.checkStatus(testStream);
@@ -141,7 +141,7 @@ public class ProcessingStepHandlerTest extends TestCase {
public void testCreateByteShifterPS() {
IProcessingStepDescriptor[] descriptors = new IProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.ByteShifter", "1", true)};
- ProcessingStep[] steps = handler.create(descriptors, null);
+ ProcessingStep[] steps = handler.create(getAgent(), descriptors, null);
assertNotNull(steps);
assertEquals(1, steps.length);
assertEquals(ByteShifter.class, steps[0].getClass());
@@ -157,7 +157,7 @@ public class ProcessingStepHandlerTest extends TestCase {
public void testCreateAdderPS() {
IProcessingStepDescriptor[] descriptors = new IProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Adder", "1", true)};
- ProcessingStep[] steps = handler.create(descriptors, null);
+ ProcessingStep[] steps = handler.create(getAgent(), descriptors, null);
assertNotNull(steps);
assertEquals(1, steps.length);
assertEquals(Adder.class, steps[0].getClass());
@@ -165,7 +165,7 @@ public class ProcessingStepHandlerTest extends TestCase {
public void testCreateMultiplierPS() {
IProcessingStepDescriptor[] descriptors = new IProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Multiplier", "2", true)};
- ProcessingStep[] steps = handler.create(descriptors, null);
+ ProcessingStep[] steps = handler.create(getAgent(), descriptors, null);
assertNotNull(steps);
assertEquals(1, steps.length);
assertEquals(Multiplier.class, steps[0].getClass());
@@ -173,7 +173,7 @@ public class ProcessingStepHandlerTest extends TestCase {
public void testCreatePack200UnpackerPS() {
IProcessingStepDescriptor[] descriptors = new IProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true)};
- ProcessingStep[] steps = handler.create(descriptors, null);
+ ProcessingStep[] steps = handler.create(getAgent(), descriptors, null);
assertNotNull(steps);
assertEquals(1, steps.length);
assertEquals(Pack200ProcessorStep.class, steps[0].getClass());
@@ -183,7 +183,7 @@ public class ProcessingStepHandlerTest extends TestCase {
IProcessingStepDescriptor adder = new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Adder", "1", true);
IProcessingStepDescriptor multiplier = new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Multiplier", "2", true);
IProcessingStepDescriptor[] descriptors = new IProcessingStepDescriptor[] {adder, multiplier};
- ProcessingStep[] steps = handler.create(descriptors, null);
+ ProcessingStep[] steps = handler.create(getAgent(), descriptors, null);
ByteArrayOutputStream result = new ByteArrayOutputStream(10);
OutputStream testStream = handler.link(steps, result, monitor);
testStream.write(new byte[] {1, 2, 3, 4, 5});
@@ -195,7 +195,7 @@ public class ProcessingStepHandlerTest extends TestCase {
IProcessingStepDescriptor adder = new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Adder", "1", true);
IProcessingStepDescriptor multiplier = new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Multiplier", "2", true);
IProcessingStepDescriptor[] descriptors = new IProcessingStepDescriptor[] {multiplier, adder};
- ProcessingStep[] steps = handler.create(descriptors, null);
+ ProcessingStep[] steps = handler.create(getAgent(), descriptors, null);
ByteArrayOutputStream result = new ByteArrayOutputStream(10);
OutputStream testStream = handler.link(steps, result, monitor);
testStream.write(new byte[] {1, 2, 3, 4, 5});
@@ -208,7 +208,7 @@ public class ProcessingStepHandlerTest extends TestCase {
IProcessingStepDescriptor multiplier = new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Multiplier", "2", true);
IProcessingStepDescriptor[] descriptors = new IProcessingStepDescriptor[] {adder, multiplier};
ByteArrayOutputStream result = new ByteArrayOutputStream(10);
- OutputStream testStream = handler.createAndLink(descriptors, null, result, monitor);
+ OutputStream testStream = handler.createAndLink(getAgent(), descriptors, null, result, monitor);
testStream.write(new byte[] {1, 2, 3, 4, 5});
testStream.close();
assertTrue(Arrays.equals(new byte[] {4, 6, 8, 10, 12}, result.toByteArray()));

Back to the top