This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 42433
Collapse All | Expand All

(-)openide/build.xml (+34 lines)
Lines 760-764 Link Here
760
]]></echo>
760
]]></echo>
761
761
762
    </target>
762
    </target>
763
    
764
    
765
    <!-- support for projectized modules -->
766
    <target name="test-single" >
767
        <tempfile property="temp.file" />
768
        <echo message="xtest#includes=${test.includes}" file="${temp.file}" />
769
        <replace file="${temp.file}" token=".java" value="" />
770
        <replace file="${temp.file}" token="." value="/" />
771
        <replace file="${temp.file}" token="#" value="." />
772
        <echo file="${temp.file}" append="true" >*class
773
        </echo>
774
        <loadproperties srcfile="${temp.file}" />
775
        <echo message="xtest.includes: ${xtest.includes}" /> 
776
        <delete file="${temp.file}" />
777
        <ant dir="test" inheritall="true" >
778
            <property name="xtest.attribs" value="empty" />
779
        </ant>
780
    </target>
781
    <target name="debug-test-single-nb" depends="init" if="netbeans.home" >
782
        <fail unless="test.class">Must set test.class</fail>
783
        <nbjpdastart transport="dt_socket" addressproperty="jpda.address" name="${test.class}">
784
            <classpath> 
785
                <pathelement location="${netbeans.dest.dir}/${cluster.dir}/${module.jar}"/>
786
                <pathelement location="test/src" />
787
                <fileset dir="${netbeans.dest.dir}" >
788
                    <patternset refid="openide.files" />
789
                </fileset>
790
            </classpath>
791
        </nbjpdastart>
792
        <antcall target="test-single" inheritall="true" >
793
            <param name="test.includes" value="${test.class}" />
794
            <param name="xtest.debug.address" value="${jpda.address}" />
795
        </antcall>
796
    </target>
763
797
764
</project>
798
</project>
(-)xtest/plugins_src/jvm/lib/jvm_execution_targets.xml (-1 / +3 lines)
Lines 62-70 Link Here
62
62
63
        <property name="xtest.testrunner.mode" value="testsuite"/>        
63
        <property name="xtest.testrunner.mode" value="testsuite"/>        
64
64
65
        <property name="xtest.debug.address" value="" />
65
        <!-- run the tests -->        
66
        <!-- run the tests -->        
66
        <jvmTestRunner workDir="${xtest.workdir}/sys"  jdkHome="${jdkhome}" jvmArgs="${xtest.jvm.args}"
67
        <jvmTestRunner workDir="${xtest.workdir}/sys"  jdkHome="${jdkhome}" jvmArgs="${xtest.jvm.args}"
67
            enableAssertions="${xtest.enable.assertions}" debugPort="${xtest.debug.port}" debugSuspend="${xtest.debug.suspend}"
68
            enableAssertions="${xtest.enable.assertions}" 
69
            debugPort="${xtest.debug.port}" debugSuspend="${xtest.debug.suspend}" debugAddress="${xtest.debug.address}"
68
            testMode="${xtest.testrunner.mode}"  timeout="${xtest.timeout}">
70
            testMode="${xtest.testrunner.mode}"  timeout="${xtest.timeout}">
69
            <classpath  refid="_jvmplugin.test.classpath"/>
71
            <classpath  refid="_jvmplugin.test.classpath"/>
70
72
(-)xtest/plugins_src/jvm/src/org/netbeans/xtest/plugin/jvm/JVMTestRunnerTask.java (-1 / +21 lines)
Lines 136-141 Link Here
136
        this.debugSuspend = suspend;
136
        this.debugSuspend = suspend;
137
    }    
137
    }    
138
    
138
    
139
    /** Address to attach to
140
     */
141
    public void setDebugAddress (String address) {
142
        this.debugAddress = address;
143
    }
144
    
139
    // test mode
145
    // test mode
140
    public void setTestMode(String testMode) {
146
    public void setTestMode(String testMode) {
141
        if ((testMode != null) & (!testMode.equals(""))) {
147
        if ((testMode != null) & (!testMode.equals(""))) {
Lines 198-203 Link Here
198
    // debug should suspend code execution
204
    // debug should suspend code execution
199
    protected boolean debugSuspend = false;
205
    protected boolean debugSuspend = false;
200
    
206
    
207
    // debug should start its own server
208
    private String debugAddress;
209
    
201
    // debug port to which debugger is connected. When 0 - debugging is not started
210
    // debug port to which debugger is connected. When 0 - debugging is not started
202
    protected int debugPort = 0;
211
    protected int debugPort = 0;
203
    
212
    
Lines 266-277 Link Here
266
        if (enableAssertions) {
275
        if (enableAssertions) {
267
            commandLine.createVmArgument().setValue("-ea");
276
            commandLine.createVmArgument().setValue("-ea");
268
        }
277
        }
278
        
269
        // debugger
279
        // debugger
270
        if (debugPort > 0) {
280
        if (debugPort > 0) {
281
            if (debugAddress != null && debugAddress.length () > 0) {
282
                throw new BuildException ("Cannot specify debug port (" + debugPort + ") and address (" + debugAddress + ") at once");
283
            }
271
            String suspendArg = debugSuspend ? "y" : "n";
284
            String suspendArg = debugSuspend ? "y" : "n";
272
            String debugArgument = "-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend="+suspendArg+",address="+debugPort;
285
            String debugArgument = "-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend="+suspendArg+",address="+debugPort;
273
            commandLine.createVmArgument().setLine(debugArgument);
286
            commandLine.createVmArgument().setLine(debugArgument);
274
        }        
287
        } else {        
288
            if (debugAddress != null && debugAddress.length () > 0) {
289
                String debugArgument = "-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=" + debugAddress;
290
                commandLine.createVmArgument().setLine(debugArgument);
291
            }
292
        }
293
        
294
        
275
        // add runnerproperties file sys property
295
        // add runnerproperties file sys property
276
        Environment.Variable runnerProperties = new Environment.Variable();
296
        Environment.Variable runnerProperties = new Environment.Variable();
277
        runnerProperties.setKey(JUnitTestRunner.TESTRUNNER_PROPERTIES_FILENAME_KEY);
297
        runnerProperties.setKey(JUnitTestRunner.TESTRUNNER_PROPERTIES_FILENAME_KEY);

Return to bug 42433