Run maven test
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 09 Jul 2014 23:22:31 +0300
changeset 1145 ce218b01999d
parent 1144 7b3c20a4ddfa
child 1149 88af326c1164
Run maven test
maven-central.el
--- a/maven-central.el	Wed Jul 09 23:18:24 2014 +0300
+++ b/maven-central.el	Wed Jul 09 23:22:31 2014 +0300
@@ -199,6 +199,15 @@
       (compilation-start
        (format "%s exec:java -Dexec.mainClass=%s" maven.command (maven.file-package))))))
 
+(defun maven.run-test ()
+  "Run test -Dtest=... for current file."
+  (interactive)
+  (let* ( (default-directory (concat (maven.project-root) "/")) )
+    (if (not default-directory)
+        (message "Can't find maven project root")
+      (compilation-start
+       (format "%s test -Dtest=%s" maven.command (maven.file-package))))))
+
 ;; (maven-central.last-version "junit" "junit")
 
 (provide 'maven-central)