[jmock2] 06/08: Build with Maven instead of Ant

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Tue Sep 27 08:17:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository jmock2.

commit 7413f6026522fb7321b33c80e07f8fa0b841e5fe
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Tue Sep 27 09:40:54 2016 +0200

    Build with Maven instead of Ant
---
 debian/README.source                             |  25 --
 debian/changelog                                 |   5 +-
 debian/control                                   |  16 +-
 debian/libjmock2-java-doc.doc-base               |   9 +
 debian/libjmock2-java-doc.doc-base.javadoc       |   9 -
 debian/libjmock2-java-doc.install                |   1 +
 debian/libjmock2-java.poms                       |  34 +++
 debian/maven.ignoreRules                         |   4 +
 debian/maven.properties                          |   5 +
 debian/maven.rules                               |  10 +-
 debian/patches/00ignore.pc                       |  11 -
 debian/patches/01-fix-expectations-creator.patch |  19 ++
 debian/patches/01buildwithjdk1.6only             |  31 ---
 debian/patches/02buildwithcglib2.2               |  86 -------
 debian/patches/03runtestsagainstsyslibs          |  40 ---
 debian/patches/04javadoc                         |  27 ---
 debian/patches/05hamcrest12.diff                 | 294 -----------------------
 debian/patches/06donthaltonjunitfailure          |  20 --
 debian/patches/07missinghamcrestjar              |  35 ---
 debian/patches/08mavenpoms                       | 160 ------------
 debian/patches/09unmappablecharacters            |  18 --
 debian/patches/series                            |   8 +-
 debian/rules                                     |  44 +---
 23 files changed, 92 insertions(+), 819 deletions(-)

diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644
index f104ab8..0000000
--- a/debian/README.source
+++ /dev/null
@@ -1,25 +0,0 @@
-Information about jmock2
-------------------------
-
- REPACKAGING
-
- To comply with DFSG, the following binary files have been removed from
- upstream tarball:
-
-    lib/bsh-core-*.jar
-    lib/cglib-*-src.jar
-    lib/cglib-nodep-*.jar
-    lib/hamcrest-core-*.jar
-    lib/hamcrest-library-*.jar
-    lib/junit-3.*.jar
-    lib/junit-4.*.jar
-    lib/junit-4.*-src.jar
-    lib/objenesis-*.jar
-    lib/objenesis-*-sources.jar
-
- Upstream also provides maven pom files that we include in Debian tarball.
-
- Please use the get-orig-source target from debian/rules to create the
- orig.tar.gz used for Debian packaging. For more details on repackaging of
- upstream sources please see the debian/orig-tar.sh file.
-
diff --git a/debian/changelog b/debian/changelog
index efb8a90..0c72006 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,9 @@
-jmock2 (2.7~snapshot+201309170925-gitd7fe69b5+dfsg-3) UNRELEASED; urgency=medium
+jmock2 (2.8.2-1) UNRELEASED; urgency=medium
 
   * Team upload.
+  * New upstream release:
+    - Build with Maven instead of Ant
+    - Depend on libcglib-java (>= 3.0), libasm-java (>= 5.0)
   * Standards-Version updated to 3.9.8
   * Use secure Vcs-* URLs
   * debian/watch: Track the new release tags on GitHub
diff --git a/debian/control b/debian/control
index 2efbf48..879e297 100644
--- a/debian/control
+++ b/debian/control
@@ -4,19 +4,18 @@ Priority: optional
 Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
 Uploaders: Gabriele Giacone <1o5g4r8o at gmail.com>, Stephen Nelson <stephen at eccostudio.com>
 Build-Depends:
- ant,
- ant-optional,
- cdbs,
  debhelper (>= 9),
- javahelper (>= 0.29),
- maven-repo-helper
+ maven-debian-helper (>= 2.0)
 Build-Depends-Indep:
  bsh,
  default-jdk,
  junit4,
- libasm4-java,
- libcglib3-java,
+ libasm-java (>= 5.0),
+ libcglib-java (>= 3.0),
  libhamcrest-java (>= 1.3),
+ libmaven-dependency-plugin-java,
+ libmaven-exec-plugin-java,
+ libmaven-javadoc-plugin-java,
  libobjenesis-java
 Standards-Version: 3.9.8
 Vcs-Git: https://anonscm.debian.org/git/pkg-java/jmock2.git
@@ -25,7 +24,8 @@ Homepage: http://www.jmock.org/
 
 Package: libjmock2-java
 Architecture: all
-Depends: ${java:Depends}, ${misc:Depends}, libcglib3-java, libobjenesis-java
+Depends: ${maven:Depends}, ${misc:Depends}
+Suggests: ${maven:OptionalDepends}
 Description: Java library for testing code with mock objects
  Mock objects help you design and test the interactions between the objects in
  your programs.
diff --git a/debian/libjmock2-java-doc.doc-base b/debian/libjmock2-java-doc.doc-base
new file mode 100644
index 0000000..0998813
--- /dev/null
+++ b/debian/libjmock2-java-doc.doc-base
@@ -0,0 +1,9 @@
+Document: libjmock2-java-doc
+Title: API JavaDoc for libjmock2-java-doc
+Author: 
+Abstract: This the API JavaDoc for libjmock2-java
+Section: Programming/Java
+
+Format: HTML
+Index: /usr/share/doc/libjmock2-java/api
+Files: /usr/share/doc/libjmock2-java/api/*.html
diff --git a/debian/libjmock2-java-doc.doc-base.javadoc b/debian/libjmock2-java-doc.doc-base.javadoc
deleted file mode 100644
index 48ea80a..0000000
--- a/debian/libjmock2-java-doc.doc-base.javadoc
+++ /dev/null
@@ -1,9 +0,0 @@
-Document: libjmock2-java-doc
-Title: API JavaDoc for libjmock2-java-doc
-Author: 
-Abstract: This the API JavaDoc for libjmock2-java-doc
-Section: Programming/Java
-
-Format: HTML
-Index: /usr/share/doc/libjmock2-java-doc/api
-Files: /usr/share/doc/libjmock2-java-doc/api/*.html
diff --git a/debian/libjmock2-java-doc.install b/debian/libjmock2-java-doc.install
new file mode 100644
index 0000000..fe2d9bc
--- /dev/null
+++ b/debian/libjmock2-java-doc.install
@@ -0,0 +1 @@
+target/site/apidocs/* usr/share/doc/libjmock2-java/api
diff --git a/debian/libjmock2-java.poms b/debian/libjmock2-java.poms
new file mode 100644
index 0000000..226e1a0
--- /dev/null
+++ b/debian/libjmock2-java.poms
@@ -0,0 +1,34 @@
+# List of POM files for the package
+# Format of this file is:
+# <path to pom file> [option]*
+# where option can be:
+#   --ignore: ignore this POM and its artifact if any
+#   --ignore-pom: don't install the POM. To use on POM files that are created
+#     temporarily for certain artifacts such as Javadoc jars. [mh_install, mh_installpoms]
+#   --no-parent: remove the <parent> tag from the POM
+#   --package=<package>: an alternative package to use when installing this POM
+#      and its artifact
+#   --has-package-version: to indicate that the original version of the POM is the same as the upstream part
+#      of the version for the package.
+#   --keep-elements=<elem1,elem2>: a list of XML elements to keep in the POM
+#      during a clean operation with mh_cleanpom or mh_installpom
+#   --artifact=<path>: path to the build artifact associated with this POM,
+#      it will be installed when using the command mh_install. [mh_install]
+#   --java-lib: install the jar into /usr/share/java to comply with Debian
+#      packaging guidelines
+#   --usj-name=<name>: name to use when installing the library in /usr/share/java
+#   --usj-version=<version>: version to use when installing the library in /usr/share/java
+#   --no-usj-versionless: don't install the versionless link in /usr/share/java
+#   --dest-jar=<path>: the destination for the real jar.
+#     It will be installed with mh_install. [mh_install]
+#   --classifier=<classifier>: Optional, the classifier for the jar. Empty by default.
+#   --site-xml=<location>: Optional, the location for site.xml if it needs to be installed.
+#     Empty by default. [mh_install]
+#
+pom.xml --no-parent --has-package-version
+jmock-example/pom.xml --ignore
+jmock/pom.xml        --has-package-version --java-lib --relocate=jmock:jmock
+jmock-junit3/pom.xml --has-package-version --java-lib --relocate=jmock:jmock-junit3
+jmock-junit4/pom.xml --has-package-version --java-lib --relocate=jmock:jmock-junit4
+jmock-legacy/pom.xml --has-package-version --java-lib --relocate=jmock:jmock-legacy
+testjar/pom.xml --has-package-version
diff --git a/debian/maven.ignoreRules b/debian/maven.ignoreRules
new file mode 100644
index 0000000..b664f97
--- /dev/null
+++ b/debian/maven.ignoreRules
@@ -0,0 +1,4 @@
+
+org.jmock jmock test-jar * * *
+org.apache.maven.plugins maven-gpg-plugin * * * *
+org.sonatype.plugins nexus-staging-maven-plugin * * * *
diff --git a/debian/maven.properties b/debian/maven.properties
new file mode 100644
index 0000000..e593715
--- /dev/null
+++ b/debian/maven.properties
@@ -0,0 +1,5 @@
+# Include here properties to pass to Maven during the build.
+# For example:
+# maven.test.skip=true
+
+maven.test.skip=true
diff --git a/debian/maven.rules b/debian/maven.rules
index c72e70e..236c8f4 100644
--- a/debian/maven.rules
+++ b/debian/maven.rules
@@ -1,7 +1,5 @@
-s/org.jmock/jmock/ jmock* jar s/2\..*/2.x/ * *
-junit s/junit-dep/junit/ jar s/.*/4.x/ * *
-cglib s/cglib-nodep/cglib/ jar s/.*/3.x/ * *
-org.objenesis objenesis jar s/.*/debian/ * *
+
 junit junit jar s/3\..*/3.x/ * *
-org.beanshell bsh jar s/.*/debian/ * *
-org.hamcrest * jar  s/.*/debian/ * *
+junit junit jar s/4\..*/4.x/ * *
+org.jmock jmock test-jar * * *
+org.jmock jmock* jar s/2\..*/2.x/ * *
diff --git a/debian/patches/00ignore.pc b/debian/patches/00ignore.pc
deleted file mode 100644
index 5599527..0000000
--- a/debian/patches/00ignore.pc
+++ /dev/null
@@ -1,11 +0,0 @@
-Description: Ignores .pc directory
-Author: Gabriele Giacone <1o5g4r8o at gmail.com>
-
---- a/build.xml
-+++ b/build.xml
-@@ -1,4 +1,5 @@
- <project name="jMock 2" default="build">
-+        <defaultexcludes add=".pc/**"/>
- 	<property name="version" value="2.7-SNAPSHOT"/>
- 	<property name="hamcrest.version" value="1.3" />
- 	<property name="distdir" value="build/jmock-${version}"/>
diff --git a/debian/patches/01-fix-expectations-creator.patch b/debian/patches/01-fix-expectations-creator.patch
new file mode 100644
index 0000000..b88db40
--- /dev/null
+++ b/debian/patches/01-fix-expectations-creator.patch
@@ -0,0 +1,19 @@
+Description: Fixes the invocation of the exec plugin during the build
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: not-needed
+--- a/jmock/pom.xml
++++ b/jmock/pom.xml
+@@ -80,8 +80,11 @@
+                     <!-- java -cp ~/.m2/repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar:~.m2/repository/org/ow2/asm/asm-util/4.1/asm-util-4.1.jar 
+                         org.objectweb.asm.util.ASMifier target/classes/org/jmock/Expectations.class 
+                         > Xpectations.java -->
+-                    <commandlineArgs>-cp %classpath:target/classes
+-                        org.jmock.ExpectationsCreator</commandlineArgs>
++                    <arguments>
++                        <argument>-cp</argument>
++                        <argument>/usr/share/java/asm-all.jar:target/classes</argument>
++                        <argument>org.jmock.ExpectationsCreator</argument>
++                    </arguments>
+                 </configuration>
+             </plugin>
+ 
diff --git a/debian/patches/01buildwithjdk1.6only b/debian/patches/01buildwithjdk1.6only
deleted file mode 100644
index 8cab1f5..0000000
--- a/debian/patches/01buildwithjdk1.6only
+++ /dev/null
@@ -1,31 +0,0 @@
-Description: To build with JDK 1.6 only
-Origin: upstream, http://svn.jmock.codehaus.org/changelog/jmock/?cs=1370
-
---- a/src/org/jmock/lib/concurrent/DeterministicScheduler.java
-+++ b/src/org/jmock/lib/concurrent/DeterministicScheduler.java
-@@ -110,21 +110,21 @@
-         throw blockingOperationsNotSupported();
-     }
- 
--    public <T> List<Future<T>> invokeAll(Collection<Callable<T>> tasks) throws InterruptedException {
-+    public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException {
-         throw blockingOperationsNotSupported();
-     }
- 
--    public <T> List<Future<T>> invokeAll(Collection<Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException {
-+    public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException {
-         throw blockingOperationsNotSupported();
-     }
-     
--    public <T> T invokeAny(Collection<Callable<T>> tasks)
-+    public <T> T invokeAny(Collection<? extends Callable<T>> tasks)
-         throws InterruptedException, ExecutionException 
-     {
-         throw blockingOperationsNotSupported();
-     }
- 
--    public <T> T invokeAny(Collection<Callable<T>> tasks, long timeout, TimeUnit unit) 
-+    public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) 
-         throws InterruptedException, ExecutionException, TimeoutException 
-     {
-         throw blockingOperationsNotSupported();
diff --git a/debian/patches/02buildwithcglib2.2 b/debian/patches/02buildwithcglib2.2
deleted file mode 100644
index cddc252..0000000
--- a/debian/patches/02buildwithcglib2.2
+++ /dev/null
@@ -1,86 +0,0 @@
-Description: To build with cglib2.2
-Origin: upstream, http://svn.jmock.codehaus.org/changelog/jmock/?cs=1317
-
---- jmock2-2.5.1+dfsg.orig/test/org/jmock/test/unit/support/SyntheticEmptyInterfaceClassLoader.java
-+++ jmock2-2.5.1+dfsg/test/org/jmock/test/unit/support/SyntheticEmptyInterfaceClassLoader.java
-@@ -3,9 +3,11 @@
-  */
- package org.jmock.test.unit.support;
- 
-+import static org.jmock.test.unit.support.MethodFactory.CLASS_FORMAT_VERSION;
-+
- import java.util.regex.Pattern;
- 
--import net.sf.cglib.asm.ClassWriter;
-+import org.objectweb.asm.ClassWriter;
- import net.sf.cglib.core.Constants;
- 
- public class SyntheticEmptyInterfaceClassLoader extends ClassLoader {
-@@ -30,13 +32,15 @@ public class SyntheticEmptyInterfaceClas
-     }
- 
-     private Class<?> synthesiseInterface(String name) throws ClassFormatError {
--        ClassWriter writer = new ClassWriter(true);
--        writer.visit(MethodFactory.CLASS_FORMAT_VERSION,
--                     Constants.ACC_PUBLIC | Constants.ACC_INTERFACE,
--                     name.replace('.', '/'),
--                     "java/lang/Object",
--                     null, /* interfaces */
--                     null /* source file */);
-+        ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
-+                writer.visit(CLASS_FORMAT_VERSION,
-+                             Constants.ACC_PUBLIC|Constants.ACC_INTERFACE,
-+                             MethodFactory.nameToClassFormat(name),
-+                             null,
-+                             "java/lang/Object",
-+                             null /* interfaces */);
-+         
-+
-         
-         byte[] b = writer.toByteArray();
- 
---- jmock2-2.5.1+dfsg.orig/test/org/jmock/test/unit/support/MethodFactory.java
-+++ jmock2-2.5.1+dfsg/test/org/jmock/test/unit/support/MethodFactory.java
-@@ -4,13 +4,13 @@ package org.jmock.test.unit.support;
- 
- import java.lang.reflect.Method;
- 
--import net.sf.cglib.asm.ClassWriter;
--import net.sf.cglib.asm.Type;
-+import org.objectweb.asm.ClassWriter;
-+import org.objectweb.asm.Type;
- import net.sf.cglib.core.Constants;
- 
- 
- public class MethodFactory extends ClassLoader {
--    public static final int CLASS_FORMAT_VERSION = 45;
-+    public static final int CLASS_FORMAT_VERSION = 49;
-     
-     public static Class<?>[] NO_ARGUMENTS = {};
-     public static Class<?>[] NO_EXCEPTIONS = {};
-@@ -33,20 +33,20 @@ public class MethodFactory extends Class
-         {
-             @Override
-             protected Class<?> findClass( String interfaceName ) {
--                ClassWriter writer = new ClassWriter(true);
-+                ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
- 
-                 writer.visit(CLASS_FORMAT_VERSION,
-                              Constants.ACC_PUBLIC|Constants.ACC_INTERFACE,
-                              nameToClassFormat(interfaceName),
-+                             null,
-                              "java/lang/Object",
--                             null, /* interfaces */
--                             null  /* source file */);
-+                             null /* interfaces */);
- 
-                 writer.visitMethod(Constants.ACC_PUBLIC | Constants.ACC_ABSTRACT,
-                                    methodName,
-                                    methodDescriptor(returnType, argTypes),
--                                   classNamesInClassFormat(exceptionTypes),
--                                   null /* no attributes */);
-+                                   null,
-+                                   classNamesInClassFormat(exceptionTypes));
- 
-                 byte[] classAsBytes = writer.toByteArray();
- 
diff --git a/debian/patches/03runtestsagainstsyslibs b/debian/patches/03runtestsagainstsyslibs
deleted file mode 100644
index aa21bf0..0000000
--- a/debian/patches/03runtestsagainstsyslibs
+++ /dev/null
@@ -1,40 +0,0 @@
-Description: Runs tests against system libraries
-Author: Gabriele Giacone <1o5g4r8o at gmail.com>
-
---- a/build.xml
-+++ b/build.xml
-@@ -6,6 +6,12 @@
- 
- 	<path id="build.classpath">
- 		<fileset dir="lib" includes="*.jar" excludes="*-src.jar"/>
-+		<fileset dir="/usr/share/java" includes="hamcrest-core.jar"/>
-+                <fileset dir="/usr/share/java" includes="hamcrest-library.jar"/>
-+                <fileset dir="/usr/share/java" includes="cglib3-nodep.jar"/>
-+                <fileset dir="/usr/share/java" includes="objenesis.jar"/>
-+                <fileset dir="/usr/share/java" includes="junit4.jar"/>
-+                <fileset dir="/usr/share/java" includes="bsh.jar"/>    
- 	</path>
- 
- 	<target name="build"
-@@ -57,8 +63,8 @@
- 			   sourcepath="src;test;example;testdata-classes"
- 			   debug="yes"
- 			   failonerror="yes"
--			   source="1.5" 
--			   target="1.5"
-+			   source="1.6" 
-+			   target="1.6"
- 			   excludes="testdata/**"/>
- 	</target>
- 
-@@ -172,8 +178,8 @@
- 		       srcdir="testdata"
- 			   debug="yes"
- 			   failonerror="yes"
--		       source="1.5" 
--		       target="1.5"/>
-+		       source="1.6" 
-+		       target="1.6"/>
- 	</target>
- 	
- 	<target name="testdata.unsigned-jar" depends="testdata.classes">
diff --git a/debian/patches/04javadoc b/debian/patches/04javadoc
deleted file mode 100644
index 2a92b53..0000000
--- a/debian/patches/04javadoc
+++ /dev/null
@@ -1,27 +0,0 @@
-Description: To use Javadoc from upstream
-Author: Gabriele Giacone <1o5g4r8o at gmail.com>
-
---- a/build.xml
-+++ b/build.xml
-@@ -201,11 +201,9 @@
- 	
- 	<target name="javadoc" depends="dir.dist">
- 		<mkdir dir="build/extract/hamcrest-api"/>
--		<unzip src="lib/hamcrest-core-${hamcrest.version}.jar" dest="build/extract/hamcrest-api"/>
--		<unzip src="lib/hamcrest-library-${hamcrest.version}.jar" dest="build/extract/hamcrest-api"/>
- 
- 		<mkdir dir="${distdir}/doc"/>
--		<javadoc destdir="${distdir}/doc" source="1.5" failonerror="yes"
-+		<javadoc destdir="${distdir}/doc" source="1.6" failonerror="yes"
- 			classpathref="build.classpath"
- 			overview="src/overview.html">
- 
-@@ -217,8 +215,6 @@
- 			</packageset>
- 			
- 			<group title="jMock 2" packages="org.jmock, org.jmock.*"/>
--			<group title="Hamcrest API" packages="org.hamcrest"/>
--			<group title="Hamcrest Matcher Library" packages="org.hamcrest.*"/>
- 
-             <link offline="true" href="http://www.junit.org/junit/javadoc_40/"
-                   packagelistloc="javadoc-lists/junit-4.11"/>
diff --git a/debian/patches/05hamcrest12.diff b/debian/patches/05hamcrest12.diff
deleted file mode 100644
index 682ac58..0000000
--- a/debian/patches/05hamcrest12.diff
+++ /dev/null
@@ -1,294 +0,0 @@
-Description: Change API to support Hamcrest 1.2
- Backport changes from upstream JMock 2.6.0
-Author: Damien Raude-Morvan <drazzib at debian.org>
-Last-Update: 2012-07-18
-Forwarded: not-needed
---- a/src/org/jmock/Expectations.java
-+++ b/src/org/jmock/Expectations.java
-@@ -184,39 +184,48 @@
-     }
-     
-     public boolean with(boolean value) {
--        return with(equalTo(value));
-+        addParameterMatcher(equal(value));
-+        return false;
-     }
-     
-     public byte with(byte value) {
--        return with(equalTo(value));
-+        addParameterMatcher(equal(value));
-+        return 0;
-     }
-     
-     public short with(short value) {
--        return with(equalTo(value));
-+        addParameterMatcher(equal(value));
-+        return 0;
-     }
-     
-     public char with(char value) {
--        return with(equalTo(value));
-+        addParameterMatcher(equal(value));
-+        return 0;
-     }
-     
-     public int with(int value) {
--        return with(equalTo(value));
-+        addParameterMatcher(equal(value));
-+        return 0;
-     }
-     
-     public long with(long value) {
--        return with(equalTo(value));
-+        addParameterMatcher(equal(value));
-+        return 0;
-     }
-     
-     public float with(float value) {
--        return with(equalTo(value));
-+        addParameterMatcher(equal(value));
-+        return 0;
-     }
-     
-     public double with(double value) {
--        return with(equalTo(value));
-+        addParameterMatcher(equal(value));
-+        return 0;
-     }
-     
-     public <T> T with(T value) {
--        return with(equalTo(value));
-+        addParameterMatcher(equal(value));
-+        return value;
-     }
-     
-     public void will(Action action) {
---- a/src/org/jmock/internal/InvocationExpectation.java
-+++ b/src/org/jmock/internal/InvocationExpectation.java
-@@ -10,6 +10,7 @@
- import org.jmock.api.Action;
- import org.jmock.api.Expectation;
- import org.jmock.api.Invocation;
-+import org.jmock.internal.matcher.MethodMatcher;
- import org.jmock.lib.action.VoidAction;
- 
- /** 
-@@ -19,10 +20,11 @@
-  * @author smgf
-  */
- public class InvocationExpectation implements Expectation {
-+    private static ParametersMatcher ANY_PARAMETERS = new AnyParametersMatcher();
-     private Cardinality cardinality = Cardinality.ALLOWING;
- 	private Matcher<?> objectMatcher = IsAnything.anything();
--	private Matcher<Method> methodMatcher = IsAnything.anything("<any method>");
--	private Matcher<Object[]> parametersMatcher = IsAnything.anything("(<any parameters>)");
-+	private Matcher<? super Method> methodMatcher = IsAnything.anything("<any method>");
-+	private ParametersMatcher parametersMatcher = ANY_PARAMETERS;
-     private Action action = new VoidAction();
-     private List<OrderingConstraint> orderingConstraints = new ArrayList<OrderingConstraint>();
-     private List<SideEffect> sideEffects = new ArrayList<SideEffect>();
-@@ -36,12 +38,16 @@
- 	public void setObjectMatcher(Matcher<?> objectMatcher) {
- 		this.objectMatcher = objectMatcher;
- 	}
-+
-+	public void setMethod(Method method) {
-+	    this.methodMatcher = new MethodMatcher(method);
-+	}
- 	
--	public void setMethodMatcher(Matcher<Method> methodMatcher) {
--		this.methodMatcher = methodMatcher;
-+	public void setMethodMatcher(Matcher<? super Method> matcher) {
-+		this.methodMatcher = matcher;
- 	}
- 	
--	public void setParametersMatcher(Matcher<Object[]> parametersMatcher) {
-+	public void setParametersMatcher(ParametersMatcher parametersMatcher) {
- 		this.parametersMatcher = parametersMatcher;
- 	}
- 
-@@ -121,4 +127,14 @@
-             sideEffect.perform();
-         }
-     }
-+
-+    private static class AnyParametersMatcher extends IsAnything<Object[]> implements ParametersMatcher {
-+        public AnyParametersMatcher() {
-+            super("(<any parameters>)");
-+        }
-+
-+        public boolean isCompatibleWith(Object[] parameters) {
-+            return true;
-+        }
-+    };
- }
---- a/src/org/jmock/internal/InvocationExpectationBuilder.java
-+++ b/src/org/jmock/internal/InvocationExpectationBuilder.java
-@@ -10,10 +10,9 @@
- import org.jmock.api.Action;
- import org.jmock.api.Expectation;
- import org.jmock.api.Invocation;
--import org.jmock.internal.matcher.MethodMatcher;
- import org.jmock.internal.matcher.MethodNameMatcher;
- import org.jmock.internal.matcher.MockObjectMatcher;
--import org.jmock.internal.matcher.ParametersMatcher;
-+import org.jmock.internal.matcher.AllParametersMatcher;
- import org.jmock.syntax.MethodClause;
- import org.jmock.syntax.ParametersClause;
- import org.jmock.syntax.ReceiverClause;
-@@ -83,14 +82,14 @@
-     }
-     
-     public void createExpectationFrom(Invocation invocation) {
--        expectation.setMethodMatcher(new MethodMatcher(invocation.getInvokedMethod()));
-+        expectation.setMethod(invocation.getInvokedMethod());
-         
-         if (capturedParameterMatchers.isEmpty()) {
--            expectation.setParametersMatcher(new ParametersMatcher(invocation.getParametersAsArray()));
-+            expectation.setParametersMatcher(new AllParametersMatcher(invocation.getParametersAsArray()));
-         }
-         else {
-             checkParameterMatcherCount(invocation);
--            expectation.setParametersMatcher(new ParametersMatcher(capturedParameterMatchers));
-+            expectation.setParametersMatcher(new AllParametersMatcher(capturedParameterMatchers));
-         }
-     }
-     
-@@ -130,7 +129,7 @@
-     }
-     
-     public void with(Matcher<?>... parameterMatchers) {
--        expectation.setParametersMatcher(new ParametersMatcher(Arrays.asList(parameterMatchers)));
-+        expectation.setParametersMatcher(new AllParametersMatcher(Arrays.asList(parameterMatchers)));
-     }
-     
-     public void withNoArguments() {
---- /dev/null
-+++ b/src/org/jmock/internal/ParametersMatcher.java
-@@ -0,0 +1,12 @@
-+package org.jmock.internal;
-+
-+import org.hamcrest.Matcher;
-+
-+public interface ParametersMatcher extends Matcher<Object[]> {
-+    /**
-+     * Is this matcher likely to be relevant to the given parameters?
-+     * @param parameters The parameters to be matched
-+     * @return true iff the parameters may be relevant.
-+     */
-+    boolean isCompatibleWith(Object[] parameters);
-+}
---- /dev/null
-+++ b/src/org/jmock/internal/matcher/AllParametersMatcher.java
-@@ -0,0 +1,80 @@
-+package org.jmock.internal.matcher;
-+
-+import static java.util.Arrays.asList;
-+
-+import java.util.List;
-+
-+import org.hamcrest.Description;
-+import org.hamcrest.Matcher;
-+import org.hamcrest.TypeSafeDiagnosingMatcher;
-+import org.hamcrest.core.IsEqual;
-+import org.jmock.internal.ParametersMatcher;
-+
-+public class AllParametersMatcher extends TypeSafeDiagnosingMatcher<Object[]>  implements ParametersMatcher {
-+    private final Matcher<Object>[] elementMatchers;
-+
-+    public AllParametersMatcher(Object[] expectedValues) {
-+        this.elementMatchers =  equalMatchersFor(expectedValues);
-+    }
-+
-+    @SuppressWarnings("unchecked")
-+    public AllParametersMatcher(List<Matcher<?>> parameterMatchers) {
-+        this.elementMatchers = parameterMatchers.toArray(new Matcher[0]);
-+    }
-+
-+    public boolean isCompatibleWith(Object[] parameters) {
-+        return elementMatchers.length == parameters.length;
-+    }
-+
-+    @Override
-+    public boolean matchesSafely(Object[] parameters, Description mismatch) {
-+        return matchesNumberOfParameters(parameters, mismatch)
-+            && matchesParameters(parameters, mismatch);
-+    }
-+
-+    private boolean matchesNumberOfParameters(Object[] parameters, Description mismatch) {
-+        if (elementMatchers.length != parameters.length) {
-+            mismatch.appendText("wrong number of parameters: ")
-+                    .appendValue(parameters);
-+            return false;
-+        }
-+        return true;
-+    }
-+
-+    private boolean matchesParameters(Object[] parameters, Description mismatch) {
-+        boolean result = true;
-+        for (int i = 0; i < parameters.length; i++) {
-+            result &= matchesParameter(parameters[i], elementMatchers[i], mismatch, i);
-+        }
-+        return result;
-+    }
-+
-+    private boolean matchesParameter(final Object value, final Matcher<Object> matcher, Description mismatch, int index) {
-+        mismatch.appendText("\n      parameter " + index + " ");
-+        final boolean parameterMatches = matcher.matches(value);
-+        if (parameterMatches) {
-+            mismatch.appendText("matched: ").appendDescriptionOf(matcher);
-+        } else {
-+            mismatch.appendText("did not match: ")
-+                .appendDescriptionOf(matcher)
-+                .appendText(", because ");
-+            matcher.describeMismatch(value, mismatch);
-+        }
-+        return parameterMatches;
-+    }
-+
-+    public void describeTo(Description description) {
-+        description.appendList("(", ", ",")", asList(elementMatchers));
-+    }
-+
-+    @SuppressWarnings("unchecked")
-+    private static Matcher<Object>[] equalMatchersFor(Object[] expectedValues) {
-+        Matcher<Object>[] matchers = new Matcher[expectedValues.length];
-+        for (int i = 0; i < expectedValues.length; i++) {
-+            matchers[i] = new IsEqual<Object>(expectedValues[i]);
-+        }
-+        return matchers;
-+    }
-+
-+}
-+
---- a/test/org/jmock/test/acceptance/HamcrestTypeSafetyAcceptanceTests.java
-+++ b/test/org/jmock/test/acceptance/HamcrestTypeSafetyAcceptanceTests.java
-@@ -1,7 +1,7 @@
- package org.jmock.test.acceptance;
- 
--import static org.hamcrest.number.OrderingComparisons.greaterThan;
--import static org.hamcrest.text.StringStartsWith.startsWith;
-+import static org.hamcrest.CoreMatchers.startsWith;
-+import static org.hamcrest.number.OrderingComparison.greaterThan;
- 
- import java.lang.reflect.Method;
- 
---- a/test/org/jmock/test/unit/internal/InvocationExpectationTests.java
-+++ b/test/org/jmock/test/unit/internal/InvocationExpectationTests.java
-@@ -16,6 +16,7 @@
- import org.jmock.internal.InvocationExpectation;
- import org.jmock.internal.OrderingConstraint;
- import org.jmock.internal.SideEffect;
-+import org.jmock.internal.matcher.AllParametersMatcher;
- import org.jmock.lib.action.ReturnValueAction;
- import org.jmock.test.unit.support.AssertThat;
- import org.jmock.test.unit.support.MethodFactory;
-@@ -72,7 +73,7 @@
- 		Object[] differentArgCount = {1,2,3};
- 		Object[] noArgs = null;
- 		
--		expectation.setParametersMatcher(equalTo(args));
-+		expectation.setParametersMatcher(new AllParametersMatcher(args));
- 		
- 		assertTrue("should match", expectation.matches(new Invocation(targetObject, method, args)));
- 		assertTrue("should not match", !expectation.matches(new Invocation(targetObject, method, differentArgs)));
diff --git a/debian/patches/06donthaltonjunitfailure b/debian/patches/06donthaltonjunitfailure
deleted file mode 100644
index 3a96951..0000000
--- a/debian/patches/06donthaltonjunitfailure
+++ /dev/null
@@ -1,20 +0,0 @@
-Description: Don't halt build process if/when junit fails
- Some tests were failing with warnings like these:
- "the Mockery is not thread-safe".
- The issue seems to be already reported on upstream bugtracker:
- https://github.com/jmock-developers/jmock-library/issues/39
-Author: Miguel Landaeta <miguel at miguel.cc>
-Forwarded: no
-Last-Update: 2013-09-29
-
---- jmock2-2.7~snapshot201309170925+dfsg.orig/build.xml
-+++ jmock2-2.7~snapshot201309170925+dfsg/build.xml
-@@ -238,7 +238,7 @@
- 			
- 			<formatter type="brief" usefile="no"/>
- 			
--			<batchtest haltonfailure="yes">
-+			<batchtest haltonfailure="no">
- 				<fileset dir="test">
- 					<include name="**/*Tests.java"/>
- 					<exclude name="**/Abstract*"/>
diff --git a/debian/patches/07missinghamcrestjar b/debian/patches/07missinghamcrestjar
deleted file mode 100644
index 60edb0e..0000000
--- a/debian/patches/07missinghamcrestjar
+++ /dev/null
@@ -1,35 +0,0 @@
-Description: Disable code not included in Debian hamcrest package
- libhamcrest-java package is not including hamcrest-unit-test.jar
- For this reason, I had to disable some tests including features
- provided by that .jar.
-Author: Miguel Landaeta <miguel at miguel.cc>
-Forwarded: no
-Last-Update: 2013-09-29
-
---- jmock2-2.7~snapshot201309170925+dfsg.orig/test/org/jmock/test/unit/lib/CurrentStateMatcherTests.java
-+++ jmock2-2.7~snapshot201309170925+dfsg/test/org/jmock/test/unit/lib/CurrentStateMatcherTests.java
-@@ -4,13 +4,16 @@ import static org.hamcrest.StringDescrip
- import static org.jmock.lib.CurrentStateMatcher.isCurrently;
- import static org.jmock.lib.CurrentStateMatcher.isNotCurrently;
- 
--import org.hamcrest.AbstractMatcherTest;
-+// hamcrest-unit-test.jar is not available yet on Debian, see #724950
-+//import org.hamcrest.AbstractMatcherTest;
- import org.hamcrest.Matcher;
- import org.jmock.States;
- import org.jmock.internal.StateMachine;
- 
- 
--public class CurrentStateMatcherTests extends AbstractMatcherTest {
-+//public class CurrentStateMatcherTests extends AbstractMatcherTest {
-+public class CurrentStateMatcherTests {
-+/*
-     States stateMachine = new StateMachine("stateMachine");
-     Matcher<States> isCurrentlyS = isCurrently("S");
-     Matcher<States> isNotCurrentlyS = isNotCurrently("S");
-@@ -57,4 +60,5 @@ public class CurrentStateMatcherTests ex
-     protected Matcher<?> createMatcher() {
-         return isCurrentlyS;
-     }
-+*/
- }
diff --git a/debian/patches/08mavenpoms b/debian/patches/08mavenpoms
deleted file mode 100644
index cf5a14b..0000000
--- a/debian/patches/08mavenpoms
+++ /dev/null
@@ -1,160 +0,0 @@
-Description: Include Maven POM files
- Upstream is not including POM files in the source code.
- I implemented a get-orig-pom to fetch those files from the
- Maven central repo. Those downloaded files are included in
- this patch. Since 2.7-SNAPSHOT doesn't have published Maven
- artifacts, I had to work with 2.6.0 files.
-Author: Miguel Landaeta <miguel at miguel.cc>
-Forwarded: no
-Last-Update: 2013-09-29
-
---- /dev/null
-+++ jmock2-2.7~snapshot+201309170925-gitd7fe69b5+dfsg/maven/jmock-junit3/pom.xml
-@@ -0,0 +1,25 @@
-+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-+    <modelVersion>4.0.0</modelVersion>
-+    <parent>
-+        <groupId>org.jmock</groupId>
-+        <artifactId>jmock-parent</artifactId>
-+        <version>2.7-SNAPSHOT</version>
-+    </parent>
-+    <artifactId>jmock-junit3</artifactId>
-+    <packaging>jar</packaging>
-+    <name>jMock JUnit 3 Extension</name>
-+
-+    <dependencies>
-+        <dependency>
-+            <groupId>${pom.groupId}</groupId>
-+            <artifactId>jmock</artifactId>
-+            <version>${pom.version}</version>
-+        </dependency>
-+        <dependency>
-+            <groupId>junit</groupId>
-+            <artifactId>junit</artifactId>
-+            <version>3.8.2</version>
-+        </dependency>
-+    </dependencies>
-+
-+</project>
---- /dev/null
-+++ jmock2-2.7~snapshot+201309170925-gitd7fe69b5+dfsg/maven/jmock-junit4/pom.xml
-@@ -0,0 +1,31 @@
-+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-+    <modelVersion>4.0.0</modelVersion>
-+    <parent>
-+        <groupId>org.jmock</groupId>
-+        <artifactId>jmock-parent</artifactId>
-+        <version>2.7-SNAPSHOT</version>
-+    </parent>
-+    <artifactId>jmock-junit4</artifactId>
-+    <packaging>jar</packaging>
-+    <name>jMock JUnit 4 Extension</name>
-+
-+    <dependencies>
-+        <dependency>
-+            <groupId>${pom.groupId}</groupId>
-+            <artifactId>jmock</artifactId>
-+            <version>${pom.version}</version>
-+        </dependency>
-+        <dependency>
-+            <groupId>junit</groupId>
-+            <artifactId>junit-dep</artifactId>
-+            <version>4.4</version>
-+            <exclusions>
-+                <exclusion> <!-- Excluded as already a transitive dep of jmock -->
-+                    <groupId>org.hamcrest</groupId>
-+                    <artifactId>hamcrest-core</artifactId>
-+                </exclusion>
-+            </exclusions>
-+        </dependency>
-+    </dependencies>
-+
-+</project>
---- /dev/null
-+++ jmock2-2.7~snapshot+201309170925-gitd7fe69b5+dfsg/maven/jmock-legacy/pom.xml
-@@ -0,0 +1,30 @@
-+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-+    <modelVersion>4.0.0</modelVersion>
-+    <parent>
-+        <groupId>org.jmock</groupId>
-+        <artifactId>jmock-parent</artifactId>
-+        <version>2.7-SNAPSHOT</version>
-+    </parent>
-+    <artifactId>jmock-legacy</artifactId>
-+    <packaging>jar</packaging>
-+    <name>jMock Legacy Extension</name>
-+
-+    <dependencies>
-+        <dependency>
-+            <groupId>${pom.groupId}</groupId>
-+            <artifactId>jmock</artifactId>
-+            <version>${pom.version}</version>
-+        </dependency>
-+        <dependency>
-+            <groupId>org.objenesis</groupId>
-+            <artifactId>objenesis</artifactId>
-+            <version>1.0</version>
-+        </dependency>
-+        <dependency>
-+            <groupId>cglib</groupId>
-+            <artifactId>cglib-nodep</artifactId>
-+            <version>3.1</version>
-+        </dependency>
-+    </dependencies>
-+
-+</project>
---- /dev/null
-+++ jmock2-2.7~snapshot+201309170925-gitd7fe69b5+dfsg/maven/jmock-script/pom.xml
-@@ -0,0 +1,23 @@
-+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-+    <modelVersion>4.0.0</modelVersion>
-+    <parent>
-+        <groupId>org.jmock</groupId>
-+        <artifactId>jmock-parent</artifactId>
-+        <version>2.7-SNAPSHOT</version>
-+    </parent>
-+    <artifactId>jmock-script</artifactId>
-+    <packaging>jar</packaging>
-+    <name>jMock Script Extension</name>
-+    <dependencies>
-+        <dependency>
-+            <groupId>${pom.groupId}</groupId>
-+            <artifactId>jmock</artifactId>
-+            <version>${pom.version}</version>
-+        </dependency>
-+        <dependency>
-+            <groupId>org.beanshell</groupId>
-+            <artifactId>bsh</artifactId>
-+            <version>2.0b4</version>
-+        </dependency>
-+    </dependencies>
-+</project>
-\ No newline at end of file
---- /dev/null
-+++ jmock2-2.7~snapshot+201309170925-gitd7fe69b5+dfsg/maven/jmock/pom.xml
-@@ -0,0 +1,25 @@
-+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-+    <modelVersion>4.0.0</modelVersion>
-+    <parent>
-+        <groupId>org.jmock</groupId>
-+        <artifactId>jmock-parent</artifactId>
-+        <version>2.7-SNAPSHOT</version>
-+    </parent>
-+    <artifactId>jmock</artifactId>
-+    <packaging>jar</packaging>
-+    <name>jMock 2 Core</name>
-+
-+    <dependencies>
-+        <dependency>
-+            <groupId>org.hamcrest</groupId>
-+            <artifactId>hamcrest-core</artifactId>
-+            <version>1.1</version>
-+        </dependency>
-+        <dependency>
-+            <groupId>org.hamcrest</groupId>
-+            <artifactId>hamcrest-library</artifactId>
-+            <version>1.1</version>
-+        </dependency>
-+    </dependencies>
-+
-+</project>
diff --git a/debian/patches/09unmappablecharacters b/debian/patches/09unmappablecharacters
deleted file mode 100644
index 88c5d3a..0000000
--- a/debian/patches/09unmappablecharacters
+++ /dev/null
@@ -1,18 +0,0 @@
-Description: Fix unmappable character
-  The pound symbol was not valid ascii so it was replaced
-  by the unicode character.
-Author: Stephen Nelson <stephen at eccostudio.com> 
-Forwarded: no
-Last-Update: 2013-10-03
-
---- a/example/org/jmock/example/sniper/Money.java
-+++ b/example/org/jmock/example/sniper/Money.java
-@@ -27,7 +27,7 @@
- 
-     @Override
-     public String toString() {
--        return "£" + amount;
-+        return "\u00a3" + amount;
-     }
- 
-     @Override
diff --git a/debian/patches/series b/debian/patches/series
index 40fe8b7..41b4fee 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1 @@
-00ignore.pc
-03runtestsagainstsyslibs
-04javadoc
-06donthaltonjunitfailure
-07missinghamcrestjar
-08mavenpoms
-09unmappablecharacters
+01-fix-expectations-creator.patch
diff --git a/debian/rules b/debian/rules
index b2e0950..fa6ff0f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,45 +1,7 @@
 #!/usr/bin/make -f
 
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/ant.mk
-
-JAVA_HOME := /usr/lib/jvm/default-java
-DEB_JARS  := hamcrest-core hamcrest-library junit4 cglib3-nodep bsh asm4 objenesis \
-		ant-junit
-DEB_ANT_BUILD_TARGET = zip.jars javadoc
-#UVERSION  := $(shell dpkg-parsechangelog|grep ^Version:|cut -f2 -d' '|sed 's/+dfsg-[^-]*$$//')
-UVERSION  := 2.7-SNAPSHOT
-ANT_ARGS  := -Dversion=$(UVERSION)
-PKG       := libjmock2-java
-JARSUFFIXES := legacy script junit3 junit4
-MAVEN_REPO_URL := http://repo1.maven.org/maven2/
-
-common-install-prehook-indep::
-	jh_installjavadoc -plibjmock2-java-doc build/jmock-$(UVERSION)/doc
-
-	mh_installpom -o -v -p$(PKG) maven/jmock/pom.xml; \
-	mh_installjar -p$(PKG) -l -njmock2 maven/jmock/pom.xml \
-		build/jmock-$(UVERSION)/jmock-$(UVERSION).jar; \
-	for SFX in $(JARSUFFIXES); do \
-	   mh_installpom -o -v -p$(PKG) maven/jmock-$$SFX/pom.xml; \
-	   mh_installjar -p$(PKG) -l -njmock2-$$SFX maven/jmock-$$SFX/pom.xml \
-	      build/jmock-$(UVERSION)/jmock-$$SFX-$(UVERSION).jar; \
-	done
-
-clean::
-	mh_clean
-	rm -f debian/.javahelper_clean
+%:
+	dh $@ --buildsystem=maven
 
 get-orig-source:
-	uscan --force-download --verbose
-
-# this is an ugly hack, since there are not published maven artifacts for 2.7-SNAPSHOT
-#UVERSION := 2.6.0
-get-orig-pom:
-	test '! -d maven' && mkdir -p maven/jmock
-	curl $(MAVEN_REPO_URL)/org/jmock/jmock/$(UVERSION)/jmock-$(UVERSION).pom --output maven/jmock/pom.xml
-	for SFX in $(JARSUFFIXES); do \
-		mkdir -p maven/jmock-$$SFX; \
-		curl $(MAVEN_REPO_URL)/org/jmock/jmock-$$SFX/$(UVERSION)/jmock-$$SFX-$(UVERSION).pom \
-			--output maven/jmock-$$SFX/pom.xml; \
-	done
+	uscan --download-current-version --force-download --verbose

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jmock2.git



More information about the pkg-java-commits mailing list