changeset 983:7dd59a0f6d71

runners: assert the existence of critical resources.
author shade
date Wed, 27 Aug 2014 18:36:45 +0400
parents f3a68bbd0f15
children c97ad3d4b507
files jmh-core/src/main/java/org/openjdk/jmh/runner/AbstractResourceReader.java jmh-core/src/test/resources/META-INF/CompilerHints
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/AbstractResourceReader.java	Mon Aug 25 15:59:36 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/AbstractResourceReader.java	Wed Aug 27 18:36:45 2014 +0400
@@ -70,10 +70,10 @@
                                 : resource
                 );
             } catch (IOException e) {
-                throw new RuntimeException("IOException while obtaining resource: " + resource, e);
+                throw new RuntimeException("ERROR: While obtaining resource: " + resource, e);
             }
 
-            if (urls != null) {
+            if (urls != null && urls.hasMoreElements()) {
                 List<Reader> readers = new ArrayList<Reader>();
                 URL url = null;
                 try {
@@ -90,11 +90,11 @@
                             // ignore
                         }
                     }
-                    throw new RuntimeException("IOException while opening resource: " + url, e);
+                    throw new RuntimeException("ERROR: While opening resource: " + url, e);
                 }
                 return readers;
             } else {
-                throw new RuntimeException("Unable to find the resource");
+                throw new RuntimeException("ERROR: Unable to find the resource: " + resource);
             }
         }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/test/resources/META-INF/CompilerHints	Wed Aug 27 18:36:45 2014 +0400
@@ -0,0 +1,1 @@
+dontinline,some/dummy/class.bench
\ No newline at end of file