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

What's the recommended way of building ELKI's current development status?
Maven:Non-resolvable parent POM and 'parent.relativePath' points at wrong local POM
Integration testing Maven jar in a Jetty container
Why after compiling/building my AWS sdk jar is only 3kb?
maven exec plugin doesn't recognize cucumber test class
Remove empty parent XML tags using jaxb2 fluent builder
Failed to build multiple assemblies in maven. No assemby descriptor found
Maven site deploy logs filling with [WARNING] Required credentials to nexus 3
why am i not able to download any dependancy from maven?
Error in running a spring batch war file
gradle download all dependencies from maven repo
phantomjs-maven-plugin : error Could not find a suitable constructor
Where to add Maven dependencies in a multi-module Vaadin project in NetBeans 8?
SBT unresolved dependency: com.paypal.sdk#paypal-core;LATEST
Expected GPG user ID for Maven Central artifacts?
Maven release from a branch by jenkins

Categories

HOME
sendgrid
homebrew
lodash
yahoo-oauth
jsrender
uber-api
podio
qore
node-notifier
cross-validation
nano-server
moonmail
uitypeeditor
karma-jasmine
emulator
swingx
plunker
swiftlint
intentfilter
dcevm
kudan
format-specifiers
lcd
dxf
xpages-ssjs
linkerd
typo3-6.2.x
saas
msys2
bcd
yadcf
functor
semantic-versioning
xmlreader
bytecode-manipulation
git-merge
libraries
service-discovery
webdriver-manager
splice
azure-ml
ncalc
heightmap
smartcontracts
prolog-setof
gabor-filter
diagnostics
imanage
bind9
watchconnectivity
mikroc
disque
pagerank
marching-cubes
mutation-observers
wireshark-dissector
tarjans-algorithm
0xdbe
ibaction
truevault
network-interface
onactivityresult
elliptic-curve
wp-query
yorick
hippomocks
mysql-error-1062
dealloc
java.nio.file
monomac
fmod
quantlib-swig
web2py-modules
pushbackinputstream
jelly
robotics-studio
wsdl-2.0
selected
appconkit
osql
reddot
work-stealing
nsobject
hirefire
psi
rfc1123
javax.script
calling-convention
remember-me
radcombobox
web-application-design
infrastructure
audio-capture
aquaticprime
caching-application-block

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