diff options
| author | Ricardo Wurmus <rekado@elephly.net> | 2017-03-07 19:51:50 +0100 |
|---|---|---|
| committer | Ricardo Wurmus <rekado@elephly.net> | 2017-05-15 21:59:54 +0200 |
| commit | 90e65abe426828d2077b1ae935f9c2d4075c4d5c (patch) | |
| tree | 832420d8186f31023756eafcad49e6783ba1bd64 /gnu/packages/java.scm | |
| parent | cdb2a21160a195f63c33955d8b9b9034e11dae46 (diff) | |
gnu: Add java-mockito-1.
* gnu/packages/java.scm (java-mockito): New variable.
Diffstat (limited to 'gnu/packages/java.scm')
| -rw-r--r-- | gnu/packages/java.scm | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 13e261438d3..900dbc8a5c5 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm | |||
| @@ -1975,6 +1975,68 @@ logging implementations. A library that uses the commons-logging API can be | |||
| 1975 | used with any logging implementation at runtime.") | 1975 | used with any logging implementation at runtime.") |
| 1976 | (license license:asl2.0))) | 1976 | (license license:asl2.0))) |
| 1977 | 1977 | ||
| 1978 | ;; This is the last release of the 1.x series. | ||
| 1979 | (define-public java-mockito-1 | ||
| 1980 | (package | ||
| 1981 | (name "java-mockito") | ||
| 1982 | (version "1.10.19") | ||
| 1983 | (source (origin | ||
| 1984 | (method url-fetch) | ||
| 1985 | (uri (string-append "http://repo1.maven.org/maven2/" | ||
| 1986 | "org/mockito/mockito-core/" version | ||
| 1987 | "/mockito-core-" version "-sources.jar")) | ||
| 1988 | (sha256 | ||
| 1989 | (base32 | ||
| 1990 | "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc")))) | ||
| 1991 | (build-system ant-build-system) | ||
| 1992 | (arguments | ||
| 1993 | `(#:jar-name "mockito.jar" | ||
| 1994 | #:tests? #f ; no tests included | ||
| 1995 | ;; FIXME: patch-and-repack does not support jars, so we have to apply | ||
| 1996 | ;; patches in build phases. | ||
| 1997 | #:phases | ||
| 1998 | (modify-phases %standard-phases | ||
| 1999 | ;; Mockito was developed against a different version of hamcrest, | ||
| 2000 | ;; which does not require matcher implementations to provide an | ||
| 2001 | ;; implementation of the "describeMismatch" method. We add this | ||
| 2002 | ;; simple definition to pass the build with our version of hamcrest. | ||
| 2003 | (add-after 'unpack 'fix-hamcrest-build-error | ||
| 2004 | (lambda _ | ||
| 2005 | (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java" | ||
| 2006 | (("public Matcher getActualMatcher\\(\\) .*" line) | ||
| 2007 | (string-append " | ||
| 2008 | public void describeMismatch(Object item, Description description) { | ||
| 2009 | actualMatcher.describeMismatch(item, description); | ||
| 2010 | }" | ||
| 2011 | line))) | ||
| 2012 | #t)) | ||
| 2013 | ;; Mockito bundles cglib. We have a cglib package, so let's use | ||
| 2014 | ;; that instead. | ||
| 2015 | (add-after 'unpack 'use-system-libraries | ||
| 2016 | (lambda _ | ||
| 2017 | (with-directory-excursion "src/org/mockito/internal/creation/cglib" | ||
| 2018 | (substitute* '("CGLIBHacker.java" | ||
| 2019 | "CglibMockMaker.java" | ||
| 2020 | "ClassImposterizer.java" | ||
| 2021 | "DelegatingMockitoMethodProxy.java" | ||
| 2022 | "MethodInterceptorFilter.java" | ||
| 2023 | "MockitoNamingPolicy.java" | ||
| 2024 | "SerializableMockitoMethodProxy.java" | ||
| 2025 | "SerializableNoOp.java") | ||
| 2026 | (("import org.mockito.cglib") "import net.sf.cglib"))) | ||
| 2027 | #t))))) | ||
| 2028 | (inputs | ||
| 2029 | `(("java-junit" ,java-junit) | ||
| 2030 | ("java-objenesis" ,java-objenesis) | ||
| 2031 | ("java-cglib" ,java-cglib) | ||
| 2032 | ("java-hamcrest-core" ,java-hamcrest-core))) | ||
| 2033 | (home-page "http://mockito.org") | ||
| 2034 | (synopsis "Mockito is a mock library for Java") | ||
| 2035 | (description "Mockito is a mocking library for Java which lets you write | ||
| 2036 | tests with a clean and simple API. It generates mocks using reflection, and | ||
| 2037 | it records all mock invocations, including methods arguments.") | ||
| 2038 | (license license:asl2.0))) | ||
| 2039 | |||
| 1978 | (define-public java-commons-cli | 2040 | (define-public java-commons-cli |
| 1979 | (package | 2041 | (package |
| 1980 | (name "java-commons-cli") | 2042 | (name "java-commons-cli") |
