Pax Exam unit tests

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Pax Exam unit tests

Dominik Marciniszyn
This post has NOT been accepted by the mailing list yet.

I'm trying to test my own custom commands which I've created. I used pax exam documentation to do needed configuration. I have:
        public Option[] config() {
                MavenArtifactUrlReference karafUrl = maven()
                MavenUrlReference karafStandardRepository = maven()
                return new Option[] {
                                .unpackDirectory(new File("target/exam"))
                                features(karafStandardRepository, "scr")
And my simple test:
        public void testKarafNativeCommand() throws IOException {
                String commandResult = executeCommand("bundle:list");
                assertThat(commandResult, notNullValue());
If I run this, everything is fine. Then I was trying to add my own bundle with commands and after features in config() method I've added:

After run by 'mvn install' I must wait and in result I get:
<testcase name="" classname="org.apache.maven.surefire.junit4.JUnit4Provider" time="182.499">
    <error message="Container never came up" type="java.lang.RuntimeException">java.lang.RuntimeException: Container never came up
                at org.apache.maven.surefire.junit4.JUnit4Provider.execute(
                at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(
                at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
                at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(

Could you give me any advice what I'm doing wrong or how can I fix this?
I'll be glad for any help.