8196308: Update tests AllLineLocations and ClassesByName to use TestScaffold instead of JDIScaffold

This is a subtask of JDK-4916621: update tests still using JDIScaffold to us TestScaffold instead.

Reviewed-by: sspitsyn, gthornbr
This commit is contained in:
Parvathi Somashekar 2018-02-12 16:08:33 -08:00
parent 1da7dc6296
commit ceb48aba9b
2 changed files with 12 additions and 19 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,7 +27,7 @@
* @summary Test ReferenceType.allLineLocations * @summary Test ReferenceType.allLineLocations
* @author Gordon Hirsch * @author Gordon Hirsch
* *
* @run build JDIScaffold VMConnection * @run build TestScaffold VMConnection
* @run compile -g RefTypes.java * @run compile -g RefTypes.java
* @run build AllLineLocations * @run build AllLineLocations
* *
@ -39,26 +39,22 @@ import com.sun.jdi.request.*;
import java.util.List; import java.util.List;
public class AllLineLocations extends JDIScaffold { public class AllLineLocations extends TestScaffold {
final String[] args;
public static void main(String args[]) throws Exception { public static void main(String args[]) throws Exception {
new AllLineLocations(args).startTests(); new AllLineLocations(args).startTests();
} }
AllLineLocations(String args[]) { AllLineLocations(String args[]) {
super(); super(args);
this.args = args;
} }
protected void runTests() throws Exception { protected void runTests() throws Exception {
connect(args);
waitForVMStart();
/* /*
* Get to a point where the classes are loaded. * Get to a point where the classes are loaded.
*/ */
BreakpointEvent bp = resumeTo("RefTypes", "loadClasses", "()V"); BreakpointEvent bp = startTo("RefTypes", "loadClasses", "()V");
stepOut(bp.thread()); stepOut(bp.thread());
/* /*
@ -220,6 +216,6 @@ public class AllLineLocations extends JDIScaffold {
System.out.println("AbstractAndNative: passed"); System.out.println("AbstractAndNative: passed");
// Allow application to complete // Allow application to complete
resumeToVMDeath(); resumeToVMDisconnect();
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,7 @@
* loaded class list can be found with classesByName.. * loaded class list can be found with classesByName..
* @author Robert Field * @author Robert Field
* *
* @run build JDIScaffold VMConnection * @run build TestScaffold VMConnection
* @run compile -g HelloWorld.java * @run compile -g HelloWorld.java
* @run build ClassesByName * @run build ClassesByName
* *
@ -41,21 +41,18 @@ import com.sun.jdi.request.*;
import java.util.List; import java.util.List;
import java.util.Iterator; import java.util.Iterator;
public class ClassesByName extends JDIScaffold { public class ClassesByName extends TestScaffold {
final String[] args;
public static void main(String args[]) throws Exception { public static void main(String args[]) throws Exception {
new ClassesByName(args).startTests(); new ClassesByName(args).startTests();
} }
ClassesByName(String args[]) throws Exception { ClassesByName(String args[]) throws Exception {
super(); super(args);
this.args = args;
} }
protected void runTests() throws Exception { protected void runTests() throws Exception {
connect(args); startUp("ClassesByName");
waitForVMStart();
List all = vm().allClasses(); List all = vm().allClasses();
for (Iterator it = all.iterator(); it.hasNext(); ) { for (Iterator it = all.iterator(); it.hasNext(); ) {
@ -71,6 +68,6 @@ public class ClassesByName extends JDIScaffold {
} }
// Allow application to complete // Allow application to complete
resumeToVMDeath(); resumeToVMDisconnect();
} }
} }