使用pax检查问题安装OSGi捆绑包

使用pax检查问题安装OSGi捆绑包,osgi,apache-karaf,pax-exam,Osgi,Apache Karaf,Pax Exam,我试图编写spock pax考试扩展,但发现了使用服务器模式安装捆绑包的问题 这是我的密码 void visitSpecAnnotation(RunPax annotation, SpecInfo sp) { sp.addListener(new AbstractRunListener() { private TestContainer container @Override void beforeSpec(SpecInfo spec)

我试图编写spock pax考试扩展,但发现了使用服务器模式安装捆绑包的问题

这是我的密码

void visitSpecAnnotation(RunPax annotation, SpecInfo sp) {
    sp.addListener(new AbstractRunListener() {
        private TestContainer container

        @Override
        void beforeSpec(SpecInfo spec) {
            ExamSystem system = PaxExamRuntime.createServerSystem(
                    CoreOptions.options(
                            karafDistributionConfiguration("mvn:org.apache.servicemix/apache-servicemix/4.4.1-fuse-03-06/tar.gz", // artifact to unpack and use
                                    "servicemix", // name; display only
                                    "2.2.4")
                                    .unpackDirectory(new File("target/paxexam/unpack/"))
                                    .useDeployFolder(false),
                            //debugConfiguration("5005", true),
                            keepRuntimeFolder(),
                            configureConsole().ignoreLocalConsole(),
                            when(isEquinox()).useOptions(
                                    editConfigurationFilePut(
                                            KARAF_FRAMEWORK, "equinox"),
                                    systemProperty("pax.exam.framework").value(
                                            System.getProperty("pax.exam.framework")),
                                    //systemProperty("osgi.console").value("6666"),
                                    //systemProperty("osgi.console.enable.builtin").value("true")
                            ),
                            logLevel(WARN),
                            mavenBundle("org.sdo.coding", "words", "1.0")

                    ))
            container = PaxExamRuntime.createContainer(system)
            container.start()

            Thread.sleep(100000)

            def ant = new AntBuilder()
            ant.sshexec(host: "localhost",
                    port: '8101',
                    username: "smx",
                    password: 'smx',
                    trust: "yes",
                    command: "list",
                    outputproperty: 'result',
                    knownhosts: '/dev/null')

            def result = ant.project.properties.'result'
            println "result is $result"
            def installed = result =~ /(?m)^(.*Installed.*)$/
            println "installed ${installed[0]}"

        }
即使我增加延迟,我也找不到已安装的捆绑包。我可以看到mavenBundle选项不会影响karaf start,因为如果我放置了错误的版本或artifactId,pax不会通知我


有人对这个问题有任何线索吗

您可以使用调试日志运行示例吗?这可能会给你一个错误的线索。hwellmann谢谢你的提示,它确实帮助我理解我指定了错误的捆绑包版本