1.1 --- a/vmtest/src/main/java/org/apidesign/bck2brwsr/vmtest/VMTest.java Thu Dec 20 11:03:34 2012 +0100
1.2 +++ b/vmtest/src/main/java/org/apidesign/bck2brwsr/vmtest/VMTest.java Thu Dec 20 21:54:33 2012 +0100
1.3 @@ -20,10 +20,7 @@
1.4 import java.io.File;
1.5 import java.io.FileWriter;
1.6 import java.io.IOException;
1.7 -import java.io.InputStream;
1.8 import java.lang.reflect.Method;
1.9 -import java.net.URL;
1.10 -import java.util.Enumeration;
1.11 import java.util.Map;
1.12 import java.util.WeakHashMap;
1.13 import java.util.logging.Level;
1.14 @@ -111,37 +108,6 @@
1.15 return m.getName() + "[Compare " + second.typeName() + "]";
1.16 }
1.17
1.18 - /** Helper method that inspects the classpath and loads given resource
1.19 - * (usually a class file). Used while running tests in Rhino.
1.20 - *
1.21 - * @param name resource name to find
1.22 - * @return the array of bytes in the given resource
1.23 - * @throws IOException I/O in case something goes wrong
1.24 - */
1.25 - public static byte[] read(String name) throws IOException {
1.26 - URL u = null;
1.27 - Enumeration<URL> en = VMTest.class.getClassLoader().getResources(name);
1.28 - while (en.hasMoreElements()) {
1.29 - u = en.nextElement();
1.30 - }
1.31 - if (u == null) {
1.32 - throw new IOException("Can't find " + name);
1.33 - }
1.34 - try (InputStream is = u.openStream()) {
1.35 - byte[] arr;
1.36 - arr = new byte[is.available()];
1.37 - int offset = 0;
1.38 - while (offset < arr.length) {
1.39 - int len = is.read(arr, offset, arr.length - offset);
1.40 - if (len == -1) {
1.41 - throw new IOException("Can't read " + name);
1.42 - }
1.43 - offset += len;
1.44 - }
1.45 - return arr;
1.46 - }
1.47 - }
1.48 -
1.49 public static final class Run implements ITest {
1.50 private final Method m;
1.51 private final int type;