mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8050429: Update/cleanup ToolBox
Reviewed-by: vromero
This commit is contained in:
parent
14fcc1d07d
commit
33e6564a6b
54 changed files with 2577 additions and 1792 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2014, 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 Verifies that javah won't attempt to generate a header file if a
|
||||
* native method in a supplied class contains a parameter type whose corresponding
|
||||
* class is missing or not in the classpath
|
||||
* @library /tools/javac/lib
|
||||
* @library /tools/lib
|
||||
* @build ToolBox
|
||||
* @run compile MissingParamClassTest.java
|
||||
* @clean MissingParamClassException
|
||||
|
@ -39,32 +39,21 @@
|
|||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
//original test: test/tools/javah/MissingParamClassTest.sh
|
||||
// Original test: test/tools/javah/MissingParamClassTest.sh
|
||||
public class MissingParamClassTest {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
//first steps done now by jtreg
|
||||
//"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . "${TESTSRC}${FS}ParamClassTest.java" "${TESTSRC}${FS}MissingParamClassException.java"
|
||||
//rm -f MissingParamClassException.class
|
||||
ToolBox tb = new ToolBox();
|
||||
|
||||
//"${TESTJAVA}${FS}bin${FS}javah" ${TESTTOOLVMOPTS} ParamClassTest 2>${TMP1}
|
||||
List<String> errOutput = new ArrayList<>();
|
||||
ToolBox.JavaToolArgs javahParams =
|
||||
new ToolBox.JavaToolArgs(ToolBox.Expect.FAIL)
|
||||
.setAllArgs("-classpath", System.getProperty("test.classes"), "ParamClassTest")
|
||||
.setErrOutput(errOutput);
|
||||
ToolBox.javah(javahParams);
|
||||
String out = tb.new JavahTask()
|
||||
.classpath(ToolBox.testClasses)
|
||||
.classes("ParamClassTest")
|
||||
.run(ToolBox.Expect.FAIL)
|
||||
.getOutput(ToolBox.OutputKind.DIRECT);
|
||||
|
||||
//if [ -f $GENERATED_HEADER_FILE ]; then fail
|
||||
//if [ ! -s ${TMP1} ]; then fail
|
||||
if (Files.exists(Paths.get("ParamClassTest.h")) || errOutput.size() == 0)
|
||||
if (Files.exists(Paths.get("ParamClassTest.h")) || out.isEmpty())
|
||||
throw new AssertionError("The only output generated by javah must be an error message");
|
||||
//jtreg again
|
||||
//rm -f MissingParamClassException.class ParamClassTest.class
|
||||
//rm -f $GENERATED_HEADER_FILE $TMP1
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue