From 1dd265f9b9ccfec580797cd52338b50d45b5828b Mon Sep 17 00:00:00 2001 From: gil Date: Jun 03 2015 14:00:58 +0000 Subject: updated to 2.8.1 --- diff --git a/.gitignore b/.gitignore index 71c2ae5..6ca7dc1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /jmock-2.5.1-clean-src-svn.tar.gz +/2.8.1.tar.gz diff --git a/jmock-2.5.1-DeterministicSchedule.patch b/jmock-2.5.1-DeterministicSchedule.patch deleted file mode 100644 index b16f931..0000000 --- a/jmock-2.5.1-DeterministicSchedule.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- src/org/jmock/lib/concurrent/DeterministicScheduler.java 2008-06-23 14:06:51.000000000 +0200 -+++ src/org/jmock/lib/concurrent/DeterministicScheduler.java-gil 2011-07-27 20:46:08.446224533 +0200 -@@ -110,21 +110,21 @@ - throw blockingOperationsNotSupported(); - } - -- public List> invokeAll(Collection> tasks) throws InterruptedException { -+ public List> invokeAll(Collection> tasks) throws InterruptedException { - throw blockingOperationsNotSupported(); - } - -- public List> invokeAll(Collection> tasks, long timeout, TimeUnit unit) throws InterruptedException { -+ public List> invokeAll(Collection> tasks, long timeout, TimeUnit unit) throws InterruptedException { - throw blockingOperationsNotSupported(); - } - -- public T invokeAny(Collection> tasks) -+ public T invokeAny(Collection> tasks) - throws InterruptedException, ExecutionException - { - throw blockingOperationsNotSupported(); - } - -- public T invokeAny(Collection> tasks, long timeout, TimeUnit unit) -+ public T invokeAny(Collection> tasks, long timeout, TimeUnit unit) - throws InterruptedException, ExecutionException, TimeoutException - { - throw blockingOperationsNotSupported(); diff --git a/jmock-2.5.1-cglib22.patch b/jmock-2.5.1-cglib22.patch deleted file mode 100644 index b96d143..0000000 --- a/jmock-2.5.1-cglib22.patch +++ /dev/null @@ -1,85 +0,0 @@ -diff -Nru jmock-2.5.1/test/org/jmock/test/unit/support/MethodFactory.java jmock-2.5.1-gil/test/org/jmock/test/unit/support/MethodFactory.java ---- jmock-2.5.1/test/org/jmock/test/unit/support/MethodFactory.java 2007-07-23 13:43:05.000000000 +0200 -+++ jmock-2.5.1-gil/test/org/jmock/test/unit/support/MethodFactory.java 2012-04-19 10:46:53.707914792 +0200 -@@ -4,13 +4,13 @@ - - 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 @@ - { - @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 -Nru jmock-2.5.1/test/org/jmock/test/unit/support/SyntheticEmptyInterfaceClassLoader.java jmock-2.5.1-gil/test/org/jmock/test/unit/support/SyntheticEmptyInterfaceClassLoader.java ---- jmock-2.5.1/test/org/jmock/test/unit/support/SyntheticEmptyInterfaceClassLoader.java 2007-04-10 10:34:01.000000000 +0200 -+++ jmock-2.5.1-gil/test/org/jmock/test/unit/support/SyntheticEmptyInterfaceClassLoader.java 2012-04-19 10:46:53.706914792 +0200 -@@ -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 @@ - } - - 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(); - diff --git a/jmock-2.5.1-hamcrest12.patch b/jmock-2.5.1-hamcrest12.patch deleted file mode 100644 index f650122..0000000 --- a/jmock-2.5.1-hamcrest12.patch +++ /dev/null @@ -1,296 +0,0 @@ -diff -Nru jmock-2.5.1/src/org/jmock/Expectations.java jmock-2.5.1-gil/src/org/jmock/Expectations.java ---- jmock-2.5.1/src/org/jmock/Expectations.java 2008-07-03 13:52:29.000000000 +0200 -+++ jmock-2.5.1-gil/src/org/jmock/Expectations.java 2012-11-02 13:58:47.805563931 +0100 -@@ -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 with(T value) { -- return with(equalTo(value)); -+ addParameterMatcher(equal(value)); -+ return value; - } - - public void will(Action action) { -diff -Nru jmock-2.5.1/src/org/jmock/internal/InvocationExpectationBuilder.java jmock-2.5.1-gil/src/org/jmock/internal/InvocationExpectationBuilder.java ---- jmock-2.5.1/src/org/jmock/internal/InvocationExpectationBuilder.java 2008-06-23 10:56:29.000000000 +0200 -+++ jmock-2.5.1-gil/src/org/jmock/internal/InvocationExpectationBuilder.java 2012-11-02 13:58:47.808563779 +0100 -@@ -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() { -diff -Nru jmock-2.5.1/src/org/jmock/internal/InvocationExpectation.java jmock-2.5.1-gil/src/org/jmock/internal/InvocationExpectation.java ---- jmock-2.5.1/src/org/jmock/internal/InvocationExpectation.java 2007-12-28 00:26:14.000000000 +0100 -+++ jmock-2.5.1-gil/src/org/jmock/internal/InvocationExpectation.java 2012-11-02 13:58:47.807563829 +0100 -@@ -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 methodMatcher = IsAnything.anything(""); -- private Matcher parametersMatcher = IsAnything.anything("()"); -+ private Matcher methodMatcher = IsAnything.anything(""); -+ private ParametersMatcher parametersMatcher = ANY_PARAMETERS; - private Action action = new VoidAction(); - private List orderingConstraints = new ArrayList(); - private List sideEffects = new ArrayList(); -@@ -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 methodMatcher) { -- this.methodMatcher = methodMatcher; -+ public void setMethodMatcher(Matcher matcher) { -+ this.methodMatcher = matcher; - } - -- public void setParametersMatcher(Matcher parametersMatcher) { -+ public void setParametersMatcher(ParametersMatcher parametersMatcher) { - this.parametersMatcher = parametersMatcher; - } - -@@ -121,4 +127,14 @@ - sideEffect.perform(); - } - } -+ -+ private static class AnyParametersMatcher extends IsAnything implements ParametersMatcher { -+ public AnyParametersMatcher() { -+ super("()"); -+ } -+ -+ public boolean isCompatibleWith(Object[] parameters) { -+ return true; -+ } -+ }; - } -diff -Nru jmock-2.5.1/src/org/jmock/internal/matcher/AllParametersMatcher.java jmock-2.5.1-gil/src/org/jmock/internal/matcher/AllParametersMatcher.java ---- jmock-2.5.1/src/org/jmock/internal/matcher/AllParametersMatcher.java 1970-01-01 01:00:00.000000000 +0100 -+++ jmock-2.5.1-gil/src/org/jmock/internal/matcher/AllParametersMatcher.java 2012-11-02 13:58:47.809563730 +0100 -@@ -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 implements ParametersMatcher { -+ private final Matcher[] elementMatchers; -+ -+ public AllParametersMatcher(Object[] expectedValues) { -+ this.elementMatchers = equalMatchersFor(expectedValues); -+ } -+ -+ @SuppressWarnings("unchecked") -+ public AllParametersMatcher(List> 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 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[] equalMatchersFor(Object[] expectedValues) { -+ Matcher[] matchers = new Matcher[expectedValues.length]; -+ for (int i = 0; i < expectedValues.length; i++) { -+ matchers[i] = new IsEqual(expectedValues[i]); -+ } -+ return matchers; -+ } -+ -+} -+ -diff -Nru jmock-2.5.1/src/org/jmock/internal/ParametersMatcher.java jmock-2.5.1-gil/src/org/jmock/internal/ParametersMatcher.java ---- jmock-2.5.1/src/org/jmock/internal/ParametersMatcher.java 1970-01-01 01:00:00.000000000 +0100 -+++ jmock-2.5.1-gil/src/org/jmock/internal/ParametersMatcher.java 2012-11-02 13:58:47.809563730 +0100 -@@ -0,0 +1,12 @@ -+package org.jmock.internal; -+ -+import org.hamcrest.Matcher; -+ -+public interface ParametersMatcher extends Matcher { -+ /** -+ * 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); -+} -diff -Nru jmock-2.5.1/test/org/jmock/test/acceptance/HamcrestTypeSafetyAcceptanceTests.java jmock-2.5.1-gil/test/org/jmock/test/acceptance/HamcrestTypeSafetyAcceptanceTests.java ---- jmock-2.5.1/test/org/jmock/test/acceptance/HamcrestTypeSafetyAcceptanceTests.java 2007-02-06 17:20:50.000000000 +0100 -+++ jmock-2.5.1-gil/test/org/jmock/test/acceptance/HamcrestTypeSafetyAcceptanceTests.java 2012-11-02 13:58:47.809563730 +0100 -@@ -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; - -diff -Nru jmock-2.5.1/test/org/jmock/test/unit/internal/InvocationExpectationTests.java jmock-2.5.1-gil/test/org/jmock/test/unit/internal/InvocationExpectationTests.java ---- jmock-2.5.1/test/org/jmock/test/unit/internal/InvocationExpectationTests.java 2007-06-23 10:48:36.000000000 +0200 -+++ jmock-2.5.1-gil/test/org/jmock/test/unit/internal/InvocationExpectationTests.java 2012-11-02 13:58:47.811563631 +0100 -@@ -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/jmock-2.5.1-javadoc.patch b/jmock-2.5.1-javadoc.patch deleted file mode 100644 index 0ffb4e8..0000000 --- a/jmock-2.5.1-javadoc.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- build.xml 2008-06-23 14:06:51.000000000 +0200 -+++ build.xml-gil 2011-07-27 20:51:11.859243192 +0200 -@@ -192,8 +192,6 @@ - - - -- -- - - - - - -- -- - - - diff --git a/jmock-2.5.1-name-clash.patch b/jmock-2.5.1-name-clash.patch deleted file mode 100644 index ddbb056..0000000 --- a/jmock-2.5.1-name-clash.patch +++ /dev/null @@ -1,76 +0,0 @@ -diff -Nru src/org/jmock/Expectations.java src-gil/org/jmock/Expectations.java ---- src/org/jmock/Expectations.java 2012-08-13 12:22:27.031761235 +0200 -+++ src-gil/org/jmock/Expectations.java 2012-08-13 12:26:25.000000000 +0200 -@@ -143,42 +143,42 @@ - return null; - } - -- public boolean with(Matcher matcher) { -+ public boolean withBoolean(Matcher matcher) { - addParameterMatcher(matcher); - return false; - } - -- public byte with(Matcher matcher) { -+ public byte withByte(Matcher matcher) { - addParameterMatcher(matcher); - return 0; - } - -- public short with(Matcher matcher) { -+ public short withShort(Matcher matcher) { - addParameterMatcher(matcher); - return 0; - } - -- public char with(Matcher matcher) { -+ public char withCharacter(Matcher matcher) { - addParameterMatcher(matcher); - return 0; - } - -- public int with(Matcher matcher) { -+ public int withInteger(Matcher matcher) { - addParameterMatcher(matcher); - return 0; - } - -- public long with(Matcher matcher) { -+ public long withLong(Matcher matcher) { - addParameterMatcher(matcher); - return 0; - } - -- public float with(Matcher matcher) { -+ public float withFloat(Matcher matcher) { - addParameterMatcher(matcher); - return 0.0f; - } - -- public double with(Matcher matcher) { -+ public double withDouble(Matcher matcher) { - addParameterMatcher(matcher); - return 0.0; - } -diff -Nru src/org/jmock/syntax/ArgumentConstraintPhrases.java src-gil/org/jmock/syntax/ArgumentConstraintPhrases.java ---- src/org/jmock/syntax/ArgumentConstraintPhrases.java 2006-10-12 16:06:01.000000000 +0200 -+++ src-gil/org/jmock/syntax/ArgumentConstraintPhrases.java 2012-08-13 12:27:35.000000000 +0200 -@@ -4,11 +4,11 @@ - - public interface ArgumentConstraintPhrases { - T with(Matcher matcher); -- boolean with(Matcher matcher); -- byte with(Matcher matcher); -- short with(Matcher matcher); -- int with(Matcher matcher); -- long with(Matcher matcher); -- float with(Matcher matcher); -- double with(Matcher matcher); -+ boolean withBoolean(Matcher matcher); -+ byte withByte(Matcher matcher); -+ short withShort(Matcher matcher); -+ int withInteger(Matcher matcher); -+ long withLong(Matcher matcher); -+ float withFloat(Matcher matcher); -+ double withDouble(Matcher matcher); - } diff --git a/jmock-2.5.1-poms.patch b/jmock-2.5.1-poms.patch deleted file mode 100644 index b0e1216..0000000 --- a/jmock-2.5.1-poms.patch +++ /dev/null @@ -1,99 +0,0 @@ -diff -Nru maven/jmock-junit4/pom.xml maven-gil/jmock-junit4/pom.xml ---- maven/jmock-junit4/pom.xml 2008-08-26 16:28:52.000000000 +0200 -+++ maven-gil/jmock-junit4/pom.xml 2012-04-19 11:05:33.000000000 +0200 -@@ -17,7 +17,7 @@ - - - junit -- junit-dep -+ junit - 4.4 - - -diff -Nru maven/jmock-legacy/pom.xml maven-gil/jmock-legacy/pom.xml ---- maven/jmock-legacy/pom.xml 2008-08-26 16:28:52.000000000 +0200 -+++ maven-gil/jmock-legacy/pom.xml 2012-04-19 11:03:42.000000000 +0200 -@@ -21,9 +21,9 @@ - 1.0 - - -- cglib -- cglib-nodep -- 2.1_3 -+ net.sf.cglib -+ cglib -+ 2.2 - - - -diff -Nru maven/jmock-script/pom.xml maven-gil/jmock-script/pom.xml ---- maven/jmock-script/pom.xml 2008-08-26 16:28:52.000000000 +0200 -+++ maven-gil/jmock-script/pom.xml 2012-04-19 10:58:33.000000000 +0200 -@@ -15,9 +15,9 @@ - ${pom.version} - - -- org.beanshell -+ bsh - bsh -- 2.0b4 -+ 1.3.0 - - - -\ Manca newline alla fine del file -diff -Nru maven/pom.xml maven-gil/pom.xml ---- maven/pom.xml 2008-08-26 16:28:52.000000000 +0200 -+++ maven-gil/pom.xml 2012-04-19 11:14:07.786932958 +0200 -@@ -52,7 +52,7 @@ - - - -- -+ - - org.codehaus.mojo - build-helper-maven-plugin -@@ -134,13 +134,13 @@ - - - -- -+ - - - -@@ -150,7 +150,7 @@ - - - -- -+ - - jmock2 - diff --git a/jmock-2.5.1-use_system_libraries.patch b/jmock-2.5.1-use_system_libraries.patch deleted file mode 100644 index ee69484..0000000 --- a/jmock-2.5.1-use_system_libraries.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- build.xml 2008-06-23 14:06:51.000000000 +0200 -+++ build.xml-gil 2012-08-13 12:21:15.007275254 +0200 -@@ -3,7 +3,13 @@ - - - -- -+ -+ -+ -+ -+ -+ -+ - - - - - -+ -+ -+ -+ -+ -+ -+ - - - diff --git a/jmock.spec b/jmock.spec index e9c9564..15dfcf0 100644 --- a/jmock.spec +++ b/jmock.spec @@ -2,55 +2,24 @@ %global namedversion %{version}%{?namedreltag} Name: jmock -Version: 2.5.1 -Release: 8%{?dist} +Version: 2.8.1 +Release: 1%{?dist} Summary: Java library for testing code with mock objects License: BSD Url: http://www.jmock.org/ -# svn export http://svn.codehaus.org/jmock/tags/2.5.1 jmock-2.5.1 -# find jmock-2.5.1 -name "*.jar" -type f -delete -# find jmock-2.5.1 -name "*.class" -delete -# svn export http://svn.codehaus.org/jmock/tags/packaging-maven-2.5.1 jmock-2.5.1/maven -# tar czf jmock-2.5.1-clean-src-svn.tar.gz jmock-2.5.1 -Source0: %{name}-%{namedversion}-clean-src-svn.tar.gz -Patch0: %{name}-%{namedversion}-use_system_libraries.patch -# build with cglib 2.2 -Patch1: %{name}-%{namedversion}-cglib22.patch -# patch for java6 -Patch2: %{name}-%{namedversion}-DeterministicSchedule.patch -# remove hamcrest classes -Patch3: %{name}-%{namedversion}-javadoc.patch -# remove -# gmaven -# wagon-webdav -# profile jmock1 -# change -# cglib cglib-nodep 2.1_3 -> net.sf.cglib cglib 2.2 -# junit-dep -> junit -Patch4: %{name}-%{namedversion}-poms.patch -# from Debian -Patch5: %{name}-%{namedversion}-hamcrest12.patch -# build fix for java 7 -Patch6: %{name}-%{namedversion}-name-clash.patch - -BuildRequires: java-devel >= 1:1.6.0 -BuildRequires: jpackage-utils - -BuildRequires: ant -BuildRequires: ant-junit -BuildRequires: bsh -BuildRequires: cglib -BuildRequires: hamcrest12 -BuildRequires: junit -BuildRequires: objectweb-asm3 -BuildRequires: objenesis - -Requires: bsh -Requires: hamcrest12 -Requires: junit - -Requires: objenesis -Requires: jpackage-utils +Source0: https://github.com/jmock-developers/jmock-library/archive/%{namedversion}.tar.gz + +BuildRequires: maven-local +BuildRequires: mvn(cglib:cglib) +BuildRequires: mvn(junit:junit) +BuildRequires: mvn(org.apache.maven.plugins:maven-dependency-plugin) +BuildRequires: mvn(org.beanshell:bsh) +BuildRequires: mvn(org.codehaus.mojo:exec-maven-plugin) +BuildRequires: mvn(org.hamcrest:hamcrest-library) +BuildRequires: mvn(org.objenesis:objenesis) +BuildRequires: mvn(org.ow2.asm:asm) +BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:) + BuildArch: noarch %description @@ -72,77 +41,50 @@ Summary: Javadoc for %{name} This package contains javadoc for %{name}. %prep -%setup -q -%patch0 -p0 -sed -i "s|objectweb-asm/asm.jar|objectweb-asm3/asm.jar|" build.xml -sed -i "s|objenesis|objenesis/objenesis|" build.xml -sed -i "s|hamcrest12/core.jar|hamcrest12/hamcrest-core-1.2.jar|" build.xml -sed -i "s|hamcrest12/library.jar|hamcrest12/hamcrest-library-1.2.jar|" build.xml -sed -i "s|junit4.jar|junit.jar|" build.xml -%patch1 -p1 -%patch2 -p0 -%patch3 -p0 -%patch4 -p0 -%patch5 -p1 -%patch6 -p0 - -# fix non ASCII chars -for s in test/org/jmock/example/sniper/Money.java;do - native2ascii -encoding UTF8 ${s} ${s} -done - -# TODO this test fails -rm -r test/org/jmock/test/acceptance/ParameterMatchingAcceptanceTests.java \ - test/org/jmock/test/acceptance/PrimitiveParameterTypesAcceptanceTests.java - -sed -i 's|||' build.xml +%setup -q -n %{name}-library-%{namedversion} + +%pom_remove_plugin :nexus-staging-maven-plugin +%pom_remove_plugin :maven-javadoc-plugin +%pom_remove_plugin :maven-source-plugin + +%pom_remove_plugin :maven-gpg-plugin testjar + +%pom_xpath_set "pom:dependency[pom:groupId = 'cglib' ]/pom:artifactId" cglib +%pom_xpath_set "pom:dependency[pom:groupId = 'cglib' ]/pom:artifactId" cglib %{name} + +sed -i "s|%classpath|$(build-classpath objectweb-asm/asm)|" %{name}/pom.xml + +%pom_xpath_remove pom:build %{name}-example +%pom_xpath_inject "pom:project" " + + src/main +" %{name}-example +# package org.jmock.integration.junit{3,4} do not exist +%pom_add_dep org.%{name}:%{name}-junit3:'${project.version}' %{name}-example +%pom_add_dep org.%{name}:%{name}-junit4:'${project.version}' %{name}-example + +%mvn_alias org.%{name}:%{name} :%{name}-script +%mvn_package org.%{name}:%{name}::tests: +%mvn_package org.%{name}:%{name}-junit3::tests: %build -ant \ - -Dant.build.javac.source=1.5 \ - -Dant.build.javac.target=1.5 \ - -Dversion=%{namedversion} \ - zip.jars javadoc +%mvn_build %install - -mkdir -p %{buildroot}%{_mavenpomdir} -install -pm 644 maven/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-parent.pom -%add_maven_depmap JPP.%{name}-parent.pom - -mkdir -p %{buildroot}%{_javadir}/%{name} -for m in %{name} \ - %{name}-junit3 \ - %{name}-junit4 \ - %{name}-legacy \ - %{name}-script;do - install -m 644 build/%{name}-%{namedversion}/${m}-%{namedversion}.jar %{buildroot}%{_javadir}/%{name}/${m}.jar - install -pm 644 maven/${m}/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-${m}.pom - %add_maven_depmap JPP.%{name}-${m}.pom %{name}/${m}.jar -done - -sed -i 's|x-SNAPSHOT|%{namedversion}|' maven/%{name}-core/pom.xml -sed -i 's|%{name}-core|%{name}-tests|' maven/%{name}-core/pom.xml -sed -i 's|jMock 1 Core|jMock 2 Tests|' maven/%{name}-core/pom.xml -install -m 644 build/%{name}-%{namedversion}/%{name}-tests-%{namedversion}.jar \ - %{buildroot}%{_javadir}/%{name}/%{name}-tests.jar -install -pm 644 maven/%{name}-core/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-tests.pom -%add_maven_depmap JPP.%{name}-%{name}-tests.pom %{name}/%{name}-tests.jar - -mkdir -p %{buildroot}%{_javadocdir}/%{name} -cp -pr build/%{name}-%{namedversion}/doc/* %{buildroot}%{_javadocdir}/%{name} +%mvn_install %files -f .mfiles -%dir %{_javadir}/%{name} %doc README* %license LICENSE.txt -%files javadoc -%{_javadocdir}/%{name} +%files javadoc -f .mfiles-javadoc %license LICENSE.txt %changelog +* Wed Jun 03 2015 gil cattaneo 2.8.1-1 +- updated to 2.8.1 + * Fri Feb 06 2015 gil cattaneo 2.5.1-8 - introduce license macro diff --git a/sources b/sources index e9122b1..6132b52 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6872fad3b778b3cc5a82cd50e2208ecd jmock-2.5.1-clean-src-svn.tar.gz +ca06badaa3e8cd429e1ce873080178d7 2.8.1.tar.gz