changeset 43:78d102a4afcb

meth: remove obsolete tests
author jrose
date Fri, 24 Sep 2010 14:39:08 -0700
parents bd8323fd8671
children da6ec495ff07
files netbeans/meth/test/jdk/java/dyn/JUnitAssert.java netbeans/meth/test/jdk/java/dyn/MethodHandleBytecodeTest.java netbeans/meth/test/jdk/java/dyn/MethodHandleDemo.java netbeans/meth/test/jdk/java/dyn/MethodHandleSyntax.java netbeans/meth/test/jdk/java/dyn/MethodTypeTest.java
diffstat 5 files changed, 0 insertions(+), 832 deletions(-) [+]
line wrap: on
line diff
--- a/netbeans/meth/test/jdk/java/dyn/JUnitAssert.java	Fri Sep 24 14:33:10 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc.  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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- * 
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- * 
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- * 
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package test.java.dyn;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-
-/**
- * Local stub for running without junit.jar.
- * To use, copy this file to your package, and add this to the per-file imports:
- * <code>
- * //import static org.junit.Assert.*;
- * import static whatever.this.package.is.JUnitAssert.*;
- * </code>
- * @author jrose
- */
-class JUnitAssert {
-    static void assertSame(Object expected, Object actual) {
-        Method m = findMethod("assertSame", Object.class, Object.class);
-        if (m != null) {
-            callMethod(m, expected, actual);
-        } else if (expected != actual) {
-            error("not same", expected, actual);
-        }
-    }
-
-    static void assertEquals(Object expected, Object actual) {
-        if (!equals(expected, actual))
-            assertSame(expected, actual);
-    }
-
-    static boolean equals(Object x, Object y) {
-        return (x == y) || (x != null && y != null && x.equals(y));
-    }
-    
-    static void error(String message, Object expected, Object actual) {
-        throw new AssertionError(message+": expected ["+expected+"]"+
-                                   ", but result was ["+actual+"]");
-    }
-    
-    /// the rest is brute hackery...
-
-    static final Class<?> JUNIT_ASSERT;
-    static {
-        Class <?> JUNIT_ASSERT_ = null;
-        final String cname = "org.junit.Assert";
-        try {
-            JUNIT_ASSERT_ = Class.forName(cname);
-        } catch (ClassNotFoundException ee) {
-            System.out.println("Using backup methods instead of "+cname);
-        }
-        JUNIT_ASSERT = JUNIT_ASSERT_;
-    }
-
-    static final HashMap<List<Object>, Method> methods
-            = new HashMap<List<Object>, Method>();
-    static final Method NO_METHOD;
-    static {
-        Method noMethod = null;
-        try {
-            noMethod = JUnitAssert.class.getDeclaredMethod("noMethod");
-        } catch (Exception ee) {
-        }
-        NO_METHOD = noMethod; 
-    }
-    static private void noMethod() { }
-    
-    static Method findMethod(String name, Class<?>... params) {
-        if (JUNIT_ASSERT == null)  return null;
-        ArrayList<Object> key = new ArrayList<Object>(Arrays.asList(params));
-        key.add(0, name);
-        Method m = methods.get(key);
-        if (m != null)  return (m == NO_METHOD ? null : m);
-        try {
-            m = JUNIT_ASSERT.getMethod(name, params);
-        } catch (NoSuchMethodException ee) {
-            System.out.println("Missing method: "+name+Arrays.asList(params));
-        }
-        methods.put(key, (m == null ? NO_METHOD : m));
-        return m;
-    }
-    static Object callMethod(Method m, Object... params) {
-        Throwable bad;
-        try {
-            return m.invoke(null, params);
-        } catch (InvocationTargetException ite) {
-            Throwable ee = ite.getTargetException();
-            if (ee instanceof RuntimeException)
-                throw (RuntimeException)ee;
-            if (ee instanceof Error)
-                throw (Error)ee;
-            bad = ee;
-        } catch (Exception ee) {
-            bad = ee;
-        }
-        throw new Error("unexpected reflection problem", bad);
-    }
-}
--- a/netbeans/meth/test/jdk/java/dyn/MethodHandleBytecodeTest.java	Fri Sep 24 14:33:10 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc.  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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package test.java.dyn;
-
-import java.dyn.*;
-import java.dyn.MethodHandles.Lookup;
-import java.lang.reflect.Method;
-import junit.framework.JUnit4TestAdapter;
-import org.junit.*;
-import static org.junit.Assert.*;
-
-/**
- *
- * @author jrose
- */
-public class MethodHandleBytecodeTest {
-    private Method toString, compareTo, getBytes;
-
-    private static final Lookup METHODS = MethodHandles.lookup();
-
-    @Before
-    public void setUp() throws Exception {
-        toString = Object.class.getDeclaredMethod("toString");
-        compareTo = Comparable.class.getDeclaredMethod("compareTo", Object.class);
-        getBytes = String.class.getDeclaredMethod("getBytes", String.class);
-    }
-
-    @After
-    public void tearDown() throws Exception {
-    }
-
-    /**
-     * Test of invoke pseudo-method, of class MethodHandle.
-     */
-    @Test
-    public void testToString() throws Throwable {
-        System.out.println("invoke toString");
-        MethodHandle instance = METHODS.findVirtual(
-                Object.class, "toString", MethodType.methodType(String.class) );
-        String foo = "foo";
-        String expResult = foo.toString();
-        String result = invokeToString(instance, foo);
-        System.out.println("result = "+result);
-        assertEquals(expResult, result);
-    }
-
-    private String invokeToString(MethodHandle mh, Object obj) throws Throwable {
-        System.out.println("invoke mh="+mh);
-        return (String) mh.<String>invokeGeneric(obj);
-    }
-
-    // Extra entry point for standalone use.  Use as follows:
-    //junit="$NetBeansResources/NetBeans/java2/modules/ext/junit-4.1.jar"
-    //anonk="../AnonymousClass/dist/AnonymousClass.jar"
-    //cpath="$anonk:build/classes:build/test/classes:$junit"
-    //java -Xbootclasspath/p:"$cpath" jdk.java.dyn.MethodHandleBytecodeTest
-    public static void main(String... av) throws Throwable {
-        new JUnit4TestAdapter(MethodHandleBytecodeTest.class).run(null);
-    }
-}
--- a/netbeans/meth/test/jdk/java/dyn/MethodHandleDemo.java	Fri Sep 24 14:33:10 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc.  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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- * 
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- * 
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- * 
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package test.java.dyn;
-
-import java.dyn.*;
-import java.dyn.MethodHandles.Lookup;
-
-import org.junit.*;
-//import static org.junit.Assert.*;
-import static test.java.dyn.JUnitAssert.*;
-
-public class MethodHandleDemo {
-    static String options = "";
-    static boolean hasOption(String x) {
-        return options.indexOf(x) >= 0;
-    }
-    static boolean verbose = true;
-    static void println(Object x) {
-        if (verbose)  System.out.println(x);
-    }
-
-    public static void main(String... av) throws Throwable {
-        assertSame("hello", "hello");  // exercise assertion stuff first
-
-        options = java.util.Arrays.asList(av).toString();
-        int count = 1;
-        verbose = true;
-        for (String arg : av) {
-            if (arg.startsWith("count-"))
-                count = Integer.parseInt(arg.substring("count-".length(), arg.length()));
-        }
-        if (count != 1)  println("run count: "+count);
-        for (int i = 0; i < count; i++) {
-            if (i > 10) {
-                if (i > count - 10)
-                    verbose = true;
-                else if (verbose) {
-                    println("...shutting up...");
-                    verbose = false;
-                }
-            }
-            test();
-        }
-    }
-
-    static void test() throws Throwable {
-        Class caller = MethodHandleDemo.class;
-        Class returnType = String.class;
-        Class[] signature = {String.class};
-        String result;
-        Lookup lookup = MethodHandles.lookup();
-        MethodHandle mh;
-        mh = lookup.findVirtual(Object.class,
-                "toString", MethodType.methodType(String.class));
-        println("calling "+mh);
-        result = (String) mh.<String>invokeExact((Object)"foo");
-        assertSame("foo", result);
-
-        mh = lookup.findStatic(MethodHandleDemo.class,
-                "test0", MethodType.methodType(String.class));
-        println("calling "+mh);
-        result = (String) mh.<String>invokeExact();
-        assertEquals("[test0]", result);
-
-        mh = lookup.findStatic(MethodHandleDemo.class,
-                "test1", MethodType.methodType(String.class, String.class));
-        println("calling "+mh);
-        result = (String) mh.<String>invokeExact("X");
-        assertEquals("[test1 X]", result);
-        
-        mh = MethodHandles.insertArguments(mh, 0, "Bounderby");
-        println("calling bound "+mh);
-        result = (String) mh.<String>invokeExact();
-        assertEquals("[test1 Bounderby]", result);
-
-        mh = lookup.findStatic(MethodHandleDemo.class,
-                "test2", MethodType.methodType(String.class, String.class, int.class));
-        println("calling "+mh);
-        result = (String) mh.<String>invokeExact("X", 123);
-        assertEquals("[test2 X #123]", result);
-
-        mh = MethodHandles.insertArguments(mh, 0, "Buster");
-        println("calling bound "+mh);
-        result = (String) mh.<String>invokeExact(456);
-        assertEquals("[test2 Buster #456]", result);
-
-        Obj obj = new Obj("X");
-        mh = lookup.findVirtual(I.class,
-                "test1", MethodType.methodType(String.class));
-        println("calling "+mh);
-        result = (String) mh.<String>invokeExact((I)obj);
-        assertEquals("[Obj.test1 X]", result);
-
-        mh = lookup.findVirtual(I.class,
-                "test2", MethodType.methodType(String.class, int.class));
-        println("calling "+mh);
-        result = (String) mh.<String>invokeExact((I)obj, 123);
-        assertEquals("[Obj.test2 X #123]", result);
-    }
-
-    static void eachCall() {
-        if (hasOption("call-gc"))
-            Runtime.getRuntime().gc();
-    }
-
-    // static methods we make handles for:
-    public static String test0() {
-        eachCall();
-        return "[test0]";
-    }
-
-    public static String test1(String x) {
-        eachCall();
-        return "[test1 " + x + "]";
-    }
-
-    public static String test2(String x, int y) {
-        println("y == 0x"+Integer.toHexString(y));
-        eachCall();
-        return "[test2 " + x + " #" + y + "]";
-    }
-    
-    interface I {
-        String test1();
-        String test2(int y);
-    }
-
-    // virtual methods we make handles for:
-    static class Obj implements I {
-        String x;
-        Obj(String x) { this.x = x; }
-        public String test1() {
-            eachCall();
-            return "[Obj.test1 " + x + "]";
-        }
-        public String test2(int y) {
-            println("y == 0x"+Integer.toHexString(y));
-            eachCall();
-            return "[Obj.test2 " + x + " #" + y + "]";
-        }
-    }
-
-    // JUnit trimmings:
-    @Test
-    public void testMain() throws Throwable {
-        main();
-    }
-}
--- a/netbeans/meth/test/jdk/java/dyn/MethodHandleSyntax.java	Fri Sep 24 14:33:10 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc.  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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- * 
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- * 
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- * 
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package test.java.dyn;
-
-import java.dyn.*;
-
-public class MethodHandleSyntax {
-
-    public static void main(String... av) throws Throwable {
-        test();
-    }
-    static void test() throws Throwable {
-        MethodHandle mh = MethodHandles.lookup().findVirtual(Object.class,
-                "toString", MethodType.methodType(String.class));
-        System.out.println("calling "+mh);
-        // The following non-comment line will fail unless an enhanced
-        // javac.jar from JDK7 langtools is used to bulid this project.
-        // The line will also display a red badge of error highlighting
-        // in NetBeans, until we figure out how to patch NetBeans to allow
-        // the polymorphic MH.invoke sites (and Dynamic.* ones too).
-        String result = (String) mh.<String>invokeExact("foo");
-        // Use this in ./nbproject/project.properties:
-        // project.langtools=../langtools
-        // reference.langtools-javac.jar=${project.langtools}/dist/bootstrap/lib/javac.jar
-        // javac.compilerargs=-Xlint:unchecked -J-Xbootclasspath/p:${reference.langtools-javac.jar} -XDinvokedynamic
-        if ((Object)"foo" != result)  throw new IllegalArgumentException(result);
-    }
-}
--- a/netbeans/meth/test/jdk/java/dyn/MethodTypeTest.java	Fri Sep 24 14:33:10 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,402 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc.  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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package test.java.dyn;
-
-import sun.dyn.MemberName;
-import java.dyn.MethodType;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.junit.*;
-import static org.junit.Assert.*;
-
-/**
- *
- * @author jrose
- */
-public class MethodTypeTest {
-
-    private Class<?> rtype;
-    private Class<?>[] ptypes;
-    private MethodType mt_viS, mt_OO2, mt_vv, mt_Vv, mt_Ov;
-    private MethodType mt_iSI, mt_ISi, mt_ISI, mt_iSi;
-    private MethodType mt_viO, mt_iO2, mt_OOi, mt_iOi;
-    private MethodType mt_VIO, mt_IO2, mt_OOI, mt_IOI, mt_VIS;
-    private Method compareTo;
-
-    @Before
-    public void setUp() throws Exception {
-        rtype = void.class;
-        ptypes = new Class<?>[] { int.class, String.class };
-
-        mt_viS = MethodType.methodType(void.class, int.class, String.class);
-        mt_OO2 = MethodType.methodType(Object.class, Object.class, Object.class);
-        mt_vv = MethodType.methodType(void.class);
-        mt_Vv = MethodType.methodType(Void.class);
-        mt_Ov = MethodType.methodType(Object.class);
-        mt_iSI = MethodType.methodType(int.class, String.class, Integer.class);
-        mt_ISi = MethodType.methodType(Integer.class, String.class, int.class);
-        mt_ISI = MethodType.methodType(Integer.class, String.class, Integer.class);
-        mt_iSi = MethodType.methodType(int.class, String.class, int.class);
-
-        compareTo = String.class.getDeclaredMethod("compareTo", String.class);
-
-        mt_viO = MethodType.methodType(void.class, int.class, Object.class);
-        mt_iO2 = MethodType.methodType(int.class, Object.class, Object.class);
-        mt_OOi = MethodType.methodType(Object.class, Object.class, int.class);
-        mt_iOi = MethodType.methodType(int.class, Object.class, int.class);
-
-        mt_VIO = MethodType.methodType(Void.class, Integer.class, Object.class);
-        mt_IO2 = MethodType.methodType(Integer.class, Object.class, Object.class);
-        mt_OOI = MethodType.methodType(Object.class, Object.class, Integer.class);
-        mt_IOI = MethodType.methodType(Integer.class, Object.class, Integer.class);
-        mt_VIS = MethodType.methodType(Void.class, Integer.class, String.class);
-
-    }
-
-    @After
-    public void tearDown() throws Exception {
-    }
-
-    /**
-     * Test of make method, of class MethodType.
-     */
-    @Test
-    public void testMake_Class_ClassArr() {
-        System.out.println("make (from type array)");
-        MethodType result = MethodType.methodType(rtype, ptypes);
-        assertSame(mt_viS, result);
-    }
-
-    /**
-     * Test of make method, of class MethodType.
-     */
-    @Test
-    public void testMake_Class_List() {
-        System.out.println("make (from type list)");
-        MethodType result = MethodType.methodType(rtype, Arrays.asList(ptypes));
-        assertSame(mt_viS, result);
-    }
-
-    /**
-     * Test of make method, of class MethodType.
-     */
-    @Test
-    public void testMake_3args() {
-        System.out.println("make (from type with varargs)");
-        MethodType result = MethodType.methodType(rtype, ptypes[0], ptypes[1]);
-        assertSame(mt_viS, result);
-    }
-
-    /**
-     * Test of make method, of class MethodType.
-     */
-    @Test
-    public void testMake_Class() {
-        System.out.println("make (from single type)");
-        Class<?> rt = Integer.class;
-        MethodType expResult = MethodType.methodType(rt, new Class<?>[0]);
-        MethodType result = MethodType.methodType(rt);
-        assertSame(expResult, result);
-    }
-
-    @Test
-    public void testMakeGeneric() {
-        System.out.println("makeGeneric");
-        int objectArgCount = 2;
-        MethodType expResult = mt_OO2;
-        MethodType result = MethodType.genericMethodType(objectArgCount);
-        assertSame(expResult, result);
-    }
-
-    /**
-     * Test of make method, of class MethodType.
-     */
-    @Test
-    public void testMake_Method() {
-        System.out.println("make (via MemberName.getMethodType)");
-        MethodType expResult = MethodType.methodType(int.class, String.class);
-        MemberName name = new MemberName(compareTo);
-        MethodType result = name.getMethodType();
-        assertSame(expResult, result);
-    }
-
-    /**
-     * Test of make method, of class MethodType.
-     */
-    @Test
-    public void testMake_MethodType() {
-        System.out.println("make (from rtype, MethodType)");
-        MethodType expResult = mt_iO2;
-        MethodType result = MethodType.methodType(int.class, mt_IO2);
-        assertSame(expResult, result);
-    }
-
-    /**
-     * Test of make method, of class MethodType.
-     */
-    @Test
-    public void testMake_String_ClassLoader() {
-        System.out.println("make (from bytecode signature)");
-        ClassLoader loader = null;
-        MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
-        String obj = "Ljava/lang/Object;";
-        assertEquals(obj, concat(Object.class));
-        String[] expResults = {
-            "(ILjava/lang/String;)V",
-            concat("(", obj, 2, ")", Object.class),
-            "()V", "()"+obj,
-            concat("(", String.class, Integer.class, ")I"),
-            concat("(", String.class, "I)", Integer.class),
-            concat("(", String.class, Integer.class, ")", Integer.class),
-            concat("(", String.class, "I)I")
-        };
-        for (int i = 0; i < instances.length; i++) {
-            MethodType instance = instances[i];
-            String result = instance.toBytecodeString();
-            assertEquals("#"+i, expResults[i], result);
-            MethodType parsed = MethodType.fromBytecodeString(result, loader);
-            assertSame("--#"+i, instance, parsed);
-        }
-    }
-    private static String concat(Object... parts) {
-        StringBuilder sb = new StringBuilder();
-        Object prevPart = "";
-        for (Object part : parts) {
-            if (part instanceof Class) {
-                part = "L"+((Class)part).getName()+";";
-            }
-            if (part instanceof Integer) {
-                for (int n = (Integer) part; n > 1; n--)
-                    sb.append(prevPart);
-                part = "";
-            }
-            sb.append(part);
-            prevPart = part;
-        }
-        return sb.toString().replace('.', '/');
-    }
-
-    @Test
-    public void testHasPrimitives() {
-        System.out.println("hasPrimitives");
-        MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
-        boolean[] expResults =   {true,   false,  true,  false, true,   true,   false,  true};
-        for (int i = 0; i < instances.length; i++) {
-            boolean result = instances[i].hasPrimitives();
-            assertEquals("#"+i, expResults[i], result);
-        }
-    }
-
-    @Test
-    public void testHasWrappers() {
-        System.out.println("hasWrappers");
-        MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
-        boolean[] expResults =   {false,  false,  false, false, true,   true,   true,   false};
-        for (int i = 0; i < instances.length; i++) {
-            System.out.println("  hasWrappers "+instances[i]);
-            boolean result = instances[i].hasWrappers();
-            assertEquals("#"+i, expResults[i], result);
-        }
-    }
-
-    @Test
-    public void testErase() {
-        System.out.println("erase");
-        MethodType[] instances  = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
-        MethodType[] expResults = {mt_viO, mt_OO2, mt_vv, mt_Ov, mt_iO2, mt_OOi, mt_OO2, mt_iOi};
-        for (int i = 0; i < instances.length; i++) {
-            MethodType result = instances[i].erase();
-            assertSame("#"+i, expResults[i], result);
-        }
-    }
-
-    @Test
-    public void testGeneric() {
-        System.out.println("generic");
-        MethodType[] instances =  {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
-        MethodType[] expResults = {mt_OO2, mt_OO2, mt_Ov, mt_Ov, mt_OO2, mt_OO2, mt_OO2, mt_OO2};
-        for (int i = 0; i < instances.length; i++) {
-            MethodType result = instances[i].generic();
-            assertSame("#"+i, expResults[i], result);
-        }
-    }
-
-    @Test
-    public void testWrap() {
-        System.out.println("wrap");
-        MethodType[] instances =  {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
-        MethodType[] expResults = {mt_VIS, mt_OO2, mt_Vv, mt_Ov, mt_ISI, mt_ISI, mt_ISI, mt_ISI};
-        for (int i = 0; i < instances.length; i++) {
-            MethodType result = instances[i].wrap();
-            assertSame("#"+i, expResults[i], result);
-        }
-    }
-
-    @Test
-    public void testUnwrap() {
-        System.out.println("unwrap");
-        MethodType[] instances =  {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
-        MethodType[] expResults = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSi, mt_iSi, mt_iSi, mt_iSi};
-        for (int i = 0; i < instances.length; i++) {
-            MethodType result = instances[i].unwrap();
-            assertSame("#"+i, expResults[i], result);
-        }
-    }
-
-    /**
-     * Test of parameterType method, of class MethodType.
-     */
-    @Test
-    public void testParameterType() {
-        System.out.println("parameterType");
-        for (int num = 0; num < ptypes.length; num++) {
-            MethodType instance = mt_viS;
-            Class<?> expResult = ptypes[num];
-            Class<?> result = instance.parameterType(num);
-            assertSame(expResult, result);
-        }
-    }
-
-    /**
-     * Test of parameterCount method, of class MethodType.
-     */
-    @Test
-    public void testParameterCount() {
-        System.out.println("parameterCount");
-        MethodType instance = mt_viS;
-        int expResult = 2;
-        int result = instance.parameterCount();
-        assertEquals(expResult, result);
-    }
-
-    /**
-     * Test of returnType method, of class MethodType.
-     */
-    @Test
-    public void testReturnType() {
-        System.out.println("returnType");
-        MethodType instance = mt_viS;
-        Class<?> expResult = void.class;
-        Class<?> result = instance.returnType();
-        assertSame(expResult, result);
-    }
-
-    /**
-     * Test of parameterList method, of class MethodType.
-     */
-    @Test
-    public void testParameterList() {
-        System.out.println("parameterList");
-        MethodType instance = mt_viS;
-        List<Class<?>> expResult = Arrays.asList(ptypes);
-        List<Class<?>> result = instance.parameterList();
-        assertEquals(expResult, result);
-    }
-
-    /**
-     * Test of parameterArray method, of class MethodType.
-     */
-    @Test
-    public void testParameterArray() {
-        System.out.println("parameterArray");
-        MethodType instance = mt_viS;
-        Class<?>[] expResult = ptypes;
-        Class<?>[] result = instance.parameterArray();
-        assertEquals(Arrays.asList(expResult), Arrays.asList(result));
-    }
-
-    /**
-     * Test of equals method, of class MethodType.
-     */
-    @Test
-    public void testEquals_Object() {
-        System.out.println("equals");
-        Object x = null;
-        MethodType instance = mt_viS;
-        boolean expResult = false;
-        boolean result = instance.equals(x);
-        assertEquals(expResult, result);
-    }
-
-    /**
-     * Test of equals method, of class MethodType.
-     */
-    @Test
-    public void testEquals_MethodType() {
-        System.out.println("equals");
-        MethodType that = mt_viS;
-        MethodType instance = mt_viS;
-        boolean expResult = true;
-        boolean result = instance.equals(that);
-        assertEquals(expResult, result);
-    }
-
-    /**
-     * Test of hashCode method, of class MethodType.
-     */
-    @Test
-    public void testHashCode() {
-        System.out.println("hashCode");
-        MethodType instance = mt_viS;
-        ArrayList<Class<?>> types = new ArrayList<Class<?>>();
-        types.add(instance.returnType());
-        types.addAll(instance.parameterList());
-        int expResult = types.hashCode();
-        int result = instance.hashCode();
-        assertEquals(expResult, result);
-    }
-
-    /**
-     * Test of toString method, of class MethodType.
-     */
-    @Test
-    public void testToString() {
-        System.out.println("toString");
-        MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
-        //String expResult = "void[int, class java.lang.String]";
-        String[] expResults = {
-            "(int,java.lang.String)void",
-            "(java.lang.Object,java.lang.Object)java.lang.Object",
-            "()void",
-            "()java.lang.Object",
-            "(java.lang.String,java.lang.Integer)int",
-            "(java.lang.String,int)java.lang.Integer",
-            "(java.lang.String,java.lang.Integer)java.lang.Integer",
-            "(java.lang.String,int)int"
-        };
-        for (int i = 0; i < instances.length; i++) {
-            MethodType instance = instances[i];
-            String result = instance.toString();
-            System.out.println("#"+i+":"+result);
-            assertEquals("#"+i, expResults[i], result);
-        }
-    }
-
-
-}