[pkg-java] r17563 - in trunk/maven-common-artifact-filters/debian: . patches
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Wed Dec 4 14:39:27 UTC 2013
Author: ebourg-guest
Date: 2013-12-04 14:39:27 +0000 (Wed, 04 Dec 2013)
New Revision: 17563
Added:
trunk/maven-common-artifact-filters/debian/patches/
trunk/maven-common-artifact-filters/debian/patches/01_easymock-upgrade.patch
trunk/maven-common-artifact-filters/debian/patches/series
Modified:
trunk/maven-common-artifact-filters/debian/changelog
Log:
Added a patch to compile with EasyMock 3.x (Closes: #730953)
Modified: trunk/maven-common-artifact-filters/debian/changelog
===================================================================
--- trunk/maven-common-artifact-filters/debian/changelog 2013-12-04 14:10:22 UTC (rev 17562)
+++ trunk/maven-common-artifact-filters/debian/changelog 2013-12-04 14:39:27 UTC (rev 17563)
@@ -3,6 +3,7 @@
* Team upload.
* New upstream release
- Replaced the build dependency on junit with junit4
+ * Added a patch to compile with EasyMock 3.x (Closes: #730953)
* debian/control:
- Standards-Version updated to 3.9.5 (no changes)
- Use canonical URLs for the Vcs-* fields
Added: trunk/maven-common-artifact-filters/debian/patches/01_easymock-upgrade.patch
===================================================================
--- trunk/maven-common-artifact-filters/debian/patches/01_easymock-upgrade.patch (rev 0)
+++ trunk/maven-common-artifact-filters/debian/patches/01_easymock-upgrade.patch 2013-12-04 14:39:27 UTC (rev 17563)
@@ -0,0 +1,500 @@
+Description: Upgrade the dependency on Easymock to 3.2
+Author: Emmanuel Bourg <ebourg at apache.org>
+Bug: https://github.com/apache/maven-shared/pull/3
+--- a/src/test/java/org/apache/maven/shared/artifact/filter/PatternArtifactFilterTCK.java
++++ b/src/test/java/org/apache/maven/shared/artifact/filter/PatternArtifactFilterTCK.java
+@@ -27,15 +27,13 @@
+
+ import org.apache.maven.artifact.Artifact;
+ import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+-import org.apache.maven.shared.tools.easymock.MockManager;
+-import org.easymock.MockControl;
++
++import static org.easymock.EasyMock.*;
+
+ public abstract class PatternArtifactFilterTCK
+ extends TestCase
+ {
+
+- private final MockManager mockManager = new MockManager();
+-
+ protected abstract ArtifactFilter createFilter( List patterns );
+
+ protected abstract ArtifactFilter createFilter( List patterns, boolean actTransitively );
+@@ -53,7 +51,7 @@
+ final ArtifactMockAndControl mac1 = new ArtifactMockAndControl( groupId1, artifactId1 );
+ final ArtifactMockAndControl mac2 = new ArtifactMockAndControl( groupId2, artifactId2 );
+
+- mockManager.replayAll();
++ replay( mac1.getMock(), mac2.getMock() );
+
+ final List patterns = new ArrayList();
+ patterns.add( groupId1 + ":" + artifactId1 + ":*" );
+@@ -72,7 +70,7 @@
+ assertTrue( filter.include( mac2.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac1.getMock(), mac2.getMock() );
+ }
+
+ public void testShouldTriggerBothPatternsWithNonColonWildcards()
+@@ -86,7 +84,7 @@
+ final ArtifactMockAndControl mac1 = new ArtifactMockAndControl( groupId1, artifactId1 );
+ final ArtifactMockAndControl mac2 = new ArtifactMockAndControl( groupId2, artifactId2 );
+
+- mockManager.replayAll();
++ replay( mac1.getMock(), mac2.getMock() );
+
+ final List patterns = new ArrayList();
+ patterns.add( groupId1 + "*" );
+@@ -105,7 +103,7 @@
+ assertTrue( filter.include( mac2.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac1.getMock(), mac2.getMock() );
+ }
+
+ public void testShouldIncludeDirectlyMatchedArtifactByGroupIdArtifactId()
+@@ -115,7 +113,7 @@
+
+ final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId );
+
+- mockManager.replayAll();
++ replay( mac.getMock() );
+
+ final ArtifactFilter filter = createFilter( Collections.singletonList( groupId + ":" + artifactId ) );
+
+@@ -128,7 +126,7 @@
+ assertTrue( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock() );
+ }
+
+ public void testShouldIncludeDirectlyMatchedArtifactByDependencyConflictId()
+@@ -138,7 +136,7 @@
+
+ final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId );
+
+- mockManager.replayAll();
++ replay( mac.getMock() );
+
+ final ArtifactFilter filter = createFilter( Collections.singletonList( groupId + ":" + artifactId + ":jar" ) );
+
+@@ -151,7 +149,7 @@
+ assertTrue( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock() );
+ }
+
+ public void testShouldNotIncludeWhenGroupIdDiffers()
+@@ -161,7 +159,7 @@
+
+ final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId );
+
+- mockManager.replayAll();
++ replay( mac.getMock() );
+ final List patterns = new ArrayList();
+
+ patterns.add( "otherGroup:" + artifactId + ":jar" );
+@@ -178,7 +176,7 @@
+ assertFalse( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock() );
+ }
+
+ public void testShouldNotIncludeWhenArtifactIdDiffers()
+@@ -188,7 +186,7 @@
+
+ final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId );
+
+- mockManager.replayAll();
++ replay( mac.getMock() );
+
+ final List patterns = new ArrayList();
+
+@@ -206,7 +204,7 @@
+ assertFalse( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock() );
+ }
+
+ public void testShouldNotIncludeWhenBothIdElementsDiffer()
+@@ -216,7 +214,7 @@
+
+ final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId );
+
+- mockManager.replayAll();
++ replay( mac.getMock() );
+
+ final List patterns = new ArrayList();
+
+@@ -234,7 +232,7 @@
+ assertFalse( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock() );
+ }
+
+ public void testShouldIncludeWhenPatternMatchesDependencyTrailAndTransitivityIsEnabled()
+@@ -250,7 +248,7 @@
+
+ final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId, depTrail );
+
+- mockManager.replayAll();
++ replay( mac.getMock() );
+
+ final ArtifactFilter filter = createFilter( patterns, true );
+
+@@ -263,7 +261,7 @@
+ assertTrue( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock() );
+ }
+
+ public void testIncludeWhenPatternMatchesDepTrailWithTransitivityUsingNonColonWildcard()
+@@ -279,7 +277,7 @@
+
+ final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId, depTrail );
+
+- mockManager.replayAll();
++ replay( mac.getMock() );
+
+ final ArtifactFilter filter = createFilter( patterns, true );
+
+@@ -292,7 +290,7 @@
+ assertTrue( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock() );
+ }
+
+ public void testShouldNotIncludeWhenNegativeMatch()
+@@ -302,7 +300,7 @@
+
+ final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId );
+
+- mockManager.replayAll();
++ replay( mac.getMock() );
+
+ final List patterns = new ArrayList();
+
+@@ -319,7 +317,7 @@
+ assertFalse( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock() );
+ }
+
+ public void testShouldIncludeWhenWildcardMatchesInsideSequence()
+@@ -329,7 +327,7 @@
+
+ final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId );
+
+- mockManager.replayAll();
++ replay( mac.getMock() );
+
+ final List patterns = new ArrayList();
+
+@@ -346,7 +344,7 @@
+ assertTrue( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock() );
+ }
+
+ public void testShouldIncludeWhenWildcardMatchesOutsideSequence()
+@@ -356,7 +354,7 @@
+
+ final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId );
+
+- mockManager.replayAll();
++ replay( mac.getMock() );
+
+ final List patterns = new ArrayList();
+
+@@ -373,7 +371,7 @@
+ assertTrue( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock() );
+ }
+
+ public void testShouldIncludeWhenWildcardMatchesMiddleOfArtifactId()
+@@ -383,7 +381,7 @@
+
+ final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId );
+
+- mockManager.replayAll();
++ replay( mac.getMock() );
+
+ final List patterns = new ArrayList();
+
+@@ -400,7 +398,7 @@
+ assertTrue( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock() );
+ }
+
+ public void testShouldIncludeWhenWildcardCoversPartOfGroupIdAndEverythingElse()
+@@ -410,7 +408,7 @@
+
+ final ArtifactMockAndControl mac = new ArtifactMockAndControl( groupId, artifactId );
+
+- mockManager.replayAll();
++ replay( mac.getMock() );
+
+ final List patterns = new ArrayList();
+
+@@ -427,7 +425,7 @@
+ assertTrue( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock() );
+ }
+
+ public void testShouldIncludeTransitiveDependencyWhenWildcardMatchesButDoesntMatchParent()
+@@ -447,7 +445,7 @@
+ final ArtifactMockAndControl otherMac =
+ new ArtifactMockAndControl( otherGroup, otherArtifact, otherType, Collections.EMPTY_LIST );
+
+- mockManager.replayAll();
++ replay( mac.getMock(), otherMac.getMock() );
+
+ final ArtifactFilter filter = createFilter( patterns, true );
+
+@@ -462,7 +460,7 @@
+ assertTrue( filter.include( mac.artifact ) );
+ }
+
+- mockManager.verifyAll();
++ verify( mac.getMock(), otherMac.getMock() );
+ }
+
+ // FIXME: Not sure what this is even trying to test.
+@@ -503,8 +501,6 @@
+
+ private final class ArtifactMockAndControl
+ {
+- MockControl control;
+-
+ Artifact artifact;
+
+ String groupId;
+@@ -530,10 +526,7 @@
+ this.dependencyTrail = dependencyTrail;
+ this.type = type;
+
+- control = MockControl.createControl( Artifact.class );
+- mockManager.add( control );
+-
+- artifact = (Artifact) control.getMock();
++ artifact = createNiceMock( Artifact.class );
+
+ enableGetDependencyConflictId();
+ enableGetGroupIdArtifactIdAndVersion();
+@@ -550,35 +543,31 @@
+ this( groupId, artifactId, "jar", null );
+ }
+
++ Artifact getMock()
++ {
++ return artifact;
++ }
++
+ void enableGetId()
+ {
+- artifact.getId();
+- control.setReturnValue( groupId + ":" + artifactId + ":" + type + ":version", MockControl.ZERO_OR_MORE );
++ expect( artifact.getId() ).andReturn( groupId + ":" + artifactId + ":" + type + ":version" ).anyTimes();
+ }
+
+ void enableGetDependencyTrail()
+ {
+- artifact.getDependencyTrail();
+- control.setReturnValue( dependencyTrail, MockControl.ZERO_OR_MORE );
++ expect( artifact.getDependencyTrail() ).andReturn( dependencyTrail ).anyTimes();
+ }
+
+ void enableGetDependencyConflictId()
+ {
+- artifact.getDependencyConflictId();
+- control.setReturnValue( groupId + ":" + artifactId + ":" + type, MockControl.ONE_OR_MORE );
++ expect( artifact.getDependencyConflictId() ).andReturn( groupId + ":" + artifactId + ":" + type ).atLeastOnce();
+ }
+
+ void enableGetGroupIdArtifactIdAndVersion()
+ {
+- artifact.getGroupId();
+- control.setReturnValue( groupId, MockControl.ONE_OR_MORE );
+-
+- artifact.getArtifactId();
+- control.setReturnValue( artifactId, MockControl.ONE_OR_MORE );
+-
+- artifact.getVersion();
+- control.setReturnValue( version, MockControl.ZERO_OR_MORE );
+-
++ expect( artifact.getGroupId() ).andReturn( groupId ).atLeastOnce();
++ expect( artifact.getArtifactId() ).andReturn( artifactId ).atLeastOnce();
++ expect( artifact.getVersion() ).andReturn( version ).anyTimes();
+ }
+ }
+
+--- a/src/test/java/org/apache/maven/shared/artifact/filter/ScopeArtifactFilterTest.java
++++ b/src/test/java/org/apache/maven/shared/artifact/filter/ScopeArtifactFilterTest.java
+@@ -22,9 +22,9 @@
+ import org.apache.maven.artifact.factory.ArtifactFactory;
+ import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+ import org.apache.maven.artifact.versioning.VersionRange;
+-import org.apache.maven.shared.tools.easymock.MockManager;
+ import org.codehaus.plexus.PlexusTestCase;
+-import org.easymock.MockControl;
++
++import static org.easymock.EasyMock.*;
+
+ public class ScopeArtifactFilterTest
+ extends PlexusTestCase
+@@ -42,8 +42,6 @@
+ assertFalse( filter.include( excluded ) );
+ }
+
+- private MockManager mockManager = new MockManager();
+-
+ public void testNullScopeDisabled()
+ {
+ ScopeArtifactFilter filter = new ScopeArtifactFilter();
+@@ -266,90 +264,63 @@
+
+ private void verifyIncluded( String filterScope, String artifactScope )
+ {
+- ArtifactMockAndControl mac = new ArtifactMockAndControl( artifactScope );
++ Artifact artifact = createMockArtifact( artifactScope );
+
+- mockManager.replayAll();
++ replay( artifact );
+
+ ArtifactFilter filter = new ScopeArtifactFilter( filterScope );
+
+ assertTrue( "Artifact scope: " + artifactScope + " NOT included using filter scope: " + filterScope, filter
+- .include( mac.artifact ) );
+-
+- mockManager.verifyAll();
++ .include( artifact ) );
+
+- // enable multiple calls to this method within a single test.
+- mockManager.clear();
++ verify( artifact );
+ }
+
+ private void verifyExcluded( String filterScope, String artifactScope )
+ {
+- ArtifactMockAndControl mac = new ArtifactMockAndControl( artifactScope );
+-
+- mockManager.replayAll();
++ Artifact artifact = createMockArtifact( artifactScope );
++
++ replay( artifact );
+
+ ArtifactFilter filter = new ScopeArtifactFilter( filterScope );
+
+ assertFalse( "Artifact scope: " + artifactScope + " NOT excluded using filter scope: " + filterScope, filter
+- .include( mac.artifact ) );
+-
+- mockManager.verifyAll();
++ .include( artifact ) );
+
+- // enable multiple calls to this method within a single test.
+- mockManager.clear();
++ verify( artifact );
+ }
+
+ private void verifyIncluded( ScopeArtifactFilter filter, String artifactScope )
+ {
+- ArtifactMockAndControl mac = new ArtifactMockAndControl( artifactScope );
++ Artifact artifact = createMockArtifact( artifactScope );
++
++ replay( artifact );
+
+- mockManager.replayAll();
++ assertTrue( "Artifact scope: " + artifactScope + " SHOULD BE included", filter.include( artifact ) );
+
+- assertTrue( "Artifact scope: " + artifactScope + " SHOULD BE included", filter
+- .include( mac.artifact ) );
+-
+- mockManager.verifyAll();
+-
+- // enable multiple calls to this method within a single test.
+- mockManager.clear();
++ verify( artifact );
+ }
+
+ private void verifyExcluded( ScopeArtifactFilter filter, String artifactScope )
+ {
+- ArtifactMockAndControl mac = new ArtifactMockAndControl( artifactScope );
+-
+- mockManager.replayAll();
++ Artifact artifact = createMockArtifact( artifactScope );
++
++ replay( artifact );
+
+- assertFalse( "Artifact scope: " + artifactScope + " SHOULD BE excluded", filter
+- .include( mac.artifact ) );
++ assertFalse( "Artifact scope: " + artifactScope + " SHOULD BE excluded", filter.include( artifact ) );
+
+- mockManager.verifyAll();
+-
+- // enable multiple calls to this method within a single test.
+- mockManager.clear();
++ verify( artifact );
+ }
+
+- private final class ArtifactMockAndControl
++ private Artifact createMockArtifact( String scope )
+ {
+- Artifact artifact;
+-
+- MockControl control;
+-
+- ArtifactMockAndControl( String scope )
+- {
+- control = MockControl.createControl( Artifact.class );
+- mockManager.add( control );
++ Artifact artifact = createMock( Artifact.class );
+
+- artifact = (Artifact) control.getMock();
++ expect( artifact.getScope() ).andReturn( scope ).anyTimes();
++ expect( artifact.getId() ).andReturn( "group:artifact:type:version" ).anyTimes();
++ expect( artifact.getVersionRange() ).andReturn( null ).anyTimes();
+
+- artifact.getScope();
+- control.setReturnValue( scope, MockControl.ZERO_OR_MORE );
+-
+- artifact.getId();
+- control.setReturnValue( "group:artifact:type:version", MockControl.ZERO_OR_MORE );
+-
+- artifact.getVersionRange();
+- control.setReturnValue( null, MockControl.ZERO_OR_MORE );
+- }
++ return artifact;
+ }
+
+ }
Added: trunk/maven-common-artifact-filters/debian/patches/series
===================================================================
--- trunk/maven-common-artifact-filters/debian/patches/series (rev 0)
+++ trunk/maven-common-artifact-filters/debian/patches/series 2013-12-04 14:39:27 UTC (rev 17563)
@@ -0,0 +1 @@
+01_easymock-upgrade.patch
More information about the pkg-java-commits
mailing list