summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2017-10-24 22:18:59 +0200
committerJulien Lepiller <julien@lepiller.eu>2017-11-02 13:06:56 +0100
commit0442d897e9e498cff647f03964689dc044825254 (patch)
tree061e4186a9e3d2766cc69d2bec8d4e98c07be937 /gnu/packages
parentca98e4481f41b8a0413f2660169d4326461c0dc5 (diff)
downloadguix-0442d897e9e498cff647f03964689dc044825254.tar.gz
gnu: Add java-testng.
* gnu/packages/java.scm (java-testng): New variable.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/java.scm60
1 files changed, 60 insertions, 0 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 7d2ab5fecb..681c5ab9d4 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -6457,3 +6457,63 @@ those in Perl and JavaScript.")
     (synopsis "FEST fluent assertions")
     (description "FEST-Assert provides a fluent interface for assertions.")
     (license license:asl2.0)))
+
+(define-public java-testng
+  (package
+    (name "java-testng")
+    (version "6.12")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/cbeust/testng/archive/"
+                                  version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "01j2x47wkj7n5w6gpcjfbwgc88ai5654b23lb87w7nsrj63m3by6"))))
+    (build-system ant-build-system)
+    (arguments
+     `(#:jdk ,icedtea-8; java.util.function
+       #:jar-name "java-testng.jar"
+       #:source-dir "src/main/java"
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'copy-resources
+           (lambda _
+             (copy-recursively "src/main/resources" "build/classes")
+             #t))
+         (add-before 'check 'copy-test-resources
+           (lambda _
+             (copy-recursively "src/test/resources" "build/test-classes")
+             #t))
+         (replace 'check
+           (lambda _
+             (system* "ant" "compile-tests")
+             ;; we don't have groovy
+             (substitute* "src/test/resources/testng.xml"
+               (("<class name=\"test.groovy.GroovyTest\" />") ""))
+             (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH")
+                                                         ":build/classes"
+                                                         ":build/test-classes")
+                             "-Dtest.resources.dir=src/test/resources"
+                             "org.testng.TestNG" "src/test/resources/testng.xml")))))))
+    (propagated-inputs
+     `(("junit" ,java-junit)
+       ("java-jsr305" ,java-jsr305)
+       ("java-bsh" ,java-bsh)
+       ("java-jcommander" ,java-jcommander)
+       ("java-guice" ,java-guice)
+       ("snakeyaml" ,java-snakeyaml)))
+    (native-inputs
+     `(("guava" ,java-guava)
+       ("java-javax-inject" ,java-javax-inject)
+       ("java-hamcrest" ,java-hamcrest-all)
+       ("java-assertj" ,java-assertj)
+       ("cglib" ,java-cglib)
+       ("asm" ,java-asm)
+       ("aopalliance" ,java-aopalliance)))
+    (home-page "http://testng.org")
+    (synopsis "Testing framework")
+    (description "TestNG is a testing framework inspired from JUnit and NUnit
+but introducing some new functionalities that make it more powerful and easier
+to use.")
+    (license license:asl2.0)))