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.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,7 +27,7 @@
* @summary Test ReferenceType.allLineLocations
* @author Gordon Hirsch
*
* @run build JDIScaffold VMConnection
* @run build TestScaffold VMConnection
* @run compile -g RefTypes.java
* @run build AllLineLocations
*
@ -39,26 +39,22 @@ import com.sun.jdi.request.*;
import java.util.List;
public class AllLineLocations extends JDIScaffold {
final String[] args;
public class AllLineLocations extends TestScaffold {
public static void main(String args[]) throws Exception {
new AllLineLocations(args).startTests();
}
AllLineLocations(String args[]) {
super();
this.args = args;
super(args);
}
protected void runTests() throws Exception {
connect(args);
waitForVMStart();
/*
* Get to a point where the classes are loaded.
*/
BreakpointEvent bp = resumeTo("RefTypes", "loadClasses", "()V");
BreakpointEvent bp = startTo("RefTypes", "loadClasses", "()V");
stepOut(bp.thread());
/*
@ -220,6 +216,6 @@ public class AllLineLocations extends JDIScaffold {
System.out.println("AbstractAndNative: passed");
// 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.
*
* 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..
* @author Robert Field
*
* @run build JDIScaffold VMConnection
* @run build TestScaffold VMConnection
* @run compile -g HelloWorld.java
* @run build ClassesByName
*
@ -41,21 +41,18 @@ import com.sun.jdi.request.*;
import java.util.List;
import java.util.Iterator;
public class ClassesByName extends JDIScaffold {
final String[] args;
public class ClassesByName extends TestScaffold {
public static void main(String args[]) throws Exception {
new ClassesByName(args).startTests();
}
ClassesByName(String args[]) throws Exception {
super();
this.args = args;
super(args);
}
protected void runTests() throws Exception {
connect(args);
waitForVMStart();
startUp("ClassesByName");
List all = vm().allClasses();
for (Iterator it = all.iterator(); it.hasNext(); ) {
@ -71,6 +68,6 @@ public class ClassesByName extends JDIScaffold {
}
// Allow application to complete
resumeToVMDeath();
resumeToVMDisconnect();
}
}