0

I have create a small web project using maven.so I want to add test classes and directory to that project.I'm using eclipse as IDE my source folder is "src/main/java" I added test source folder "src/test/java" and added one test class with one test selenium casetry to compile and run it using "mvn test" command,But console only shows "run 0 failure 0 error 0 skip 0",Can any one explain me how to run my testcases properly,is there any configurations to do ? thnxx

1 Answer 1

1

mvn test runs unit tests without additional configuration, but for selenium you need to refer to selenium maven plugin.

If your tests are not in the default location src/test/java, you can specify the alternate location as follows:

<testSourceDirectory>${basedir}/my/alternate/location</testSourceDirectory>
7
  • yaa I know that I added that one also.In my project there is no test package so how can I add test package manually to maven.I want to run that test.
    – 123Ex
    Jan 13, 2011 at 6:21
  • @123Ex maven runs all tests in src/test/java - so not sure you mean by test package.
    – Raghuram
    Jan 13, 2011 at 6:31
  • It is like this I have create a simple maven project,But that did not contain "src/test/java" what I have done is I create a that folder manually using my eclipse IDE,then I tried "mvn test" but that did not compile my test classes and does not show test class in out put test folder so how can I correct this ??thnxx for the reply!!
    – 123Ex
    Jan 13, 2011 at 6:51
  • Well, that should be ok. Is your folder structure correct - does src have two sub-folders - main and test? Does mvn test run fine outside Eclipse?
    – Raghuram
    Jan 13, 2011 at 6:58
  • that is the problem I think my folder structure is not correct,mvn test runs fine but that does not show any test,so how can I integrate my test cases to this??can you explain me?
    – 123Ex
    Jan 13, 2011 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.