diff --git a/.devtoolset-3-easymock.metadata b/.devtoolset-3-easymock.metadata new file mode 100644 index 0000000..69c129f --- /dev/null +++ b/.devtoolset-3-easymock.metadata @@ -0,0 +1 @@ +c781fca5005e4efdfbfc90fc8ba4702698aa6366 SOURCES/easymock-3.2.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7e073fc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/easymock-3.2.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/easymock-remove-android-support.patch b/SOURCES/easymock-remove-android-support.patch new file mode 100644 index 0000000..53e101a --- /dev/null +++ b/SOURCES/easymock-remove-android-support.patch @@ -0,0 +1,222 @@ +From 210c8bae09fb9309519c8266b71635ef308872b3 Mon Sep 17 00:00:00 2001 +From: Michal Srb +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 createProxy(Class toMock, InvocationHandler handler, +- Method[] mockedMethods, ConstructorArgs constructorArgs) { +- final MockHandler interceptor = new MockHandler(handler, mockedMethods); +- try { +- ProxyBuilder 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 mockedMethods; +- +- public MockHandler(InvocationHandler delegate, Method... mockedMethods) { +- this.delegate = delegate; +- this.mockedMethods = (mockedMethods != null) +- ? new HashSet(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, + 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 + diff --git a/SPECS/easymock.spec b/SPECS/easymock.spec new file mode 100644 index 0000000..4ac4cbd --- /dev/null +++ b/SPECS/easymock.spec @@ -0,0 +1,188 @@ +%{?scl:%scl_package easymock} +%{!?scl:%global pkg_name %{name}} +%{!?maven_scl:%global maven_scl_prefix %{nil}} + +Name: %{?scl_prefix}easymock +Version: 3.2 +Release: 1%{?dist} +Summary: Easy mock objects +License: ASL 2.0 +URL: http://www.easymock.org + +Source0: https://github.com/easymock/easymock/archive/easymock-%{version}.tar.gz + +Patch5: %{pkg_name}-remove-android-support.patch + +BuildArch: noarch + +BuildRequires: %{maven_scl_prefix}maven-local +#BuildRequires: %{maven_scl_prefix}maven-timestamp-plugin +#BuildRequires: %{maven_scl_prefix}maven-license-plugin +BuildRequires: %{maven_scl_prefix}junit +BuildRequires: %{maven_scl_prefix}cglib +BuildRequires: %{maven_scl_prefix}maven-compiler-plugin +BuildRequires: %{maven_scl_prefix}maven-jar-plugin +BuildRequires: %{maven_scl_prefix}maven-remote-resources-plugin +BuildRequires: %{maven_scl_prefix}maven-surefire-plugin +BuildRequires: %{?scl_prefix}objenesis +BuildRequires: %{maven_scl_prefix}maven-plugin-build-helper + +#Obsoletes: %{pkg_name}3 < %{version}-%{release} +#Provides: %{pkg_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 %{pkg_name} + +%description javadoc +Javadoc for %{pkg_name}. + + +%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 +scl enable %{scl} - <<"EOF" +%mvn_file ":easymock{*}" easymock@1 easymock3@1 +%pom_remove_plugin com.keyboardsamurais.maven:maven-timestamp-plugin +%pom_remove_plugin com.mycila.maven-license-plugin:maven-license-plugin +EOF + +# ssh not needed during our builds +%pom_xpath_remove pom:extensions + +%build +scl enable %{scl} - <<"EOF" +%mvn_build +EOF + +%install +scl enable %{scl} - <<"EOF" +%mvn_install +EOF + +%files -f .mfiles +%doc easymock/LICENSE.txt + +%files javadoc -f .mfiles-javadoc +%doc easymock/LICENSE.txt + + +%changelog +* Wed May 28 2014 Sami Wagiaalla 3.2-1 +- Import from rawhide and build for DTS 3. + +* Thu Apr 4 2013 Krzysztof Daniel 0:1.2-23 +- Fix ommited name macro. + +* Thu Apr 4 2013 Krzysztof Daniel 0:1.2-22 +- Properly parametrize depmap macro. + +* Thu Apr 4 2013 Krzysztof Daniel 0:1.2-21 +- Import into devtoolset-2.0 branch +- Initial sclization. +- Drop javadoc subpackage. + +* Mon Feb 18 2013 Tomas Radej - 0:1.2-20 +- Fixed sources (bz #905973) + +* Wed Feb 13 2013 Fedora Release Engineering - 0:1.2-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Nov 27 2012 Tomas Radej - 0:1.2-18 +- Removed ownership of _mavenpomdir + +* Thu Aug 16 2012 Mikolaj Izdebski - 0:1.2-17 +- Add LICENSE file +- Remove rpm bug workaround +- Update to current packaging guidelines + +* Wed Jul 18 2012 Fedora Release Engineering - 0:1.2-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Feb 21 2012 Tomas Radej - 0:1.2-15 +- Removed test + +* Fri Jan 13 2012 Fedora Release Engineering - 0:1.2-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 0:1.2-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Nov 26 2010 Stanislav Ochotnicky - 0:1.2-12 +- Fix pom filename (Resolves rhbz#655795) +- Remove clean section and buildroot declaration +- Remove versioned jars and pom files + +* Thu Aug 20 2009 Alexander Kurtakov 0:1.2-11 +- Bump release for rebuild. + +* Thu Aug 20 2009 Alexander Kurtakov 0:1.2-10 +- Disable tests. + +* Mon May 18 2009 Fernando Nasser 0:1.2-9 +- Update instructions for obtaining source tar ball + +* Mon May 04 2009 Yong Yang 0:1.2-8 +- Rebuild with maven2-2.0.8 built in non-bootstrap mode + +* Wed Mar 18 2009 Yong Yang 0:1.2-7 +- merge from JPP-6 +- rebuild with new maven2 2.0.8 built in bootstrap mode + +* Mon Feb 02 2009 David Walluck 0:1.2-6 +- fix component-info.xml + +* Mon Feb 02 2009 David Walluck 0:1.2-5 +- remove unneeded maven flag + +* Mon Feb 02 2009 David Walluck 0:1.2-4 +- add repolib + +* Fri Jan 30 2009 Will Tatam 1.2-3.jpp5 +- Inital JPP-5 Build + +* Fri Jan 09 2009 Yong Yang 1.2-2jpp.1 +- Imported from dbhole's maven 2.0.8 packages, initial building on jpp6 + +* Fri Apr 11 2008 Deepak Bhole 1.2-1jpp.1 +- Import from JPackage +- Add pom file + +* Fri Feb 24 2006 Ralph Apel - 0:1.2-1jpp +- Update to 1.2 keeping only java 1.4 requirement + +* Fri Feb 24 2006 Ralph Apel - 0:1.1-3jpp +- drop java-1.3.1 requirement + +* Mon Oct 04 2004 Ralph Apel - 0:1.1-2jpp +- Fixed Url, Summary, Description and License + +* Mon Oct 04 2004 Ralph Apel - 0:1.1-1jpp +- First JPackage release