From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d71mb-00041K-N2 for guix-patches@gnu.org; Sat, 06 May 2017 11:38:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d71ma-0003mO-Bs for guix-patches@gnu.org; Sat, 06 May 2017 11:38:09 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60151) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d71ma-0003mD-8Q for guix-patches@gnu.org; Sat, 06 May 2017 11:38:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d71ma-0002Rn-2Z for guix-patches@gnu.org; Sat, 06 May 2017 11:38:08 -0400 Subject: bug#26803: [PATCH 27/36] gnu: Add java-mockito-1. Resent-Message-ID: From: Ricardo Wurmus Date: Sat, 6 May 2017 17:36:08 +0200 Message-Id: <20170506153617.3074-27-rekado@elephly.net> In-Reply-To: <20170506153617.3074-1-rekado@elephly.net> References: <20170506153617.3074-1-rekado@elephly.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 26803@debbugs.gnu.org Cc: Ricardo Wurmus * gnu/packages/java.scm (java-mockito): New variable. --- gnu/packages/java.scm | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 859f9934a..2cf2821c0 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1977,6 +1977,66 @@ logging implementations. A library that uses the commons-logging API can be used with any logging implementation at runtime.") (license license:asl2.0))) +;; This is the last release of the 1.x series. +(define-public java-mockito-1 + (package + (name "java-mockito") + (version "1.10.19") + (source (origin + (method url-fetch) + (uri (string-append "http://repo1.maven.org/maven2/" + "org/mockito/mockito-core/" version + "/mockito-core-" version "-sources.jar")) + (sha256 + (base32 + "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc")))) + (build-system ant-build-system) + (arguments + `(#:jar-name "mockito.jar" + #:tests? #f ; no tests included + ;; FIXME: patch-and-repack does not support jars, so we have to apply + ;; patches in build phases. + #:phases + (modify-phases %standard-phases + ;; Mockito fails to build with our verson of hamcrest without this + ;; definition. + (add-after 'unpack 'fix-hamcrest-build-error + (lambda _ + (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java" + (("public Matcher getActualMatcher\\(\\) .*" line) + (string-append " + public void describeMismatch(Object item, Description description) { + actualMatcher.describeMismatch(item, description); + }" + line))) + #t)) + ;; Mockito bundles cglib. We have a cglib package, so let's use + ;; that instead. + (add-after 'unpack 'use-system-libraries + (lambda _ + (with-directory-excursion "src/org/mockito/internal/creation/cglib" + (substitute* '("CGLIBHacker.java" + "CglibMockMaker.java" + "ClassImposterizer.java" + "DelegatingMockitoMethodProxy.java" + "MethodInterceptorFilter.java" + "MockitoNamingPolicy.java" + "SerializableMockitoMethodProxy.java" + "SerializableNoOp.java") + (("import org.mockito.cglib") "import net.sf.cglib"))) + #t))))) + (inputs + `(("java-junit" ,java-junit) + ("java-objenesis" ,java-objenesis) + ("java-cglib" ,java-cglib) + ("java-hamcrest-core" ,java-hamcrest-core))) + (home-page "http://mockito.org") + (synopsis "Mockito is a mock library for Java") + (description "Mockito is a mocking library for Java which lets you write +tests with a clean and simple API. It generates mocks using reflection, and +it records all mock invocations, including methods arguments.") + (license license:asl2.0))) + (define-public java-commons-cli (package (name "java-commons-cli") -- 2.12.2