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