< prev index next >

test/jdk/com/sun/jdi/TestScaffold.java

Print this page

 541             } else if (arg.equals("-redefasync")) {
 542                 redefineAsynchronously = true;
 543             } else if (arg.startsWith("-J")) {
 544                 throw new RuntimeException("-J-option format is not supported. Incorrect arg: " + arg);
 545             } else if (arg.startsWith("-")) {
 546                 argInfo.targetVMArgs += (arg + ' ');
 547                 if (doubleWordArgs.contains(arg)) {
 548                     i++;
 549                     argInfo.targetVMArgs += (args[i] + ' ');
 550                 }
 551             } else {
 552                 classNameParsed = true;
 553                 argInfo.targetAppCommandLine += (arg + ' ');
 554             }
 555         }
 556 
 557         // Need to change args to run wrapper using command like 'DebuggeeWrapper <app-name>'
 558         // and set property 'test.thread.factory' so test could use DebuggeeWrapper.isVirtual() method
 559         String testThreadFactoryName = DebuggeeWrapper.getTestThreadFactoryName();
 560         if (testThreadFactoryName != null && !argInfo.targetAppCommandLine.isEmpty()) {
 561             argInfo.targetVMArgs += "-D" + DebuggeeWrapper.PROPERTY_NAME + "=" + testThreadFactoryName;
 562             argInfo.targetAppCommandLine = DebuggeeWrapper.class.getName() + ' ' + argInfo.targetAppCommandLine;
 563         } else if ("true".equals(System.getProperty("test.enable.preview"))) {

 564             // the test specified @enablePreview.
 565             argInfo.targetVMArgs += "--enable-preview ";
 566         }
 567         return argInfo;
 568     }
 569 
 570     /**
 571      * This is called to connect to a debuggee VM.  It starts the VM and
 572      * installs a listener to catch VMStartEvent, our default events, and
 573      * VMDisconnectedEvent.  When these events appear, that is remembered
 574      * and waiters are notified.
 575      * This is normally called in the main thread of the test case.
 576      * It starts up an EventHandler thread that gets events coming in
 577      * from the debuggee and distributes them to listeners.  That thread
 578      * keeps running until a VMDisconnectedEvent occurs or some exception
 579      * occurs during its processing.
 580      *
 581      * The 'listenUntilVMDisconnect' method adds 'this' as a listener.
 582      * This means that 'this's vmDied method will get called.  This has a
 583      * default impl in TargetAdapter.java which can be overridden in the

 541             } else if (arg.equals("-redefasync")) {
 542                 redefineAsynchronously = true;
 543             } else if (arg.startsWith("-J")) {
 544                 throw new RuntimeException("-J-option format is not supported. Incorrect arg: " + arg);
 545             } else if (arg.startsWith("-")) {
 546                 argInfo.targetVMArgs += (arg + ' ');
 547                 if (doubleWordArgs.contains(arg)) {
 548                     i++;
 549                     argInfo.targetVMArgs += (args[i] + ' ');
 550                 }
 551             } else {
 552                 classNameParsed = true;
 553                 argInfo.targetAppCommandLine += (arg + ' ');
 554             }
 555         }
 556 
 557         // Need to change args to run wrapper using command like 'DebuggeeWrapper <app-name>'
 558         // and set property 'test.thread.factory' so test could use DebuggeeWrapper.isVirtual() method
 559         String testThreadFactoryName = DebuggeeWrapper.getTestThreadFactoryName();
 560         if (testThreadFactoryName != null && !argInfo.targetAppCommandLine.isEmpty()) {
 561             argInfo.targetVMArgs += "-D" + DebuggeeWrapper.PROPERTY_NAME + "=" + testThreadFactoryName + " ";
 562             argInfo.targetAppCommandLine = DebuggeeWrapper.class.getName() + ' ' + argInfo.targetAppCommandLine;
 563         }
 564         if ("true".equals(System.getProperty("test.enable.preview"))) {
 565             // the test specified @enablePreview.
 566             argInfo.targetVMArgs += "--enable-preview ";
 567         }
 568         return argInfo;
 569     }
 570 
 571     /**
 572      * This is called to connect to a debuggee VM.  It starts the VM and
 573      * installs a listener to catch VMStartEvent, our default events, and
 574      * VMDisconnectedEvent.  When these events appear, that is remembered
 575      * and waiters are notified.
 576      * This is normally called in the main thread of the test case.
 577      * It starts up an EventHandler thread that gets events coming in
 578      * from the debuggee and distributes them to listeners.  That thread
 579      * keeps running until a VMDisconnectedEvent occurs or some exception
 580      * occurs during its processing.
 581      *
 582      * The 'listenUntilVMDisconnect' method adds 'this' as a listener.
 583      * This means that 'this's vmDied method will get called.  This has a
 584      * default impl in TargetAdapter.java which can be overridden in the
< prev index next >