How to analyze low-level OSGi problems during tycho test execution?

╄→гoц情女王★ 提交于 2019-12-03 13:23:29

start tests in remote debug mode (simply specify -DdebugPort=8000 on the CLI) and start the OSGi console on a local port, e.g. 1234:

        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-surefire-plugin</artifactId>
            <version>${tycho-version}</version>
            <configuration>
                <systemProperties>
                  <osgi.console>1234</osgi.console>
                </systemProperties>
            </configuration>
        </plugin>

Set a breakpoint in one of your test classes or in org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter if tests are not even started. Then,

 telnet localhost 1234

and you can use the usual OSGi console commands like ss, diag, bundle etc. to analyze the problem "in vivo".

Alternatively you can run with -consolelog or set the eclipse.consoleLog property to true property. If you're running with Tycho, you can use <argLine>-Declipse.consoleLog=true</argLine>.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!