0

I am new to Karaf IT testing within the karaf container. I created a small practice project Practice OSGI project. All the bundles are running fine as I am able to run them in karaf container(3.0.8) and able to make a rest hit to manually test it out. But Now I am trying to test it via integration tests. I wrote a testcase as well, but when I try to execute it, the maven says, no tests to build. Here my objective is to run a simple command like mvn clean install or mvn clean test so that it builds the complete project and in end test it using integration test(deploy karaf container, deploy bundles and execute the test cases, and bring the container down).

I hope I am able to explain my objective and question well.

Any help will be greatly appreciated.

Community
  • 1
  • 1
Jayesh
  • 402
  • 1
  • 4
  • 22

1 Answers1

1

Your test code is in the wrong directory. It is in src/test/main/java while it should be in src/test/java.

After this change the test runs but produces an exception. So there is more to fix but I guess this already helps you a bit.

Btw. I saw that your maven projects all have version 0.1 this is not a good idea in maven. You should always use a SNAPSHOT version. Release version should only be built and deployed once as they can not be overwritten in a remote maven repo.

Christian Schneider
  • 19,420
  • 2
  • 39
  • 64
  • That folder issue did solved my problem of not picking up the ITCase file for execution. Also I updated the project version as per your suggestion. Thanks a lot. But now I am facing some issues which I am trying to solve. Incase I am unable to, I'll get back here. – Jayesh Mar 26 '17 at 04:24
  • I did some corrections in IT module and it started to work, but only a little bit. As first of all, the entire suite is running 2 times, secondly, the default log file is not having enough details about whats going on in the background(how can I fix that?). Thirdly and finally, there are some errors are shown at the time of `mvn clean install`. I am doubtful if the TCs are running successfully. Please enlighten me. Thanks. – Jayesh Mar 27 '17 at 08:15
  • Accepting your answer as it broke my deadlock in writing IT cases. – Jayesh Mar 27 '17 at 08:18
  • 1
    I got your test working and did a pull request on your repo. – Christian Schneider Mar 28 '17 at 10:48
  • I also got it working... w.ll surly check your code as well... Thanks for the pull request. I have also updated my code (my way) in the repo. Please do take a look as and when you are free... do provide your inputs. – Jayesh Mar 28 '17 at 18:00
  • Your feedback regarding putting dependencies in parent, that I did as I was unsure where I did wrong. Now since everything is working, I'll be optimizing it for sure. Thanks for your valuable feedback. – Jayesh Mar 28 '17 at 18:08