50b851
From 0568fd8416f807a0efb4160b3e619d43002314c9 Mon Sep 17 00:00:00 2001
50b851
From: Jakub Filak <jfilak@redhat.com>
50b851
Date: Tue, 25 Nov 2014 08:18:52 -0500
50b851
Subject: [PATCH] Update the test results
50b851
50b851
---
50b851
 test/CMakeLists.txt                        | 30 ++++++++++++++++--------------
50b851
 test/outputs/Linux-armv7l/run_test.log.in  | 15 +++++++++------
50b851
 test/outputs/run_bad_class.log.in          |  3 ---
50b851
 test/outputs/run_missing_class_test.log.in |  7 +++++++
50b851
 test/outputs/run_test.log.in               | 15 +++++++++------
50b851
 5 files changed, 41 insertions(+), 29 deletions(-)
50b851
 create mode 100644 test/outputs/run_missing_class_test.log.in
50b851
50b851
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
50b851
index bbf8a8f..291e9a1 100644
50b851
--- a/test/CMakeLists.txt
50b851
+++ b/test/CMakeLists.txt
50b851
@@ -186,22 +186,24 @@ _add_test_target(
50b851
 )
50b851
 _add_test(run_bad_class 2)
50b851
 
50b851
-# Disabled because JVM catches the ClassNotFoundException in a native method and exits gracefully
50b851
-#_add_test_target(
50b851
-#    run_missing_class_test
50b851
-#    MissingClassTest
50b851
-#    PRE rm -f MissingClassTest.class
50b851
-#    DEPENDS ${TEST_JAVA_TARGETS} ${JAR_TEST_PATH}
50b851
-#    AGENT_OPTIONS executable=threadclass
50b851
-#)
50b851
-#_add_test(run_missing_class_test 2)
50b851
-add_custom_target(
50b851
+# Disable for JVM-1.7, because it catches the ClassNotFoundException in a native method and exits gracefully
50b851
+_add_test_target(
50b851
     run_missing_class_test
50b851
-    COMMAND rm -f MissingClassTest.class && LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src ${Java_JAVA_EXECUTABLE} -agentlib:${AGENT_NAME}=output=run_missing_class.log MissingClassTest || test ! -e run_missing_class.log
50b851
-    DEPENDS AbrtChecker ${TEST_JAVA_TARGETS}
50b851
-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
50b851
+    MissingClassTest
50b851
+    PRE rm -f MissingClassTest.class
50b851
+    DEPENDS ${TEST_JAVA_TARGETS} ${JAR_TEST_PATH}
50b851
+    AGENT_OPTIONS executable=threadclass
50b851
 )
50b851
-add_test(test_run_missing_class_test make run_missing_class_test)
50b851
+_add_test(run_missing_class_test 2)
50b851
+
50b851
+# Disable for JVM-1.8, because missing class causes an uncaught exception
50b851
+#add_custom_target(
50b851
+#    run_missing_class_test
50b851
+#    COMMAND rm -f MissingClassTest.class && LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src ${Java_JAVA_EXECUTABLE} -agentlib:${AGENT_NAME}=output=run_missing_class.log MissingClassTest || test ! -e run_missing_class.log
50b851
+#    DEPENDS AbrtChecker ${TEST_JAVA_TARGETS}
50b851
+#    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
50b851
+#)
50b851
+#add_test(test_run_missing_class_test make run_missing_class_test)
50b851
 
50b851
 _add_test_target(
50b851
     run_try_finally
50b851
diff --git a/test/outputs/Linux-armv7l/run_test.log.in b/test/outputs/Linux-armv7l/run_test.log.in
50b851
index 3d83a66..efc6d8e 100644
50b851
--- a/test/outputs/Linux-armv7l/run_test.log.in
50b851
+++ b/test/outputs/Linux-armv7l/run_test.log.in
50b851
@@ -1,22 +1,25 @@
50b851
-Caught exception java.io.FileNotFoundException in method java.io.FileInputStream.<init>()
50b851
+Caught exception java.io.FileNotFoundException in method java.io.FileInputStream.open()
50b851
 Exception in thread "main" java.io.FileNotFoundException: _wrong_file_ (No such file or directory)
50b851
-	at java.io.FileInputStream.open(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
+	at java.io.FileInputStream.open0(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
+	at java.io.FileInputStream.open(FileInputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
 	at java.io.FileInputStream.<init>(FileInputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
 	at Test.readWrongFile(Test.java:89) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
 	at Test.fileRelatedIssues(Test.java:461) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
 	at Test.main(Test.java:513) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
 executable: @CMAKE_BINARY_DIR@/test/Test.class
50b851
-Caught exception java.io.FileNotFoundException in method java.io.FileInputStream.<init>()
50b851
+Caught exception java.io.FileNotFoundException in method java.io.FileInputStream.open()
50b851
 Exception in thread "main" java.io.FileNotFoundException: /root/.bashrc (Permission denied)
50b851
-	at java.io.FileInputStream.open(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
+	at java.io.FileInputStream.open0(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
+	at java.io.FileInputStream.open(FileInputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
 	at java.io.FileInputStream.<init>(FileInputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
 	at Test.readUnreadableFile(Test.java:111) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
 	at Test.fileRelatedIssues(Test.java:462) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
 	at Test.main(Test.java:513) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
 executable: @CMAKE_BINARY_DIR@/test/Test.class
50b851
-Caught exception java.io.FileNotFoundException in method java.io.FileOutputStream.<init>()
50b851
+Caught exception java.io.FileNotFoundException in method java.io.FileOutputStream.open()
50b851
 Exception in thread "main" java.io.FileNotFoundException: /root/.bashrc (Permission denied)
50b851
-	at java.io.FileOutputStream.open(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileOutputStream.class]
50b851
+	at java.io.FileOutputStream.open0(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileOutputStream.class]
50b851
+	at java.io.FileOutputStream.open(FileOutputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileOutputStream.class]
50b851
 	at java.io.FileOutputStream.<init>(FileOutputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileOutputStream.class]
50b851
 	at java.io.FileOutputStream.<init>(FileOutputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileOutputStream.class]
50b851
 	at Test.writeToUnwritableFile(Test.java:134) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
diff --git a/test/outputs/run_bad_class.log.in b/test/outputs/run_bad_class.log.in
50b851
index 348f056..2b58474 100644
50b851
--- a/test/outputs/run_bad_class.log.in
50b851
+++ b/test/outputs/run_bad_class.log.in
50b851
@@ -1,8 +1,5 @@
50b851
 Uncaught exception java.lang.ClassNotFoundException in method java.lang.ClassLoader.loadClass()
50b851
 Exception in thread "main" java.lang.ClassNotFoundException: foobar
50b851
-	at java.net.URLClassLoader$1.run(URLClassLoader.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/net/URLClassLoader$1.class]
50b851
-	at java.net.URLClassLoader$1.run(URLClassLoader.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/net/URLClassLoader$1.class]
50b851
-	at java.security.AccessController.doPrivileged(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/security/AccessController.class]
50b851
 	at java.net.URLClassLoader.findClass(URLClassLoader.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/net/URLClassLoader.class]
50b851
 	at java.lang.ClassLoader.loadClass(ClassLoader.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/lang/ClassLoader.class]
50b851
 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/sun/misc/Launcher$AppClassLoader.class]
50b851
diff --git a/test/outputs/run_missing_class_test.log.in b/test/outputs/run_missing_class_test.log.in
50b851
new file mode 100644
50b851
index 0000000..fbbd20d
50b851
--- /dev/null
50b851
+++ b/test/outputs/run_missing_class_test.log.in
50b851
@@ -0,0 +1,7 @@
50b851
+Uncaught exception java.lang.ClassNotFoundException in method java.lang.ClassLoader.loadClass()
50b851
+Exception in thread "main" java.lang.ClassNotFoundException: MissingClassTest
50b851
+	at java.net.URLClassLoader.findClass(URLClassLoader.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/net/URLClassLoader.class]
50b851
+	at java.lang.ClassLoader.loadClass(ClassLoader.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/lang/ClassLoader.class]
50b851
+	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/sun/misc/Launcher$AppClassLoader.class]
50b851
+	at java.lang.ClassLoader.loadClass(ClassLoader.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/lang/ClassLoader.class]
50b851
+executable: JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar
50b851
diff --git a/test/outputs/run_test.log.in b/test/outputs/run_test.log.in
50b851
index 4ec6544..6456cd3 100644
50b851
--- a/test/outputs/run_test.log.in
50b851
+++ b/test/outputs/run_test.log.in
50b851
@@ -1,22 +1,25 @@
50b851
-Caught exception java.io.FileNotFoundException in method java.io.FileInputStream.open()
50b851
+Caught exception java.io.FileNotFoundException in method java.io.FileInputStream.open0()
50b851
 Exception in thread "main" java.io.FileNotFoundException: _wrong_file_ (No such file or directory)
50b851
-	at java.io.FileInputStream.open(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
+	at java.io.FileInputStream.open0(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
+	at java.io.FileInputStream.open(FileInputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
 	at java.io.FileInputStream.<init>(FileInputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
 	at Test.readWrongFile(Test.java:89) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
 	at Test.fileRelatedIssues(Test.java:461) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
 	at Test.main(Test.java:513) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
 executable: @CMAKE_BINARY_DIR@/test/Test.class
50b851
-Caught exception java.io.FileNotFoundException in method java.io.FileInputStream.open()
50b851
+Caught exception java.io.FileNotFoundException in method java.io.FileInputStream.open0()
50b851
 Exception in thread "main" java.io.FileNotFoundException: /root/.bashrc (Permission denied)
50b851
-	at java.io.FileInputStream.open(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
+	at java.io.FileInputStream.open0(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
+	at java.io.FileInputStream.open(FileInputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
 	at java.io.FileInputStream.<init>(FileInputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileInputStream.class]
50b851
 	at Test.readUnreadableFile(Test.java:111) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
 	at Test.fileRelatedIssues(Test.java:462) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
 	at Test.main(Test.java:513) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
 executable: @CMAKE_BINARY_DIR@/test/Test.class
50b851
-Caught exception java.io.FileNotFoundException in method java.io.FileOutputStream.open()
50b851
+Caught exception java.io.FileNotFoundException in method java.io.FileOutputStream.open0()
50b851
 Exception in thread "main" java.io.FileNotFoundException: /root/.bashrc (Permission denied)
50b851
-	at java.io.FileOutputStream.open(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileOutputStream.class]
50b851
+	at java.io.FileOutputStream.open0(Native Method) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileOutputStream.class]
50b851
+	at java.io.FileOutputStream.open(FileOutputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileOutputStream.class]
50b851
 	at java.io.FileOutputStream.<init>(FileOutputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileOutputStream.class]
50b851
 	at java.io.FileOutputStream.<init>(FileOutputStream.java:LINENO) [jar:file:JAVA_AND_SYSTEM_SPECIFIC_PATH/rt.jar!/java/io/FileOutputStream.class]
50b851
 	at Test.writeToUnwritableFile(Test.java:134) [file:@CMAKE_BINARY_DIR@/test/Test.class]
50b851
-- 
50b851
2.1.0
50b851