Skip to content
Permalink
Browse files

8239461: Use jcod rather than jar files in runtime tests

Reviewed-by: hseigel, lmesnik, dholmes
  • Loading branch information
Coleen Phillimore
Coleen Phillimore committed Feb 20, 2020
1 parent 58a5910 commit b4ffe4d8f712cf2c0f2610bc8954294d927ab8cc
Binary file not shown.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, 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,6 +28,7 @@
* @summary Check attribute_length of EnclosingMethod attribute
* @modules java.base/jdk.internal.misc
* java.management
* @compile EnclMethTest.jcod
* @run main EnclMethodAttr
*/

@@ -41,8 +42,7 @@

public static void main(String args[]) throws Throwable {
System.out.println("Regression test for bug 8044738");
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-jar", testsrc + File.separator + "enclMethodAttr.jar");
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("EnclMethTest");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("java.lang.ClassFormatError: Wrong EnclosingMethod");
}
Binary file not shown.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, 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,6 +28,7 @@
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
* @compile DuplicateLVT.jcod DuplicateLVTT.jcod NotFoundLVTT.jcod
* @compile -g -XDignore.symbol.file TestLVT.java
* @run main TestLVT
*/
@@ -43,19 +44,19 @@ public static void main(String[] args) throws Exception {
String jarFile = System.getProperty("test.src") + "/testcase.jar";

// java -cp $testSrc/testcase.jar DuplicateLVT
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-cp", jarFile, "DuplicateLVT");
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("DuplicateLVT");
new OutputAnalyzer(pb.start())
.shouldContain("Duplicated LocalVariableTable attribute entry for 'by' in class file DuplicateLVT")
.shouldHaveExitValue(1);

// java -cp $testclasses/testcase.jar DuplicateLVTT
pb = ProcessTools.createJavaProcessBuilder("-cp", jarFile, "DuplicateLVTT");
pb = ProcessTools.createJavaProcessBuilder("DuplicateLVTT");
new OutputAnalyzer(pb.start())
.shouldContain("Duplicated LocalVariableTypeTable attribute entry for 'list' in class file DuplicateLVTT")
.shouldHaveExitValue(1);

// java -cp $testclasses/testcase.jar NotFoundLVTT
pb = ProcessTools.createJavaProcessBuilder("-cp", jarFile, "NotFoundLVTT");
pb = ProcessTools.createJavaProcessBuilder("NotFoundLVTT");
new OutputAnalyzer(pb.start())
.shouldContain("LVTT entry for 'list' in class file NotFoundLVTT does not match any LVT entry")
.shouldHaveExitValue(1);
Binary file not shown.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, 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
@@ -24,7 +24,7 @@
/*
* @test Test7116786
* @summary verify that VerifyError messages are as expected
* @library testcases.jar
* @compile testcases.jcod
* @run main/othervm -Xverify:all Test7116786
*/

0 comments on commit b4ffe4d

Please sign in to comment.