简体   繁体   English

karaf容器中的OSGI集成测试

[英]OSGI Integration test in karaf container

I am new to Karaf IT testing within the karaf container. 我是karaf容器中的Karaf IT测试的新手。 I created a small practice project Practice OSGI project . 我创建了一个小型实践项目Practice OSGI项目 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. 我可以在karaf容器(3.0.8)中运行它们,并且可以进行其余操作以手动对其进行测试,因此所有捆绑软件都运行良好。 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). 在这里,我的目标是运行一个简单的命令,例如mvn clean installmvn clean test以便它构建完整的项目,并使用集成测试对它进行最终测试(部署karaf容器,部署捆绑包并执行测试用例,然后关闭容器)。

I hope I am able to explain my objective and question well. 我希望我能很好地解释我的目标和问题。

Any help will be greatly appreciated. 任何帮助将不胜感激。

Your test code is in the wrong directory. 您的测试代码在错误的目录中。 It is in src/test/main/java while it should be in src/test/java . 它在src/test/main/java而应该在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. 我看到您的maven项目都具有0.1版,这在maven中不是一个好主意。 You should always use a SNAPSHOT version. 您应该始终使用SNAPSHOT版本。 Release version should only be built and deployed once as they can not be overwritten in a remote maven repo. 发布版本只能构建和部署一次,因为它们不能在远程Maven存储库中被覆盖。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM