From 7e2ae807467597bfc51904dab59abc5756a59e60 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 31 2016 08:52:29 +0000 Subject: import rh-maven33-mockito-1.10.19-7.3.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..82462ae --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/mockito-1.10.19.tar.xz diff --git a/.rh-maven33-mockito.metadata b/.rh-maven33-mockito.metadata new file mode 100644 index 0000000..879c429 --- /dev/null +++ b/.rh-maven33-mockito.metadata @@ -0,0 +1 @@ +62ba499229e43288fc4e9320124aaedf9601704b SOURCES/mockito-1.10.19.tar.xz 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/fix-bnd-config.patch b/SOURCES/fix-bnd-config.patch new file mode 100644 index 0000000..b0bec70 --- /dev/null +++ b/SOURCES/fix-bnd-config.patch @@ -0,0 +1,31 @@ +diff --git a/conf/mockito-core.bnd b/conf/mockito-core.bnd +index bd0ba61..8a8328a 100644 +--- a/conf/mockito-core.bnd ++++ b/conf/mockito-core.bnd +@@ -1,13 +1,11 @@ +--versionpolicy=[${version;==;${@}},${version;+;${@}}) +- +-Bundle-Name= Mockito Mock Library for Java. Core bundle requires Hamcrest-core and Objenesis. ++Bundle-Name= Mockito Mock Library for Java. Core bundle requires Hamcrest-core and Objenesis. + Bundle-SymbolicName= org.mockito.mockito-core +-Bundle-Version= ${version} ++Bundle-Version= 1.10.19 + + Export-Package= !org.mockito.asm.*, \ + !org.mockito.cglib.*, \ + !org.mockito.internal.*, \ +- org.mockito.*;version=${version} ++ org.mockito.* + + Import-Package= junit.*;resolution:=optional, \ + org.junit.*;resolution:=optional, \ +@@ -15,7 +13,8 @@ Import-Package= junit.*;resolution:=optional, \ + org.hamcrest;version="[1.0,3.0)", \ + org.objenesis;version="[2.1,3.0)", \ + org.mockito.asm.signature;resolution:=optional, \ +- org.mockito.* ++ org.mockito.*, \ ++ net.sf.cglib* + + Private-Package: org.mockito.* + diff --git a/SOURCES/fix-incompatible-types.patch b/SOURCES/fix-incompatible-types.patch new file mode 100644 index 0000000..10adc69 --- /dev/null +++ b/SOURCES/fix-incompatible-types.patch @@ -0,0 +1,12 @@ +diff --git a/src/org/mockito/internal/creation/instance/ObjenesisInstantiator.java b/src/org/mockito/internal/creation/instance/ObjenesisInstantiator.java +index 1ca0003..15172bd 100644 +--- a/src/org/mockito/internal/creation/instance/ObjenesisInstantiator.java ++++ b/src/org/mockito/internal/creation/instance/ObjenesisInstantiator.java +@@ -11,6 +11,6 @@ class ObjenesisInstantiator implements Instantiator { + private final ObjenesisStd objenesis = new ObjenesisStd(new GlobalConfiguration().enableClassCache()); + + public T newInstance(Class cls) { +- return objenesis.newInstance(cls); ++ return (T) objenesis.newInstance(cls); + } + } diff --git a/SOURCES/fixup-ant-script.patch b/SOURCES/fixup-ant-script.patch new file mode 100644 index 0000000..1d68dc6 --- /dev/null +++ b/SOURCES/fixup-ant-script.patch @@ -0,0 +1,87 @@ +--- build.xml.orig 2014-12-31 16:43:56.000000000 +0000 ++++ build.xml 2015-06-22 09:20:12.859059775 +0100 +@@ -81,6 +81,7 @@ + + + ++ + + + +@@ -207,18 +208,14 @@ + + + +- +- ++ ++ + + + + +- +- +- + +- +- ++ + + + +@@ -319,53 +316,10 @@ +

Click to see examples. Mockito ${version} API.

+ ]]> + +-
+- +- +- +- +- +- +- +- +- ]]> +-
+ + + +- +- +- +- +- +- ++ +
+ + diff --git a/SOURCES/make-mockito-sourcetarball.sh b/SOURCES/make-mockito-sourcetarball.sh new file mode 100755 index 0000000..195fec1 --- /dev/null +++ b/SOURCES/make-mockito-sourcetarball.sh @@ -0,0 +1,20 @@ +#!/bin/bash -ex + +VERSION=1.10.19 +SRCDIR=mockito-${VERSION} + +git clone https://github.com/mockito/mockito.git ${SRCDIR} +pushd $SRCDIR +git archive --format=tar --prefix=${SRCDIR}/ v${VERSION} > ../${SRCDIR}.tar +popd + +rm -rf ${SRCDIR} + +tar -xf ${SRCDIR}.tar +rm ${SRCDIR}.tar +pushd ${SRCDIR} +rm -rf `find -name *.jar` build.gradle cglib-and-asm doc gradle gradlew gradlew.bat +dos2unix `find -name *.java` +popd + +tar -cvJf mockito-${VERSION}.tar.xz ${SRCDIR} diff --git a/SOURCES/mockito-matcher.patch b/SOURCES/mockito-matcher.patch new file mode 100644 index 0000000..72cc1cb --- /dev/null +++ b/SOURCES/mockito-matcher.patch @@ -0,0 +1,39 @@ +From 02df4868e1614b9fd224e40c1556b78eeb01cd3d Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Wed, 4 Dec 2013 16:52:24 +0100 +Subject: [PATCH] mockito matcher + +Signed-off-by: Michael Simacek +--- + src/org/mockito/internal/matchers/LocalizedMatcher.java | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/org/mockito/internal/matchers/LocalizedMatcher.java b/src/org/mockito/internal/matchers/LocalizedMatcher.java +index d6dda04..9dffe06 100644 +--- a/src/org/mockito/internal/matchers/LocalizedMatcher.java ++++ b/src/org/mockito/internal/matchers/LocalizedMatcher.java +@@ -22,6 +22,12 @@ public class LocalizedMatcher implements Matcher, ContainsExtraTypeInformation, + this.location = new LocationImpl(); + } + ++ /* This is a hack for Fedora. Bug has been filed here: ++ * https://code.google.com/p/mockito/issues/detail?id=428 */ ++ public void describeMismatch(Object item, Description mismatchDescription) { ++ mismatchDescription.appendText("was ").appendValue(item); ++ } ++ + public void _dont_implement_Matcher___instead_extend_BaseMatcher_() { + // yeah right + } +@@ -37,7 +43,7 @@ public class LocalizedMatcher implements Matcher, ContainsExtraTypeInformation, + public Location getLocation() { + return location; + } +- ++ + @Override + public String toString() { + return "Localized: " + this.actualMatcher; +-- +1.8.3.1 + diff --git a/SOURCES/setting-naming-policy.patch b/SOURCES/setting-naming-policy.patch new file mode 100644 index 0000000..d4f30b1 --- /dev/null +++ b/SOURCES/setting-naming-policy.patch @@ -0,0 +1,34 @@ +From 04e36a01e93c3b79caa9f7e9e8573fe2a0d65d1a Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Thu, 5 Dec 2013 16:53:36 +0100 +Subject: [PATCH] Setting naming policy + +Signed-off-by: Michael Simacek +--- + src/org/mockito/internal/creation/cglib/CGLIBHacker.java | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/org/mockito/internal/creation/cglib/CGLIBHacker.java b/src/org/mockito/internal/creation/cglib/CGLIBHacker.java +index 172f744..de53ab1 100644 +--- a/src/org/mockito/internal/creation/cglib/CGLIBHacker.java ++++ b/src/org/mockito/internal/creation/cglib/CGLIBHacker.java +@@ -20,6 +20,9 @@ public class CGLIBHacker implements Serializable { + Field createInfoField = reflectOnCreateInfo(methodProxy); + createInfoField.setAccessible(true); + Object createInfo = createInfoField.get(methodProxy); ++ if (createInfo == null) { ++ return; ++ } + Field namingPolicyField = createInfo.getClass().getDeclaredField("namingPolicy"); + namingPolicyField.setAccessible(true); + if (namingPolicyField.get(createInfo) == null) { +@@ -43,4 +46,4 @@ public class CGLIBHacker implements Serializable { + } + return cglibMethodProxyClass.getDeclaredField("createInfo"); + } +-} +\ No newline at end of file ++} +-- +1.8.3.1 + diff --git a/SPECS/mockito.spec b/SPECS/mockito.spec new file mode 100644 index 0000000..efc9667 --- /dev/null +++ b/SPECS/mockito.spec @@ -0,0 +1,203 @@ +%global pkg_name mockito +%{?scl:%scl_package %{pkg_name}} +%{?maven_find_provides_and_requires} + +Name: %{?scl_prefix}%{pkg_name} +Version: 1.10.19 +Release: 7.3%{?dist} +Summary: A Java mocking framework + +License: MIT +URL: http://%{pkg_name}.org +Source0: %{pkg_name}-%{version}.tar.xz +Source1: make-%{pkg_name}-sourcetarball.sh +Patch0: fixup-ant-script.patch +Patch1: fix-bnd-config.patch +Patch2: %{pkg_name}-matcher.patch +# Workaround for NPE in setting NamingPolicy in cglib +Patch3: setting-naming-policy.patch +# because we have old objenesis +Patch4: fix-incompatible-types.patch + +BuildArch: noarch +BuildRequires: %{?scl_prefix}javapackages-local +BuildRequires: %{?scl_prefix_java_common}ant +BuildRequires: %{?scl_prefix_java_common}objenesis +BuildRequires: %{?scl_prefix_java_common}cglib +BuildRequires: %{?scl_prefix_java_common}junit +BuildRequires: %{?scl_prefix_java_common}hamcrest +BuildRequires: %{?scl_prefix}aqute-bnd + +Requires: %{?scl_prefix_java_common}objenesis +Requires: %{?scl_prefix_java_common}cglib +Requires: %{?scl_prefix_java_common}junit +Requires: %{?scl_prefix_java_common}hamcrest + +%description +Mockito is a mocking framework that tastes really good. It lets you write +beautiful tests with clean & simple API. Mockito doesn't give you hangover +because the tests are very readable and they produce clean verification +errors. + +%package javadoc +Summary: Javadocs for %{pkg_name} + +%description javadoc +This package contains the API documentation for %{pkg_name}. + +%prep +%setup -q -n %{pkg_name}-%{version} +%{?scl:scl enable %{scl} - <<"EOF"} +set -e -x +%patch0 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +# workaround rhbz#1292777 Files not found for javadoc generation +touch javadoc/stylesheet.css + +%pom_add_dep net.sf.cglib:cglib maven/%{pkg_name}-core.pom +find . -name "*.java" -exec sed -i "s|org\.%{pkg_name}\.cglib|net\.sf\.cglib|g" {} + +mkdir -p lib/compile +%{?scl:EOF} + +%build +%{?scl:scl enable %{scl} - <<"EOF"} +set -e -x +build-jar-repository lib/compile objenesis cglib junit hamcrest/core +ant jar javadoc +# Convert to OSGi bundle +pushd target +%if 0%{?fedora} >= 23 +bnd wrap \ + --version %{version} \ + --output %{pkg_name}-core-%{version}.bar \ + --properties ../conf/%{pkg_name}-core.bnd \ +%else +java -jar $(build-classpath aqute-bnd) wrap \ + -output %{pkg_name}-core-%{version}.bar \ + -properties ../conf/%{pkg_name}-core.bnd \ +%endif + %{pkg_name}-core-%{version}.jar +mv %{pkg_name}-core-%{version}.bar %{pkg_name}-core-%{version}.jar +popd + +sed -i -e "s|@version@|%{version}|g" maven/%{pkg_name}-core.pom +%mvn_artifact maven/%{pkg_name}-core.pom target/%{pkg_name}-core-%{version}.jar +%mvn_alias org.%{pkg_name}:%{pkg_name}-core org.%{pkg_name}:%{pkg_name}-all +%{?scl:EOF} + +%install +%{?scl:scl enable %{scl} - <<"EOF"} +set -e -x +%mvn_install -J target/javadoc +%{?scl:EOF} + +%files -f .mfiles +%dir %{_javadir}/%{pkg_name} +%dir %{_mavenpomdir}/%{pkg_name} +%doc LICENSE +%doc NOTICE + +%files javadoc -f .mfiles-javadoc +%doc LICENSE +%doc NOTICE + +%changelog +* Thu Apr 14 2016 Michal Srb - 1.10.19-7.3 +- Fix directory ownership (Resolves: rhbz#1325866) + +* Mon Feb 08 2016 Michal Srb - 1.10.19-7.2 +- Fix BR on maven-local & co. + +* Tue Jan 19 2016 Mikolaj Izdebski - 1.10.19-7.1 +- SCL-ize package + +* Fri Dec 25 2015 Raphael Groner - 1.10.19-7 +- introduce License tag + +* Fri Dec 25 2015 Raphael Groner - 1.10.19-6 +- reenable osgi + +* Fri Dec 18 2015 Raphael Groner - 1.10.19-5 +- workaround rhbz#1292777 stylesheet.css not found + +* Thu Jul 16 2015 Michael Simacek - 1.10.19-4 +- Use aqute-bnd-2.4.1 + +* Mon Jun 22 2015 Mat Booth - 1.10.19-3 +- Switch to mvn_install + +* Wed Jun 17 2015 Fedora Release Engineering - 1.10.19-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Apr 29 2015 Michal Srb - 1.10.19-1 +- Update to 1.10.19 + +* Mon Aug 25 2014 Darryl L. Pierce - 1.9.0-18 +- First build for EPEL7 +- Resolves: BZ#1110030 + +* Mon Jun 09 2014 Omair Majid - 1.9.0-17 +- Use .mfiles to pick up xmvn metadata +- Don't use obsolete _mavenpomdir and _mavendepmapfragdir macros +- Fix FTBFS + +* Sat Jun 07 2014 Fedora Release Engineering - 1.9.0-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu May 22 2014 Severin Gehwolf - 1.9.0-16 +- Use junit R/BR over junit4. + +* Fri Mar 28 2014 Michael Simacek - 1.9.0-15 +- Use Requires: java-headless rebuild (#1067528) + +* Wed Dec 11 2013 Michael Simacek - 1.9.0-14 +- Workaround for NPE in setting NamingPolicy + +* Sat Aug 03 2013 Fedora Release Engineering - 1.9.0-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Mar 25 2013 Tomas Radej - 1.9.0-12 +- Patched LocalizedMatcher due to hamcrest update, (bug upstream) + +* Thu Feb 14 2013 Fedora Release Engineering - 1.9.0-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Sep 6 2012 Severin Gehwolf 1.9.0-10 +- More Import-Package fixes. Note that fix-cglib-refs.patch is + not suitable for upstream: issue id=373 + +* Tue Sep 4 2012 Severin Gehwolf 1.9.0-9 +- Fix missing Import-Package in manifest. + +* Mon Aug 27 2012 Severin Gehwolf 1.9.0-8 +- Add aqute bnd instructions for OSGi metadata + +* Fri Jul 20 2012 Fedora Release Engineering - 1.9.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Apr 30 2012 Roman Kennke 1.9.0-6 +- Place JavaDoc in directly under /usr/share/javadoc/%{pkg_name} instead + of /usr/share/javadoc/%{pkg_name}/javadoc + +* Wed Apr 25 2012 Roman Kennke 1.9.0-5 +- Removed post/postun hook for update_maven_depmap + +* Tue Apr 24 2012 Roman Kennke 1.9.0-4 +- Fix groupId of cglib dependency +- Add additional depmap for mockito-all +- Update depmap on post and postun +- Fix version in pom + +* Wed Feb 22 2012 Roman Kennke 1.9.0-3 +- Added cglib dependency to pom + +* Tue Feb 21 2012 Roman Kennke 1.9.0-2 +- Include upstream Maven pom.xml in package +- Added missing Requires for cglib, junit4, hamcrest, objenesis +- Added source tarball generating script to sources + +* Thu Feb 16 2012 Roman Kennke 1.9.0-1 +- Initial package