summaryrefslogtreecommitdiff
path: root/pcr/mockito
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2015-09-18 18:43:40 -0500
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-09-22 16:15:06 -0300
commit5e17a85578129419f270c74e62d8a705f79b91c2 (patch)
tree947dad04c2040d0e5bb42609fd8c3aa2dbad66b0 /pcr/mockito
parent52fac76a8f206dccb37aa126cb6ff6eca7bb3c23 (diff)
downloadabslibre-5e17a85578129419f270c74e62d8a705f79b91c2.tar.gz
abslibre-5e17a85578129419f270c74e62d8a705f79b91c2.tar.bz2
abslibre-5e17a85578129419f270c74e62d8a705f79b91c2.zip
mockito: add new package to [pcr]
Diffstat (limited to 'pcr/mockito')
-rw-r--r--pcr/mockito/PKGBUILD57
-rw-r--r--pcr/mockito/mockito-hamcrest_interfaces.patch13
-rw-r--r--pcr/mockito/mockito-use_system_libraries.patch100
3 files changed, 170 insertions, 0 deletions
diff --git a/pcr/mockito/PKGBUILD b/pcr/mockito/PKGBUILD
new file mode 100644
index 000000000..7cf557dbe
--- /dev/null
+++ b/pcr/mockito/PKGBUILD
@@ -0,0 +1,57 @@
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+
+pkgname=mockito
+pkgver=1.10.19
+pkgrel=1
+pkgdesc="Mocking framework for Java"
+arch=('any')
+url="https://github.com/mockito/mockito"
+license=('MIT')
+depends=('java-runtime')
+makedepends=('cglib' 'java-environment' 'java-hamcrest' 'jh' 'junit' 'objenesis')
+source=("https://github.com/${pkgname}/${pkgname}/archive/v${pkgver}.tar.gz"
+ "https://repo1.maven.org/maven2/org/${pkgname}/${pkgname}-core/${pkgver}/${pkgname}-core-${pkgver}.pom"
+ "mockito-use_system_libraries.patch"
+ "mockito-hamcrest_interfaces.patch")
+md5sums=('6e7d57d5f58fc551880d3e4685c7f569'
+ 'a96d6f1ec0e75e890e98cc4a8d4bed62'
+ '802ddd127fdedfa2f8f9390ca0292ca3'
+ '00a64b1b14a9ce6e7be878d16dbecaa8')
+
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -Np1 -i "${srcdir}/mockito-use_system_libraries.patch"
+ patch -Np1 -i "${srcdir}/mockito-hamcrest_interfaces.patch"
+ rm -v $(find . -name \*.jar)
+ mkdir -p build/classes
+}
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ CLASSPATH="/usr/share/java/cglib.jar:/usr/share/java/hamcrest-core.jar"
+ CLASSPATH="$CLASSPATH:/usr/share/java/junit.jar:/usr/share/java/objenesis.jar"
+ javac -classpath $CLASSPATH -d "build/classes" \
+ $(find "src" -name \*.java)
+ javadoc -classpath $CLASSPATH -d "build/javadoc" \
+ -sourcepath "src" -subpackages org
+
+ jar -cvf "${pkgname}.jar" -C "build/classes" .
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # Install documentation
+ install -d "${pkgdir}/usr/share/doc/${pkgname}"
+ cp -r "build/javadoc" "${pkgdir}/usr/share/doc/${pkgname}"
+
+ # Install Maven artifacts
+ export DESTDIR=${pkgdir}
+ jh mvn-install "org.mockito" "${pkgname}-core" ${pkgver} \
+ "${srcdir}/${pkgname}-core-${pkgver}.pom" \
+ "${pkgname}.jar" \
+ "${pkgname}.jar"
+ ln -s "/usr/share/java/${pkgname}.jar" \
+ "${pkgdir}/usr/share/java/${pkgname}-${pkgver}.jar"
+}
diff --git a/pcr/mockito/mockito-hamcrest_interfaces.patch b/pcr/mockito/mockito-hamcrest_interfaces.patch
new file mode 100644
index 000000000..2f41bc1e4
--- /dev/null
+++ b/pcr/mockito/mockito-hamcrest_interfaces.patch
@@ -0,0 +1,13 @@
+--- mockito-1.10.19.orig/src/org/mockito/internal/matchers/LocalizedMatcher.java 2014-12-31 11:43:56.000000000 -0500
++++ mockito-1.10.19/src/org/mockito/internal/matchers/LocalizedMatcher.java 2015-09-18 15:52:13.398123998 -0500
+@@ -36,6 +36,10 @@
+ actualMatcher.describeTo(description);
+ }
+
++ public void describeMismatch(Object item, Description description) {
++ actualMatcher.describeMismatch(item, description);
++ }
++
+ public Location getLocation() {
+ return location;
+ }
diff --git a/pcr/mockito/mockito-use_system_libraries.patch b/pcr/mockito/mockito-use_system_libraries.patch
new file mode 100644
index 000000000..935599605
--- /dev/null
+++ b/pcr/mockito/mockito-use_system_libraries.patch
@@ -0,0 +1,100 @@
+--- mockito-1.10.19.orig/src/org/mockito/internal/creation/cglib/CGLIBHacker.java 2014-12-31 11:43:56.000000000 -0500
++++ mockito-1.10.19/src/org/mockito/internal/creation/cglib/CGLIBHacker.java 2015-09-18 15:31:22.878230564 -0500
+@@ -4,7 +4,7 @@
+ */
+ package org.mockito.internal.creation.cglib;
+
+-import org.mockito.cglib.proxy.MethodProxy;
++import net.sf.cglib.proxy.MethodProxy;
+
+ import java.io.Serializable;
+ import java.lang.reflect.Field;
+--- mockito-1.10.19.orig/src/org/mockito/internal/creation/cglib/CglibMockMaker.java 2014-12-31 11:43:56.000000000 -0500
++++ mockito-1.10.19/src/org/mockito/internal/creation/cglib/CglibMockMaker.java 2015-09-18 15:31:48.654757617 -0500
+@@ -4,8 +4,8 @@
+ */
+ package org.mockito.internal.creation.cglib;
+
+-import org.mockito.cglib.proxy.Callback;
+-import org.mockito.cglib.proxy.Factory;
++import net.sf.cglib.proxy.Callback;
++import net.sf.cglib.proxy.Factory;
+ import org.mockito.exceptions.base.MockitoException;
+ import org.mockito.internal.InternalMockHandler;
+ import org.mockito.internal.creation.instance.InstantiatorProvider;
+--- mockito-1.10.19.orig/src/org/mockito/internal/creation/cglib/ClassImposterizer.java 2014-12-31 11:43:56.000000000 -0500
++++ mockito-1.10.19/src/org/mockito/internal/creation/cglib/ClassImposterizer.java 2015-09-18 15:33:39.454157490 -0500
+@@ -4,10 +4,10 @@
+ */
+ package org.mockito.internal.creation.cglib;
+
+-import org.mockito.cglib.core.CodeGenerationException;
+-import org.mockito.cglib.core.NamingPolicy;
+-import org.mockito.cglib.core.Predicate;
+-import org.mockito.cglib.proxy.*;
++import net.sf.cglib.core.CodeGenerationException;
++import net.sf.cglib.core.NamingPolicy;
++import net.sf.cglib.core.Predicate;
++import net.sf.cglib.proxy.*;
+ import org.mockito.exceptions.base.MockitoException;
+ import org.mockito.internal.creation.instance.InstantationException;
+ import org.mockito.internal.creation.instance.Instantiator;
+--- mockito-1.10.19.orig/src/org/mockito/internal/creation/cglib/DelegatingMockitoMethodProxy.java 2014-12-31 11:43:56.000000000 -0500
++++ mockito-1.10.19/src/org/mockito/internal/creation/cglib/DelegatingMockitoMethodProxy.java 2015-09-18 15:34:22.997254980 -0500
+@@ -4,7 +4,7 @@
+ */
+ package org.mockito.internal.creation.cglib;
+
+-import org.mockito.cglib.proxy.MethodProxy;
++import net.sf.cglib.proxy.MethodProxy;
+ import org.mockito.internal.creation.util.MockitoMethodProxy;
+
+ class DelegatingMockitoMethodProxy implements MockitoMethodProxy {
+--- mockito-1.10.19.orig/src/org/mockito/internal/creation/cglib/MethodInterceptorFilter.java 2014-12-31 11:43:56.000000000 -0500
++++ mockito-1.10.19/src/org/mockito/internal/creation/cglib/MethodInterceptorFilter.java 2015-09-18 15:35:14.710308218 -0500
+@@ -5,8 +5,8 @@
+
+ package org.mockito.internal.creation.cglib;
+
+-import org.mockito.cglib.proxy.MethodInterceptor;
+-import org.mockito.cglib.proxy.MethodProxy;
++import net.sf.cglib.proxy.MethodInterceptor;
++import net.sf.cglib.proxy.MethodProxy;
+ import org.mockito.internal.InternalMockHandler;
+ import org.mockito.internal.creation.DelegatingMethod;
+ import org.mockito.internal.creation.util.MockitoMethodProxy;
+--- mockito-1.10.19.orig/src/org/mockito/internal/creation/cglib/MockitoNamingPolicy.java 2014-12-31 11:43:56.000000000 -0500
++++ mockito-1.10.19/src/org/mockito/internal/creation/cglib/MockitoNamingPolicy.java 2015-09-18 15:35:55.766752509 -0500
+@@ -4,7 +4,7 @@
+ */
+ package org.mockito.internal.creation.cglib;
+
+-import org.mockito.cglib.core.DefaultNamingPolicy;
++import net.sf.cglib.core.DefaultNamingPolicy;
+
+ class MockitoNamingPolicy extends DefaultNamingPolicy {
+
+--- mockito-1.10.19.orig/src/org/mockito/internal/creation/cglib/SerializableMockitoMethodProxy.java 2014-12-31 11:43:56.000000000 -0500
++++ mockito-1.10.19/src/org/mockito/internal/creation/cglib/SerializableMockitoMethodProxy.java 2015-09-18 15:36:38.069856715 -0500
+@@ -4,7 +4,7 @@
+ */
+ package org.mockito.internal.creation.cglib;
+
+-import org.mockito.cglib.proxy.MethodProxy;
++import net.sf.cglib.proxy.MethodProxy;
+ import org.mockito.internal.creation.util.MockitoMethodProxy;
+ import org.mockito.internal.util.reflection.Whitebox;
+
+--- mockito-1.10.19.orig/src/org/mockito/internal/creation/cglib/SerializableNoOp.java 2014-12-31 11:43:56.000000000 -0500
++++ mockito-1.10.19/src/org/mockito/internal/creation/cglib/SerializableNoOp.java 2015-09-18 15:37:15.342988164 -0500
+@@ -4,8 +4,8 @@
+ */
+ package org.mockito.internal.creation.cglib;
+
+-import org.mockito.cglib.proxy.Callback;
+-import org.mockito.cglib.proxy.NoOp;
++import net.sf.cglib.proxy.Callback;
++import net.sf.cglib.proxy.NoOp;
+
+ import java.io.Serializable;
+