Sure fire expects test class names to begin or end with Test unless you configure it otherwise... Rename your test and it will run ;-)
On Saturday, 18 February 2012, Gogirl <claudia.fr...@gmail.com> wrote: > Wayne wrote> I am guessing that you made changes but did not re-import yet. > I am only using the IDE Editor to edit. > Sorry for the mixup. I am only using the console and a simple bat file with > maven goals and phases. > > I have made the following changes to the original Maven in 5 min example: > Changes to the .pom > I added the TestNG dependency and vertified that the jars were loaded in the > . m folder. > Added the surefire plugin as explained to be able to run tests: > http://maven.apache.org/plugins/maven-surefire-plugin/usage.html > I "had" added a test src file AppTestNG.java and some others "as is" > http://www.mkyong.com/maven/how-to-run-unit-test-with-maven/ > and placed the new src files under the same test folder as AppTest. > However I removed them as soon as i discovered that Maven won't run any > tests for me > neither junit nor testng. > Result Tests run:0 > Read: > http://maven.apache.org/general.html#run-one-test > http://maven.apache.org/plugins/maven-surefire-plugin/usage.html > http://maven.apache.org/plugins/maven-surefire-plugin/examples/single-test.html > > I even tried > java -cp target/mavenHelloWorld-1.0-SNAPSHOT.jar com.mycompany.app.AppTest > *****ERROR MESSAGE: Cannot find or load AppTest > > > Here is the bat file with the commands I use: > > > @echo off > echo ***************************************** > echo Run a single test case > echo Expected Output: 6 test case run > echo *****ERROR MESSAGE: Failed to execute goal on > echo surefire plugin No tests were executed > echo ***************************************** > mvn -Dtest=AppTestNG test > GOTO EndComment > @echo off > echo ***************************************** > echo See maven-in-five-minutes > echo Using mc.bat > echo SWITCH TO MAVEN PROJECTS DIR: > echo C:\Users\GoGirl\_MavenProjects\mavenHelloWorld > echo ***************************************** > echo. > CD C:\Users\GoGirl\_MavenProjects\mavenHelloWorld > echo ***************************************** > echo CLEAN: Expected Output: Target Folder removed > echo ***************************************** > echo. > mvn clean > echo. > @echo off > echo ***************************************** > echo COMPILE: > echo Expected Output: Hello World > echo ***************************************** > echo. > mvn compile > echo. > echo ***************************************** > echo Test: > echo Expected Output: Compile tests (does not run them) > echo ***************************************** > echo. > mvn test > echo. > echo ***************************************** > echo BUILD & COMPILE ALL: > echo Rather than a goal, package is a phase > echo in the build lifecycle creating an executable jar > echo Expected output: Target folder created > echo ***************************************** > echo. > mvn package > echo. > @echo off > echo ***************************************** > echo Test the newly compiled and packaged JAR > echo using java -cp: Expected Output: Hello World > echo ***************************************** > echo. > java -cp target/mavenHelloWorld-1.0-SNAPSHOT.jar com.mycompany.app.App > echo. > echo ***************************************** > echo Test the newly compiled and packaged JAR > echo *****ERROR MESSAGE: Cannot find or load AppTest > echo ***************************************** > echo. > java -cp target/mavenHelloWorld-1.0-SNAPSHOT.jar com.mycompany.app.AppTest > echo. > echo ***************************************** > echo Compile all tests > echo Without running them > echo BUILD SUCCESS > echo ***************************************** > echo. > mvn test-compile > echo: check package name matches directory structure > C:\Users\GoGirl\_MavenProjects\mavenHelloWorld\src\test\java\com\mycompany\app > :EndComment > > > > > > -- > View this message in context: http://maven.40175.n5.nabble.com/Maven-fails-to-run-any-tests-was-TestNG-dependency-not-found-tp5495324p5495324.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >