Update to upstream version 3.2
This commit is contained in:
parent
490a84998b
commit
f7a52e1d69
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
easymock-1.2-src.tar.gz
|
||||
/easymock-1.2_Java1.5.pom
|
||||
/easymock-3.2.tar.gz
|
||||
|
20
LICENSE
20
LICENSE
@ -1,20 +0,0 @@
|
||||
Copyright (c) 2001-2012 OFFIS, Tammo Freese, Henri Tremblay.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@ -1,30 +0,0 @@
|
||||
--- build.xml.sav 2005-08-07 17:53:29.000000000 +0200
|
||||
+++ build.xml 2006-02-24 16:25:45.000000000 +0100
|
||||
@@ -17,7 +17,7 @@
|
||||
<property name="clover build directory" value="${temp directory}/bin-clover" />
|
||||
<property name="clover report directory" value="${temp directory}/clover" />
|
||||
|
||||
- <property file="${user.home}/easymockbuild.properties" />
|
||||
+ <property file="easymockbuild.properties" />
|
||||
<property name="java 1.3" value="/System/Library/Frameworks/JavaVM.framework/Versions/1.3/Commands/java" />
|
||||
<property name="java 1.4" value="/System/Library/Frameworks/JavaVM.framework/Versions/1.4/Commands/java" />
|
||||
<property name="java 1.5" value="" />
|
||||
@@ -99,14 +99,16 @@
|
||||
</junit>
|
||||
</target>
|
||||
|
||||
-<target name="test distribution" depends="test distribution 1.3, test distribution 1.4">
|
||||
+<target name="test distribution" depends="test distribution 1.4">
|
||||
</target>
|
||||
|
||||
-<target name="all" depends="clean, build, javadoc, (clover), pack distribution, test distribution">
|
||||
+<target name="all" depends="clean, build, javadoc, pack distribution">
|
||||
<antcall target="clean" />
|
||||
</target>
|
||||
|
||||
+<!--
|
||||
<taskdef resource="clovertasks" />
|
||||
+-->
|
||||
|
||||
<target name="(clover)" depends="(init clover), (build for clover), (test clover), (clover html), (check full coverage),(delete clover build)">
|
||||
</target>
|
@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="">
|
||||
<component id="easymock"
|
||||
licenseType=""
|
||||
version="@VERSION@"
|
||||
tag="@TAG@"
|
||||
description=""
|
||||
|
||||
>
|
||||
|
||||
<artifact id="easymock.jar"/>
|
||||
<artifact id="easymockclassextension.jar"/>
|
||||
|
||||
|
||||
<export>
|
||||
<include input="easymockclassextension.jar"/>
|
||||
<include input="easymock.jar"/>
|
||||
|
||||
</export>
|
||||
</component>
|
||||
</project>
|
222
easymock-remove-android-support.patch
Normal file
222
easymock-remove-android-support.patch
Normal file
@ -0,0 +1,222 @@
|
||||
From 210c8bae09fb9309519c8266b71635ef308872b3 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Srb <msrb@redhat.com>
|
||||
Date: Fri, 9 Aug 2013 12:44:48 +0200
|
||||
Subject: [PATCH] Remove android support
|
||||
|
||||
---
|
||||
.../internal/AndroidClassProxyFactory.java | 101 ---------------------
|
||||
.../java/org/easymock/internal/AndroidSupport.java | 37 --------
|
||||
.../java/org/easymock/internal/MocksControl.java | 6 --
|
||||
.../easymock/tests2/ClassExtensionHelperTest.java | 12 +--
|
||||
4 files changed, 3 insertions(+), 153 deletions(-)
|
||||
delete mode 100644 easymock/src/main/java/org/easymock/internal/AndroidClassProxyFactory.java
|
||||
delete mode 100644 easymock/src/main/java/org/easymock/internal/AndroidSupport.java
|
||||
|
||||
diff --git a/easymock/src/main/java/org/easymock/internal/AndroidClassProxyFactory.java b/easymock/src/main/java/org/easymock/internal/AndroidClassProxyFactory.java
|
||||
deleted file mode 100644
|
||||
index da04042..0000000
|
||||
--- a/easymock/src/main/java/org/easymock/internal/AndroidClassProxyFactory.java
|
||||
+++ /dev/null
|
||||
@@ -1,101 +0,0 @@
|
||||
-/**
|
||||
- * Copyright 2001-2013 the original author or authors.
|
||||
- *
|
||||
- * Licensed under the Apache License, Version 2.0 (the "License");
|
||||
- * you may not use this file except in compliance with the License.
|
||||
- * You may obtain a copy of the License at
|
||||
- *
|
||||
- * http://www.apache.org/licenses/LICENSE-2.0
|
||||
- *
|
||||
- * Unless required by applicable law or agreed to in writing, software
|
||||
- * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
- * See the License for the specific language governing permissions and
|
||||
- * limitations under the License.
|
||||
- */
|
||||
-package org.easymock.internal;
|
||||
-
|
||||
-import java.io.IOException;
|
||||
-import java.lang.reflect.Constructor;
|
||||
-import java.lang.reflect.InvocationHandler;
|
||||
-import java.lang.reflect.Method;
|
||||
-import java.lang.reflect.Modifier;
|
||||
-import java.util.Arrays;
|
||||
-import java.util.HashSet;
|
||||
-import java.util.Set;
|
||||
-
|
||||
-import org.easymock.ConstructorArgs;
|
||||
-
|
||||
-import com.google.dexmaker.stock.ProxyBuilder;
|
||||
-
|
||||
-// ///CLOVER:OFF (sadly not possible to test android with clover)
|
||||
-/**
|
||||
- * Mocks concrete classes for Android's runtime by generating dex files.
|
||||
- */
|
||||
-public final class AndroidClassProxyFactory implements IProxyFactory {
|
||||
- public <T> T createProxy(Class<T> toMock, InvocationHandler handler,
|
||||
- Method[] mockedMethods, ConstructorArgs constructorArgs) {
|
||||
- final MockHandler interceptor = new MockHandler(handler, mockedMethods);
|
||||
- try {
|
||||
- ProxyBuilder<T> builder = ProxyBuilder.forClass(toMock)
|
||||
- .handler(interceptor);
|
||||
- if (constructorArgs != null) {
|
||||
- builder.constructorArgTypes(constructorArgs.getConstructor().getParameterTypes())
|
||||
- .constructorArgValues(constructorArgs.getInitArgs());
|
||||
- } else {
|
||||
- try {
|
||||
- DefaultClassInstantiator instantiator = new DefaultClassInstantiator();
|
||||
- Constructor<?> constructor = instantiator.getConstructorToUse(toMock);
|
||||
- Object[] params = instantiator.getArgsForTypes(constructor.getParameterTypes());
|
||||
- builder.constructorArgTypes(constructor.getParameterTypes())
|
||||
- .constructorArgValues(params);
|
||||
- } catch (InstantiationException e) {
|
||||
- throw new RuntimeException("Fail to instantiate mock for " + toMock);
|
||||
- }
|
||||
- }
|
||||
- return builder.build();
|
||||
- } catch (IOException e) {
|
||||
- throw new RuntimeException("Failed to mock " + toMock, e);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- public InvocationHandler getInvocationHandler(Object mock) {
|
||||
- MockHandler mockHandler = (MockHandler) ProxyBuilder.getInvocationHandler(mock);
|
||||
- return mockHandler.delegate;
|
||||
- }
|
||||
-
|
||||
- private static class MockHandler implements InvocationHandler {
|
||||
- private final InvocationHandler delegate;
|
||||
- private final Set<Method> mockedMethods;
|
||||
-
|
||||
- public MockHandler(InvocationHandler delegate, Method... mockedMethods) {
|
||||
- this.delegate = delegate;
|
||||
- this.mockedMethods = (mockedMethods != null)
|
||||
- ? new HashSet<Method>(Arrays.asList(mockedMethods))
|
||||
- : null;
|
||||
- }
|
||||
-
|
||||
- public Object invoke(Object obj, Method method, Object[] args) throws Throwable {
|
||||
- if (method.isBridge()) {
|
||||
- method = BridgeMethodResolver.findBridgedMethod(method);
|
||||
- }
|
||||
-
|
||||
- // Never intercept EasyMock's own calls to fillInStackTrace
|
||||
- boolean internalFillInStackTraceCall = obj instanceof Throwable
|
||||
- && method.getName().equals("fillInStackTrace")
|
||||
- && ClassProxyFactory.isCallerMockInvocationHandlerInvoke(new Throwable());
|
||||
-
|
||||
- if (internalFillInStackTraceCall
|
||||
- || isMocked(method) && !Modifier.isAbstract(method.getModifiers())) {
|
||||
- return ProxyBuilder.callSuper(obj, method, args);
|
||||
- }
|
||||
-
|
||||
- return delegate.invoke(obj, method, args);
|
||||
- }
|
||||
-
|
||||
- private boolean isMocked(Method method) {
|
||||
- return mockedMethods != null && !mockedMethods.contains(method);
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
-// ///CLOVER:ON
|
||||
\ No newline at end of file
|
||||
diff --git a/easymock/src/main/java/org/easymock/internal/AndroidSupport.java b/easymock/src/main/java/org/easymock/internal/AndroidSupport.java
|
||||
deleted file mode 100644
|
||||
index 43c683e..0000000
|
||||
--- a/easymock/src/main/java/org/easymock/internal/AndroidSupport.java
|
||||
+++ /dev/null
|
||||
@@ -1,37 +0,0 @@
|
||||
-/**
|
||||
- * Copyright 2001-2013 the original author or authors.
|
||||
- *
|
||||
- * Licensed under the Apache License, Version 2.0 (the "License");
|
||||
- * you may not use this file except in compliance with the License.
|
||||
- * You may obtain a copy of the License at
|
||||
- *
|
||||
- * http://www.apache.org/licenses/LICENSE-2.0
|
||||
- *
|
||||
- * Unless required by applicable law or agreed to in writing, software
|
||||
- * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
- * See the License for the specific language governing permissions and
|
||||
- * limitations under the License.
|
||||
- */
|
||||
-package org.easymock.internal;
|
||||
-
|
||||
-/**
|
||||
- * Android-specific support.
|
||||
- */
|
||||
-public final class AndroidSupport {
|
||||
- // ///CLOVER:OFF
|
||||
- private static boolean isAndroid;
|
||||
- static {
|
||||
- try {
|
||||
- Class.forName("dalvik.system.PathClassLoader");
|
||||
- isAndroid = true;
|
||||
- } catch (final ClassNotFoundException e) {
|
||||
- isAndroid = false;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- public static boolean isAndroid() {
|
||||
- return isAndroid;
|
||||
- }
|
||||
- // ///CLOVER:ON
|
||||
-}
|
||||
diff --git a/easymock/src/main/java/org/easymock/internal/MocksControl.java b/easymock/src/main/java/org/easymock/internal/MocksControl.java
|
||||
index e709dc4..cd9d5a9 100644
|
||||
--- a/easymock/src/main/java/org/easymock/internal/MocksControl.java
|
||||
+++ b/easymock/src/main/java/org/easymock/internal/MocksControl.java
|
||||
@@ -137,12 +137,6 @@ public class MocksControl implements IMocksControl, IExpectationSetters<Object>,
|
||||
return cached;
|
||||
}
|
||||
|
||||
- // ///CLOVER:OFF
|
||||
- if (AndroidSupport.isAndroid()) {
|
||||
- return classProxyFactory = new AndroidClassProxyFactory();
|
||||
- }
|
||||
- // ///CLOVER:ON
|
||||
-
|
||||
try {
|
||||
return classProxyFactory = new ClassProxyFactory();
|
||||
} catch (final NoClassDefFoundError e) {
|
||||
diff --git a/easymock/src/test/java/org/easymock/tests2/ClassExtensionHelperTest.java b/easymock/src/test/java/org/easymock/tests2/ClassExtensionHelperTest.java
|
||||
index b40466c..b0a7c69 100644
|
||||
--- a/easymock/src/test/java/org/easymock/tests2/ClassExtensionHelperTest.java
|
||||
+++ b/easymock/src/test/java/org/easymock/tests2/ClassExtensionHelperTest.java
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package org.easymock.tests2;
|
||||
|
||||
-import com.google.dexmaker.stock.ProxyBuilder;
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
@@ -25,7 +24,6 @@ import net.sf.cglib.proxy.Enhancer;
|
||||
import net.sf.cglib.proxy.NoOp;
|
||||
import org.easymock.EasyMock;
|
||||
import static org.easymock.EasyMock.createMock;
|
||||
-import org.easymock.internal.AndroidSupport;
|
||||
import static org.easymock.internal.MocksControl.getControl;
|
||||
import static org.easymock.internal.MocksControl.getMockedType;
|
||||
import org.easymock.internal.MocksControl;
|
||||
@@ -61,13 +59,9 @@ public class ClassExtensionHelperTest {
|
||||
@Test
|
||||
public void testGetControl_EnhancedButNotAMock() throws Exception {
|
||||
final Object o;
|
||||
- if (AndroidSupport.isAndroid()) {
|
||||
- o = ProxyBuilder.forClass(ArrayList.class)
|
||||
- .handler(NOOP_INVOCATION_HANDLER)
|
||||
- .build();
|
||||
- } else {
|
||||
- o = Enhancer.create(ArrayList.class, NoOp.INSTANCE);
|
||||
- }
|
||||
+
|
||||
+ o = Enhancer.create(ArrayList.class, NoOp.INSTANCE);
|
||||
+
|
||||
try {
|
||||
getControl(o);
|
||||
fail();
|
||||
--
|
||||
1.8.1.4
|
||||
|
@ -1,65 +0,0 @@
|
||||
diff --git a/src/org/easymock/tests/AllTests.java b/src/org/easymock/tests/AllTests.java
|
||||
deleted file mode 100644
|
||||
index b0b5d96..0000000
|
||||
--- a/src/org/easymock/tests/AllTests.java
|
||||
+++ /dev/null
|
||||
@@ -1,59 +0,0 @@
|
||||
-/*
|
||||
- * Copyright (c) 2001-2005 OFFIS. This program is made available under the terms of
|
||||
- * the MIT License.
|
||||
- */
|
||||
-package org.easymock.tests;
|
||||
-
|
||||
-import junit.framework.Test;
|
||||
-import junit.framework.TestSuite;
|
||||
-
|
||||
-public class AllTests {
|
||||
-
|
||||
- public static void main(String[] args) {
|
||||
- junit.swingui.TestRunner.run(AllTests.class);
|
||||
- }
|
||||
-
|
||||
- public static Test suite() {
|
||||
- TestSuite suite = new TestSuite("Test for org.easymock.tests");
|
||||
- suite.addTestSuite(ArgumentsMatcherTest.class);
|
||||
- suite.addTestSuite(ArrayMatcherTest.class);
|
||||
- suite.addTestSuite(DefaultMatcherTest.class);
|
||||
- suite.addTestSuite(EqualsMatcherTest.class);
|
||||
- suite.addTestSuite(ExpectedMethodCallTest.class);
|
||||
- suite.addTestSuite(LegacyBehaviorTests.class);
|
||||
- suite.addTestSuite(MatchableArgumentsTest.class);
|
||||
- suite.addTestSuite(MethodCallTest.class);
|
||||
- suite.addTestSuite(MockNameTest.class);
|
||||
- suite.addTestSuite(NiceMockControlTest.class);
|
||||
- suite.addTestSuite(NiceMockControlLongCompatibleReturnValueTest.class);
|
||||
- suite.addTestSuite(ObjectMethodsTest.class);
|
||||
- suite.addTestSuite(RecordStateInvalidDefaultReturnValueTest.class);
|
||||
- suite.addTestSuite(RecordStateInvalidDefaultThrowableTest.class);
|
||||
- suite.addTestSuite(RecordStateInvalidMatcherTest.class);
|
||||
- suite.addTestSuite(RecordStateInvalidRangeTest.class);
|
||||
- suite.addTestSuite(RecordStateInvalidReturnValueTest.class);
|
||||
- suite.addTestSuite(RecordStateInvalidStateChangeTest.class);
|
||||
- suite.addTestSuite(RecordStateInvalidThrowableTest.class);
|
||||
- suite.addTestSuite(RecordStateInvalidUsageTest.class);
|
||||
- suite.addTestSuite(RecordStateMethodCallMissingTest.class);
|
||||
- suite.addTestSuite(ReplayStateInvalidUsageTest.class);
|
||||
- suite.addTestSuite(StacktraceTest.class);
|
||||
- suite.addTestSuite(UsageCallCountTest.class);
|
||||
- suite.addTestSuite(UsageDefaultReturnValueTest.class);
|
||||
- suite.addTestSuite(UsageExpectAndDefaultReturnTest.class);
|
||||
- suite.addTestSuite(UsageExpectAndDefaultThrowTest.class);
|
||||
- suite.addTestSuite(UsageExpectAndReturnTest.class);
|
||||
- suite.addTestSuite(UsageExpectAndThrowTest.class);
|
||||
- suite.addTestSuite(UsageFloatingPointReturnValueTest.class);
|
||||
- suite.addTestSuite(UsageLongCompatibleReturnValueTest.class);
|
||||
- suite.addTestSuite(UsageOverloadedDefaultValueTest.class);
|
||||
- suite.addTestSuite(UsageOverloadedMethodTest.class);
|
||||
- suite.addTestSuite(UsageUnorderedTest.class);
|
||||
- suite.addTestSuite(UsageRangeTest.class);
|
||||
- suite.addTestSuite(UsageStrictMockTest.class);
|
||||
- suite.addTestSuite(UsageTest.class);
|
||||
- suite.addTestSuite(UsageThrowableTest.class);
|
||||
- suite.addTestSuite(UsageVerifyTest.class);
|
||||
- return suite;
|
||||
- }
|
||||
-}
|
@ -1,345 +0,0 @@
|
||||
diff --git a/src/org/easymock/tests/ReplayStateInvalidUsageTest.java b/src/org/easymock/tests/ReplayStateInvalidUsageTest.java
|
||||
deleted file mode 100644
|
||||
index 06e0ac1..0000000
|
||||
--- a/src/org/easymock/tests/ReplayStateInvalidUsageTest.java
|
||||
+++ /dev/null
|
||||
@@ -1,338 +0,0 @@
|
||||
-/*
|
||||
- * Copyright (c) 2001-2005 OFFIS. This program is made available under the terms of
|
||||
- * the MIT License.
|
||||
- */
|
||||
-package org.easymock.tests;
|
||||
-
|
||||
-import junit.extensions.ExceptionTestCase;
|
||||
-
|
||||
-import org.easymock.MockControl;
|
||||
-
|
||||
-public class ReplayStateInvalidUsageTest extends ExceptionTestCase {
|
||||
-
|
||||
- private MockControl control;
|
||||
-
|
||||
- private Exception exception;
|
||||
-
|
||||
- public ReplayStateInvalidUsageTest(String name) {
|
||||
- super(name, IllegalStateException.class);
|
||||
- }
|
||||
-
|
||||
- protected void setUp() {
|
||||
- exception = new Exception();
|
||||
- control = MockControl.createControl(IMethods.class);
|
||||
- control.replay();
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowObjectWithMinMax() {
|
||||
- control.expectAndThrow("", exception, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowDoubleWithMinMax() {
|
||||
- control.expectAndThrow(0.0d, exception, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowFloatWithMinMax() {
|
||||
- control.expectAndThrow(0.0f, exception, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowLongWithMinMax() {
|
||||
- control.expectAndThrow(0, exception, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowBooleanWithMinMax() {
|
||||
- control.expectAndThrow(false, exception, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowObjectWithCount() {
|
||||
- control.expectAndThrow("", exception, 1);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowDoubleWithCount() {
|
||||
- control.expectAndThrow(0.0d, exception, 1);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowFloatWithCount() {
|
||||
- control.expectAndThrow(0.0f, exception, 1);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowLongWithCount() {
|
||||
- control.expectAndThrow(0, exception, 1);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowBooleanWithCount() {
|
||||
- control.expectAndThrow(false, exception, 1);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowObjectWithRange() {
|
||||
- control.expectAndThrow("", exception, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowDoubleWithRange() {
|
||||
- control.expectAndThrow(0.0d, exception, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowFloatWithRange() {
|
||||
- control.expectAndThrow(0.0f, exception, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowLongWithRange() {
|
||||
- control.expectAndThrow(0, exception, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowBooleanWithRange() {
|
||||
- control.expectAndThrow(false, exception, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowObject() {
|
||||
- control.expectAndThrow("", exception);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowDouble() {
|
||||
- control.expectAndThrow(0.0d, exception);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowFloat() {
|
||||
- control.expectAndThrow(0.0f, exception);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowLong() {
|
||||
- control.expectAndThrow(0, exception);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndThrowBoolean() {
|
||||
- control.expectAndThrow(false, exception);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnObjectWithMinMax() {
|
||||
- control.expectAndReturn("", "", 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnDoubleWithMinMax() {
|
||||
- control.expectAndReturn(0.0d, 0.0d, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnFloatWithMinMax() {
|
||||
- control.expectAndReturn(0.0f, 0.0f, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnLongWithMinMax() {
|
||||
- control.expectAndReturn(0, 0, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnBooleanWithMinMax() {
|
||||
- control.expectAndReturn(false, false, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnObjectWithCount() {
|
||||
- control.expectAndReturn("", "", 1);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnDoubleWithCount() {
|
||||
- control.expectAndReturn(0.0d, 0.0d, 1);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnFloatWithCount() {
|
||||
- control.expectAndReturn(0.0f, 0.0f, 1);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnLongWithCount() {
|
||||
- control.expectAndReturn(0, 0, 1);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnBooleanWithCount() {
|
||||
- control.expectAndReturn(false, false, 1);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnObjectWithRange() {
|
||||
- control.expectAndReturn("", "", MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnDoubleWithRange() {
|
||||
- control.expectAndReturn(0.0d, 0.0d, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnFloatWithRange() {
|
||||
- control.expectAndReturn(0.0f, 0.0f, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnLongWithRange() {
|
||||
- control.expectAndReturn(0, 0, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnBooleanWithRange() {
|
||||
- control.expectAndReturn(false, false, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnObject() {
|
||||
- control.expectAndReturn("", "");
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnDouble() {
|
||||
- control.expectAndReturn(0.0d, 0.0d);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnFloat() {
|
||||
- control.expectAndReturn(0.0f, 0.0f);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnLong() {
|
||||
- control.expectAndReturn(0, 0);
|
||||
- }
|
||||
-
|
||||
- public void testExpectAndReturnBoolean() {
|
||||
- control.expectAndReturn(false, false);
|
||||
- }
|
||||
-
|
||||
- public void testSetDefaultMatcher() {
|
||||
- control.setDefaultMatcher(MockControl.ARRAY_MATCHER);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueObjectWithMinMax() {
|
||||
- control.setReturnValue("", 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueDoubleWithMinMax() {
|
||||
- control.setReturnValue(0.0d, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueFloatWithMinMax() {
|
||||
- control.setReturnValue(0.0f, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueLongWithMinMax() {
|
||||
- control.setReturnValue(0, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueBooleanWithMinMax() {
|
||||
- control.setReturnValue(false, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testSetThrowableWithMinMax() {
|
||||
- control.setThrowable(exception, 1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testSetVoidCallableWithMinMax() {
|
||||
- control.setVoidCallable(1, 2);
|
||||
- }
|
||||
-
|
||||
- public void testSetMatcher() {
|
||||
- control.setMatcher(MockControl.ARRAY_MATCHER);
|
||||
- }
|
||||
-
|
||||
- public void testSetDefaultReturnValueObject() {
|
||||
- control.setDefaultReturnValue("");
|
||||
- }
|
||||
-
|
||||
- public void testSetDefaultReturnValueDouble() {
|
||||
- control.setDefaultReturnValue(0.0d);
|
||||
- }
|
||||
-
|
||||
- public void testSetDefaultReturnValueFloat() {
|
||||
- control.setDefaultReturnValue(0.0f);
|
||||
- }
|
||||
-
|
||||
- public void testSetDefaultReturnValueLong() {
|
||||
- control.setDefaultReturnValue(0);
|
||||
- }
|
||||
-
|
||||
- public void testSetDefaultReturnValueBoolean() {
|
||||
- control.setDefaultReturnValue(false);
|
||||
- }
|
||||
-
|
||||
- public void testSetDefaultThrowable() {
|
||||
- control.setDefaultThrowable(exception);
|
||||
- }
|
||||
-
|
||||
- public void testSetDefaultVoidCallable() {
|
||||
- control.setDefaultVoidCallable();
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueObjectWithRange() {
|
||||
- control.setReturnValue("", MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueLongWithRange() {
|
||||
- control.setReturnValue(0, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueFloatWithRange() {
|
||||
- control.setReturnValue(0.0f, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueDoubleWithRange() {
|
||||
- control.setReturnValue(0.0d, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueBooleanWithRange() {
|
||||
- control.setReturnValue(false, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testSetThrowableWithRange() {
|
||||
- control.setThrowable(exception, MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testSetVoidCallableWithRange() {
|
||||
- control.setVoidCallable(MockControl.ONE);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueObjectWithCount() {
|
||||
- control.setReturnValue("", 1);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueLongWithCount() {
|
||||
- control.setReturnValue(0, 1);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueFloatWithCount() {
|
||||
- control.setReturnValue(0.0f, 1);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueDoubleWithCount() {
|
||||
- control.setReturnValue(0.0d, 1);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueBooleanWithCount() {
|
||||
- control.setReturnValue(false, 1);
|
||||
- }
|
||||
-
|
||||
- public void testSetThrowableWithCount() {
|
||||
- control.setThrowable(exception, 1);
|
||||
- }
|
||||
-
|
||||
- public void testSetVoidCallableWithCount() {
|
||||
- control.setVoidCallable(1);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueObject() {
|
||||
- control.setReturnValue("");
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueDouble() {
|
||||
- control.setReturnValue(0.0d);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueFloat() {
|
||||
- control.setReturnValue(0.0f);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueLong() {
|
||||
- control.setReturnValue(0);
|
||||
- }
|
||||
-
|
||||
- public void testSetReturnValueBoolean() {
|
||||
- control.setReturnValue(false);
|
||||
- }
|
||||
-
|
||||
- public void testSetThrowable() {
|
||||
- control.setThrowable(exception);
|
||||
- }
|
||||
-
|
||||
- public void testSetVoidCallable() {
|
||||
- control.setVoidCallable();
|
||||
- }
|
||||
-
|
||||
- public void testReplay() {
|
||||
- control.replay();
|
||||
- }
|
||||
-}
|
||||
\ No newline at end of file
|
164
easymock.spec
164
easymock.spec
@ -1,126 +1,90 @@
|
||||
# Copyright (c) 2000-2009, JPackage Project
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name of the JPackage Project nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
Name: easymock
|
||||
Version: 1.2
|
||||
Release: 21%{?dist}
|
||||
Epoch: 0
|
||||
Version: 3.2
|
||||
Release: 1%{?dist}
|
||||
Summary: Easy mock objects
|
||||
Group: Development/Libraries
|
||||
License: MIT
|
||||
URL: http://www.easymock.org/
|
||||
# cvs -d:pserver:anonymous@easymock.cvs.sourceforge.net:/cvsroot/easymock login
|
||||
# cvs -z3 -d:pserver:anonymous@easymock.cvs.sourceforge.net:/cvsroot/easymock export -r EasyMock1_2_Java1_3 easymock
|
||||
# tar czf easymock-1.2-src.tar.gz easymock
|
||||
Source0: easymock-1.2-src.tar.gz
|
||||
Source1: http://repo1.maven.org/maven2/easymock/easymock/1.2_Java1.5/easymock-1.2_Java1.5.pom
|
||||
Source2: easymock-component-info.xml
|
||||
# Starting with version 2.5.1, EasyMock changed its license to Apache 2.
|
||||
# Older versions are still available under MIT License
|
||||
# See http://www.easymock.org/License.html
|
||||
Source3: LICENSE
|
||||
Patch0: easymock-1.2-build_xml.patch
|
||||
Patch1: %{name}-removed-test.patch
|
||||
Patch2: %{name}-removed-alltests.patch
|
||||
BuildRequires: jpackage-utils >= 0:1.6
|
||||
BuildRequires: ant >= 0:1.6
|
||||
BuildRequires: ant-junit >= 0:1.6
|
||||
BuildRequires: junit >= 0:3.8.1
|
||||
BuildRequires: java-devel >= 0:1.5.0
|
||||
License: ASL 2.0
|
||||
URL: http://www.easymock.org
|
||||
|
||||
Source0: https://github.com/easymock/easymock/archive/easymock-%{version}.tar.gz
|
||||
|
||||
Patch5: %{name}-remove-android-support.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: mvn(com.keyboardsamurais.maven:maven-timestamp-plugin)
|
||||
BuildRequires: mvn(com.mycila.maven-license-plugin:maven-license-plugin)
|
||||
BuildRequires: mvn(junit:junit)
|
||||
BuildRequires: mvn(net.sf.cglib:cglib)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-compiler-plugin)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-jar-plugin)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-remote-resources-plugin)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-surefire-plugin)
|
||||
BuildRequires: mvn(org.objenesis:objenesis)
|
||||
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
|
||||
|
||||
Obsoletes: %{name}3 < %{version}-%{release}
|
||||
Provides: %{name}3 = %{version}-%{release}
|
||||
|
||||
|
||||
%description
|
||||
EasyMock provides Mock Objects for interfaces in JUnit tests by generating
|
||||
them on the fly using Java's proxy mechanism. Due to EasyMock's unique style
|
||||
of recording expectations, most refactorings will not affect the Mock Objects.
|
||||
So EasyMock is a perfect fit for Test-Driven Development.
|
||||
|
||||
%package javadoc
|
||||
Summary: Javadoc for %{name}
|
||||
Group: Documentation
|
||||
|
||||
%description javadoc
|
||||
%package javadoc
|
||||
Summary: Javadoc for %{name}
|
||||
|
||||
%description javadoc
|
||||
Javadoc for %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}
|
||||
%patch0 -p0
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
cp %{SOURCE3} .
|
||||
mkdir lib
|
||||
pushd lib
|
||||
ln -sf $(build-classpath junit) .
|
||||
popd
|
||||
|
||||
# We no longer ship a 1.3/1.4 VM, Set it to generic javahome
|
||||
rm easymockbuild.properties
|
||||
echo "java\ 1.3=%{java}" >> easymockbuild.properties
|
||||
echo "java\ 1.4=%{java}" >> easymockbuild.properties
|
||||
echo "java\ 1.5=%{java}" >> easymockbuild.properties
|
||||
echo "java\ compiler=%{javac}" >> easymockbuild.properties
|
||||
%prep
|
||||
# Unpack the sources:
|
||||
%setup -q -n easymock-easymock-%{version}
|
||||
|
||||
find . -name "*.zip" -delete
|
||||
|
||||
# remove android support
|
||||
%patch5 -p1
|
||||
%pom_xpath_remove "pom:profile[pom:id[text()='android']]"
|
||||
%pom_remove_dep :dexmaker easymock
|
||||
|
||||
# fix cglib aId and gId
|
||||
%pom_remove_dep :cglib-nodep easymock
|
||||
%pom_add_dep net.sf.cglib:cglib easymock
|
||||
|
||||
# remove some warning caused by unavailable plugin
|
||||
%pom_remove_plugin com.atlassian.maven.plugins:maven-clover2-plugin
|
||||
%pom_remove_plugin org.codehaus.mojo:versions-maven-plugin
|
||||
%pom_xpath_remove pom:profiles easymock-classextension
|
||||
|
||||
%pom_disable_module easymock-integration
|
||||
|
||||
# For compatibility reasons
|
||||
%mvn_file ":easymock{*}" easymock@1 easymock3@1
|
||||
|
||||
|
||||
%build
|
||||
export OPT_JAR_LIST="ant/ant-junit junit"
|
||||
export CLASSPATH=
|
||||
%{ant} -Dbuild.sysclasspath=first
|
||||
%mvn_build
|
||||
|
||||
%install
|
||||
unzip -qq %{name}%{version}_Java1.3.zip
|
||||
install -dm 755 $RPM_BUILD_ROOT%{_javadir}
|
||||
|
||||
install -pm 644 %{name}%{version}_Java1.3/%{name}.jar \
|
||||
$RPM_BUILD_ROOT%{_javadir}/%{name}.jar
|
||||
|
||||
# javadoc
|
||||
install -dm 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
|
||||
cp -pr %{name}%{version}_Java1.3/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
|
||||
|
||||
# pom
|
||||
install -dm 755 $RPM_BUILD_ROOT%{_mavenpomdir}
|
||||
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
|
||||
%add_maven_depmap
|
||||
%mvn_install
|
||||
|
||||
|
||||
%files
|
||||
%doc LICENSE
|
||||
%doc %{name}%{version}_Java1.3/{Documentation,License}.html
|
||||
%{_mavenpomdir}/*
|
||||
%{_mavendepmapfragdir}/*
|
||||
%{_javadir}/%{name}.jar
|
||||
%files -f .mfiles
|
||||
%doc easymock/LICENSE.txt
|
||||
|
||||
%files javadoc -f .mfiles-javadoc
|
||||
%doc easymock/LICENSE.txt
|
||||
|
||||
%files javadoc
|
||||
%doc LICENSE
|
||||
%{_javadocdir}/%{name}
|
||||
|
||||
%changelog
|
||||
* Fri Aug 30 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:3.2-1
|
||||
- Update to upstream version 3.2
|
||||
|
||||
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.2-21
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user