diff options
author | Mickael Istria | 2021-11-30 20:37:38 +0000 |
---|---|---|
committer | Mickael Istria | 2021-12-01 14:01:47 +0000 |
commit | add9d6034938f68b3e2e0e6c32c6a41886cc150b (patch) | |
tree | 9fd1c1210e64d2f7ae0f688ade24802ce526940d /bundles | |
parent | bfc0c671406fb0ffedad4f9ee9fa3483ba4c5a3d (diff) | |
download | rt.equinox.p2-add9d6034938f68b3e2e0e6c32c6a41886cc150b.tar.gz rt.equinox.p2-add9d6034938f68b3e2e0e6c32c6a41886cc150b.tar.xz rt.equinox.p2-add9d6034938f68b3e2e0e6c32c6a41886cc150b.zip |
Bug 577522 - Update to newer easymockI20211203-1010I20211202-0900I20211202-0440I20211201-1950I20211201-1800
Change-Id: Ibbf5447233a02578244c274e855f2a088b5f9d92
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/188359
Tested-by: Equinox Bot <equinox-bot@eclipse.org>
Reviewed-by: Mickael Istria <mistria@redhat.com>
Diffstat (limited to 'bundles')
7 files changed, 25 insertions, 117 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 da3392d99..feb1cc712 100644 --- a/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF @@ -26,7 +26,6 @@ Require-Bundle: org.eclipse.equinox.frameworkadmin, org.eclipse.core.tests.harness;bundle-version="3.4.0", org.eclipse.core.runtime;bundle-version="3.4.0", org.eclipse.equinox.p2.publisher;bundle-version="1.0.0", - org.easymock;bundle-version="[2.4.0,3.0.0)", org.eclipse.equinox.frameworkadmin.test;bundle-version="1.0.0", org.junit;bundle-version="4.8.0", org.hamcrest.core;bundle-version="1.3.0", @@ -113,5 +112,6 @@ Import-Package: org.eclipse.ant.core, org.eclipse.osgi.util;version="1.1.0", org.osgi.framework;version="1.3.0", org.osgi.service.packageadmin;version="1.2.0", - org.osgi.util.tracker;version="1.3.0" + org.osgi.util.tracker;version="1.3.0", + org.easymock;version="4.0.0" Automatic-Module-Name: org.eclipse.equinox.p2.tests diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AccumulateConfigDataActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AccumulateConfigDataActionTest.java index 66707af19..480303b82 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AccumulateConfigDataActionTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AccumulateConfigDataActionTest.java @@ -26,7 +26,9 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.equinox.frameworkadmin.BundleInfo; import org.eclipse.equinox.internal.provisional.frameworkadmin.ConfigData; -import org.eclipse.equinox.p2.publisher.eclipse.*; +import org.eclipse.equinox.p2.publisher.eclipse.AccumulateConfigDataAction; +import org.eclipse.equinox.p2.publisher.eclipse.ConfigAdvice; +import org.eclipse.equinox.p2.publisher.eclipse.LaunchingAdvice; import org.eclipse.equinox.p2.tests.TestActivator; public class AccumulateConfigDataActionTest extends ActionTest { @@ -46,8 +48,8 @@ public class AccumulateConfigDataActionTest extends ActionTest { @Override public void setUp() throws Exception { - configAdviceCapture = new Capture<>(); - launchingAdviceCapture = new Capture<>(); + configAdviceCapture = Capture.newInstance(); + launchingAdviceCapture = Capture.newInstance(); setupPublisherInfo(); setupPublisherResult(); testAction = new AccumulateConfigDataAction(publisherInfo, configSpec, configLocation, executableLocation); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java index df719ad9e..72bde8105 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java @@ -39,6 +39,8 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.zip.ZipInputStream; +import org.easymock.Capture; +import org.easymock.CaptureType; import org.easymock.EasyMock; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; @@ -142,17 +144,17 @@ public class BundlesActionTest extends ActionTest { protected TestArtifactRepository artifactRepository = new TestArtifactRepository(getAgent()); - private MultiCapture<ITouchpointAdvice> tpAdvice1, tpAdvice2; - private MultiCapture<IUpdateDescriptorAdvice> udAdvice3; - private MultiCapture<ICapabilityAdvice> capAdvice5; + private Capture<ITouchpointAdvice> tpAdvice1, tpAdvice2; + private Capture<IUpdateDescriptorAdvice> udAdvice3; + private Capture<ICapabilityAdvice> capAdvice5; @Override public void setupPublisherInfo() { - tpAdvice1 = new MultiCapture<>(); - tpAdvice2 = new MultiCapture<>(); + tpAdvice1 = Capture.newInstance(CaptureType.ALL); + tpAdvice2 = Capture.newInstance(CaptureType.ALL); - udAdvice3 = new MultiCapture<>(); - capAdvice5 = new MultiCapture<>(); + udAdvice3 = Capture.newInstance(CaptureType.ALL); + capAdvice5 = Capture.newInstance(CaptureType.ALL); super.setupPublisherInfo(); } @@ -410,16 +412,16 @@ public class BundlesActionTest extends ActionTest { expectOtherAdviceQueries(TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION); expectPropertyAdviceQuery(TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION, sarProperties); expectUpdateDescriptorAdviceQuery(TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION, null); - expectTouchpointAdviceQuery(TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION, tpAdvice1); + expectTouchpointAdviceQuery(TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION, tpAdvice1.getValues()); expectOtherAdviceQueries(TEST2_PROV_BUNDLE_NAME, BUNDLE2_VERSION); expectPropertyAdviceQuery(TEST2_PROV_BUNDLE_NAME, BUNDLE2_VERSION, sdkProperties); expectUpdateDescriptorAdviceQuery(TEST2_PROV_BUNDLE_NAME, BUNDLE2_VERSION, null); - expectTouchpointAdviceQuery(TEST2_PROV_BUNDLE_NAME, BUNDLE2_VERSION, tpAdvice2); + expectTouchpointAdviceQuery(TEST2_PROV_BUNDLE_NAME, BUNDLE2_VERSION, tpAdvice2.getValues()); expectOtherAdviceQueries(TEST3_PROV_BUNDLE_NAME, BUNDLE3_VERSION); expectPropertyAdviceQuery(TEST3_PROV_BUNDLE_NAME, BUNDLE3_VERSION, sarProperties); - expectUpdateDescriptorAdviceQuery(TEST3_PROV_BUNDLE_NAME, BUNDLE3_VERSION, udAdvice3); + expectUpdateDescriptorAdviceQuery(TEST3_PROV_BUNDLE_NAME, BUNDLE3_VERSION, udAdvice3.getValues()); expectTouchpointAdviceQuery(TEST3_PROV_BUNDLE_NAME, BUNDLE3_VERSION, null); expectOtherAdviceQueries(TEST4_PROV_BUNDLE_NAME, BUNDLE4_VERSION); @@ -427,7 +429,7 @@ public class BundlesActionTest extends ActionTest { expectUpdateDescriptorAdviceQuery(TEST4_PROV_BUNDLE_NAME, BUNDLE4_VERSION, null); expectTouchpointAdviceQuery(TEST4_PROV_BUNDLE_NAME, BUNDLE4_VERSION, null); - expectCapabilityAdviceQuery(TEST5_PROV_BUNDLE_NAME, BUNDLE5_VERSION, capAdvice5); + expectCapabilityAdviceQuery(TEST5_PROV_BUNDLE_NAME, BUNDLE5_VERSION, capAdvice5.getValues()); expectOtherAdviceQueries(TEST5_PROV_BUNDLE_NAME, BUNDLE5_VERSION); expectPropertyAdviceQuery(TEST5_PROV_BUNDLE_NAME, BUNDLE5_VERSION, sarProperties); expectUpdateDescriptorAdviceQuery(TEST5_PROV_BUNDLE_NAME, BUNDLE5_VERSION, null); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java index a83f52b14..bae3a460e 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java @@ -80,7 +80,7 @@ public class FeaturesActionTest extends ActionTest { @Override public void setUp() throws Exception { testAction = new FeaturesAction(new File[] {root}); - tpAdvice = new Capture<>(); + tpAdvice = Capture.newInstance(); setupPublisherInfo(); setupPublisherResult(); } diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/MultiCapture.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/MultiCapture.java deleted file mode 100644 index 3f9d8133d..000000000 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/MultiCapture.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2017 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * 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.publisher.actions; - -import java.util.*; -import org.easymock.Capture; - -/** - * A capture that captures multiple values - */ -public class MultiCapture<T> extends Capture<T> implements Collection<T> { - private static final long serialVersionUID = 1L; - private final List<T> captured = new ArrayList<>(); - - @Override - public boolean add(T arg0) { - return captured.add(arg0); - } - - @Override - public boolean addAll(Collection<? extends T> arg0) { - return captured.addAll(arg0); - } - - @Override - public void clear() { - captured.clear(); - } - - @Override - public boolean contains(Object arg0) { - return captured.contains(arg0); - } - - @Override - public boolean containsAll(Collection<?> arg0) { - return captured.containsAll(arg0); - } - - @Override - public boolean isEmpty() { - return captured.isEmpty(); - } - - @Override - public Iterator<T> iterator() { - return captured.iterator(); - } - - @Override - public boolean remove(Object arg0) { - return captured.remove(arg0); - } - - @Override - public boolean removeAll(Collection<?> arg0) { - return captured.removeAll(arg0); - } - - @Override - public boolean retainAll(Collection<?> arg0) { - return captured.retainAll(arg0); - } - - @Override - public void setValue(T value) { - captured.add(value); - super.setValue(value); - } - - @Override - public int size() { - return captured.size(); - } - - @Override - public Object[] toArray() { - return captured.toArray(); - } - - @Override - public <X> X[] toArray(X[] arg0) { - return captured.toArray(arg0); - } -} diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionCapturingTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionCapturingTest.java index ffddce266..eb9a2d1b8 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionCapturingTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionCapturingTest.java @@ -73,8 +73,8 @@ public class ProductActionCapturingTest extends ActionTest { @Override public void setUp() throws Exception { - rootIUAdviceCapture = new Capture<>(); - productFileAdviceCapture = new Capture<>(); + rootIUAdviceCapture = Capture.newInstance(); + productFileAdviceCapture = Capture.newInstance(); setupPublisherInfo(); setupPublisherResult(); } diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionTestMac.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionTestMac.java index 87a455079..a14b660b5 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionTestMac.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionTestMac.java @@ -66,8 +66,8 @@ public class ProductActionTestMac extends ActionTest { @Override public void setUp() throws Exception { configSpec = AbstractPublisherAction.createConfigSpec("carbon", "macosx", "x86"); - rootIUAdviceCapture = new Capture<>(); - productFileAdviceCapture = new Capture<>(); + rootIUAdviceCapture = Capture.newInstance(); + productFileAdviceCapture = Capture.newInstance(); setupPublisherInfo(); setupPublisherResult(); } |