Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Executing a single test in an installed maven jar

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jar installed in my local ~/.m2 repo and I would like to execute a single test using the '-Dtest' option via a python script. I tried using this command on the command line ' mvn surefire:test -DdependenciesToScan=groupId:artifactId -Dtest=NameOfTest' on the command line however it doesn't seem like maven is not finding the NameOfTest in the groupId:artifactId dependency and returning back with no tests executed? Any way to execute a single test in an already installed maven artifact?
 
Sheriff
Posts: 4885
317
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you've used "mvn clean install" to build the jar then by default test cases are not included in the jar. And why would they be? The tests have been run successfully before packaging up in the jar so you don't need to run it again. Right?
 
Salil Surendran
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Cooke wrote:Assuming you've used "mvn clean install" to build the jar then by default test cases are not included in the jar. And why would they be? The tests have been run successfully before packaging up in the jar so you don't need to run it again. Right?


Yes I see your point. I have generated the tests jar. the reason I want to execute the tests in this jar is because as part of a integration test suite I have to execute the tests related to a particular module. So given that I will not have a pom file is there a way to just execute the test purely via a python script just by putting all the arguments like dependencies and dependencies to scan in a command line?
 
    Bookmark Topic Watch Topic
  • New Topic