maven


How to run single maven test with spaces within name


Normally using maven when I want to run a single test I would do something like this....
mvn clean test -Dtest= GetRegistrationValidatorTest#MyTestName
We have just changed our Groovy test names to be more meaningful using the following type of syntax.
class GetRegistrationValidatorTest {
#Test
void 'validation get registration chassis number success'() {
}
}
How can I run the single maven test when it is named as per above?
thanks
mvn clean test -Dtest='GetRegistrationValidatorTest#MyTestName'
Single quotes work for me, even with stranger characters than spaces:
class PlopTest {
#Test void 'Hey! Can you plöp?'() {
println "Sure..."
}
#Test void foo() {
assertTrue(false);
}
}
Then:
% mvn test -Dtest='PlopTest#Hey! Can you plöp?'
[...]
Running PlopTest
Sure...
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.91 sec
1 test run, no failure => it correctly executed only the single test I passed as argument.
If I try -Dtest='PlopTest' it runs both tests (and of course fails).

Related Links

Maven Grails web.xml
Can I make a Maven profile add webResources to a war and still add non-profiled webResources?
HTTP Status 409 - The target deployment path […] does not match the POM's expected path prefix
Maven command to go back to previous day snapshot
Maven site on multi module project could not resolve dependency
Glassfish Maven Deploy Plugin - Deployment Failure
zmq failed when running unit test in Intellij IDEA with Maven
How Can I Distribute Jetty With My WAR Using Maven?
Referencing the Maven dependencies in antrun plugin
eclipse comands.jar 3.3.0 dependency not found
Hot deploy on Glassfish at Netbeans
Maven compilation failure but dependencies exist
Deploy Artifact to Nexus from Eclipse
Problems adding xom to Maven project
Maven 3 antrun issue
Is there a way to tell maven to always use the latest _stable_ version of a dependency?

Categories

HOME
hive
react-virtualized
dot
tesseract
routes
spring-cloud-stream
blueprintjs
indesign
in-app-purchase
basic
python-unittest
gorm
reveal.js
iolanguage
apache-metamodel
text-rendering
contextmenu
swingx
conemu
autoconf
zurb-foundation-6
devops
android-widget
bootstrap-material-design
nhapi
minitab
elasticsearch-net
yadcf
exuberant-ctags
contact-form
calibre
stringtemplate
windows-dev-center
y86
jmonkeyengine
adobe-premiere
web-mining
node-gyp
babel-core
flickr-api
rainbowtable
hibernate-tools
prolog-setof
diagnostics
knpmenubundle
flow-control
jspdf-autotable
bind9
query-performance
firmata
heidisql
slicknav
adxstudio-portals
file-writing
login-control
asp.net-4.5
qpid
testng-dataprovider
ipconfig
cloudbees
freedesktop.org
vhd
eclipse-clp
t4mvc
iis-arr
sysinternals
c++03
block-device
jsonpickle
openexr
ceil
kgdb
bundles
srs
page-layout
jplaton
dataadapter
robotics-studio
clipper
simba
chrono
nsobject
hirefire
w3wp.exe
gallio
preference
ext3
project-hosting
nerddinner
django-notification
commodore
paul-graham

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App