0

i have a question about JUnitServlet in CQ5 integration testing. I dont understand 2 things and i need help from somebody that had similar problem. So far I have package with only one test class with several testing methods. Everything works fine but there are this 2 problems:

  1. Why when I change the name of the testing class, the JunitServlet doesn't find it anymore. Even though i am doing building again and exporting the package and everything but just doesn't find it. It doesn't want to accept any other name different than the first one that i gave to the testing class. I want to change it because in the beginning i gave very specific name and than i added several testing methods and I want to change it to more general one for example "TestScenarioOne.java" ...

  2. The second problem is that after I finished this testing class I created new one to continue to test different scenarios. JUnitServlet finds just the first one but not and the new one as well ... Even though they are in the same package. I don't know what is the problem...

Thanks a lot and I am waiting for your answers ...

Bertrand Delacretaz
  • 6,100
  • 19
  • 24
Dragan
  • 500
  • 3
  • 11
  • I find out what is the problem :) In Older versions of Junit there is a naming convention of the testing class to contain the noun "Test" at the end. I was told that it in Junit version 4+ this was removed... Even though we use Junit 4+ version I tried and it works that was the only problem ... I hope this question will be also useful to other novices in cq5 integration testing with JUnitServlet ... Thanks :) – Dragan Jul 04 '12 at 10:21
  • Thanks for the question and answer...I just added the sling and junit tags, that might help people find it. – Bertrand Delacretaz Jul 04 '12 at 14:02

1 Answers1

0

I find out what is the problem :) In Older versions of Junit there is a naming convention of the testing class to contain the noun "Test" at the end. I was told that it in Junit version 4+ this was removed... Even though we use Junit 4+ version I tried and it works that was the only problem ... I hope this question will be also useful to other novices in cq5 integration testing with JUnitServlet ... Thanks :)

I put the answer as a comment few days ago but I decided to answer my question with an official answer so that it appears as answered question when somebody searches for something similar. Thanks

Dragan
  • 500
  • 3
  • 11