test/jdk/java/lang/invoke/SpreadCollectTest.java
changeset 47856 76519338df34
parent 47216 71c04702a3d5
equal deleted inserted replaced
47855:72b6d674bde2 47856:76519338df34
    90 
    90 
    91     @Test(expectedExceptions = {WrongMethodTypeException.class})
    91     @Test(expectedExceptions = {WrongMethodTypeException.class})
    92     public static void testAsSpreaderIllegalMethodType() {
    92     public static void testAsSpreaderIllegalMethodType() {
    93         MethodHandle h = MethodHandles.dropArguments(MethodHandles.constant(String.class, ""), 0, int.class, int.class);
    93         MethodHandle h = MethodHandles.dropArguments(MethodHandles.constant(String.class, ""), 0, int.class, int.class);
    94         MethodHandle s = h.asSpreader(String[].class, 1);
    94         MethodHandle s = h.asSpreader(String[].class, 1);
       
    95     }
       
    96 
       
    97     @Test(expectedExceptions = {NullPointerException.class})
       
    98     public static void testAsSpreaderNullArrayType() {
       
    99         SpreadCollect.MH_forSpreading.asSpreader(null, 0);
       
   100     }
       
   101 
       
   102     @Test(expectedExceptions = {NullPointerException.class})
       
   103     public static void testAsSpreaderNullArrayNonZeroLength() {
       
   104         SpreadCollect.MH_forSpreading.asSpreader(null, 1);
       
   105     }
       
   106 
       
   107     @Test(expectedExceptions = {IllegalArgumentException.class})
       
   108     public static void testAsSpreaderTooManyParams() throws Throwable {
       
   109         SpreadCollect.MH_forSpreading.asSpreader(1, int[].class, 6);
    95     }
   110     }
    96 
   111 
    97     @Test
   112     @Test
    98     public static void testAsCollector() throws Throwable {
   113     public static void testAsCollector() throws Throwable {
    99         MethodHandle collector = SpreadCollect.MH_forCollecting.asCollector(1, int[].class, 1);
   114         MethodHandle collector = SpreadCollect.MH_forCollecting.asCollector(1, int[].class, 1);