سؤال

عند استخدام Tycho لإنشاء مشروع، يتم تشغيل حالات الاختبار في عملية جديدة باستخدام مشغل Equinox للتشغيل -application org.eclipse.tycho.surefire.osgibooter.headlesstest.

كيف يمكنني تصحيح حالات الاختبار؟

هل كانت مفيدة؟

المحلول

هناك طريقة أسهل بكثير لتحقيق ذلك:

فقط اضف -DdebugPort=8000 إلى سطر أوامر Maven الخاص بك وقم بإرفاق جلسة تصحيح الأخطاء عن بعد.

انظر المستندات http://www.Eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#debugPort

نصائح أخرى

أضف هذا إلى POM الخاص بك:

<profiles>
    <profile>
        <id>debug</id>

        <build>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.tycho</groupId>
                    <artifactId>tycho-surefire-plugin</artifactId>
                    <version>${tycho-version}</version>
                    <configuration>
                       <argLine>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y</argLine>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

الآن يمكنك تمكين تصحيح الأخطاء باستخدام mvn ... -P debug عندما تتم طباعة السطر التالي:

الاستماع للنقل dt_socket على العنوان:8000

انظر الكسوف يساعد على كيفية تكوين IDE.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top