Tue, 04 Dec 2012 17:19:42 +0000
8004360: regression test DefaultMethodRegressionTests fails in langtools
Summary: ignore broken failing test
Reviewed-by: jjg
1.1 --- a/test/tools/javac/defaultMethodExecution/DefaultMethodRegressionTests.java Fri Nov 30 16:34:51 2012 -0800 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,137 +0,0 @@ 1.4 -/* 1.5 - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. 1.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 - * 1.8 - * This code is free software; you can redistribute it and/or modify it 1.9 - * under the terms of the GNU General Public License version 2 only, as 1.10 - * published by the Free Software Foundation. Oracle designates this 1.11 - * particular file as subject to the "Classpath" exception as provided 1.12 - * by Oracle in the LICENSE file that accompanied this code. 1.13 - * 1.14 - * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 - * version 2 for more details (a copy is included in the LICENSE file that 1.18 - * accompanied this code). 1.19 - * 1.20 - * You should have received a copy of the GNU General Public License version 1.21 - * 2 along with this work; if not, write to the Free Software Foundation, 1.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 - * 1.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 - * or visit www.oracle.com if you need additional information or have any 1.26 - * questions. 1.27 - */ 1.28 - 1.29 -/** 1.30 - * @test 1.31 - * @bug 8003639 1.32 - * @summary convert lambda testng tests to jtreg and add them 1.33 - * @run testng DefaultMethodRegressionTests 1.34 - */ 1.35 - 1.36 -import java.util.ArrayList; 1.37 -import java.util.Arrays; 1.38 -import java.util.List; 1.39 -import org.testng.annotations.Test; 1.40 - 1.41 -import static org.testng.Assert.*; 1.42 - 1.43 -/** 1.44 - * This set of classes/interfaces (K/I/C) is specially designed to expose a 1.45 - * bug in the JVM where it did not find some overloaded methods in some 1.46 - * specific situations. (fixed by hotspot changeset ffb9316fd9ed) 1.47 - */ 1.48 -interface K { 1.49 - int bbb(Long l); 1.50 -} 1.51 - 1.52 -interface I extends K { 1.53 - default void aaa() {} 1.54 - default void aab() {} 1.55 - default void aac() {} 1.56 - 1.57 - default int bbb(Integer i) { return 22; } 1.58 - default int bbb(Float f) { return 33; } 1.59 - default int bbb(Long l) { return 44; } 1.60 - default int bbb(Double d) { return 55; } 1.61 - default int bbb(String s) { return 66; } 1.62 - 1.63 - default void caa() {} 1.64 - default void cab() {} 1.65 - default void cac() {} 1.66 -} 1.67 - 1.68 -class C implements I {} 1.69 - 1.70 -public class DefaultMethodRegressionTests { 1.71 - 1.72 - @Test(groups = "vm") 1.73 - public void testLostOverloadedMethod() { 1.74 - C c = new C(); 1.75 - assertEquals(c.bbb(new Integer(1)), 22); 1.76 - assertEquals(c.bbb(new Float(1.1)), 33); 1.77 - assertEquals(c.bbb(new Long(1L)), 44); 1.78 - assertEquals(c.bbb(new Double(0.01)), 55); 1.79 - assertEquals(c.bbb(new String("")), 66); 1.80 - } 1.81 - 1.82 - // Test to ensure that the inference verifier accepts older classfiles 1.83 - // with classes that implement interfaces with defaults. 1.84 - @Test(groups = "vm") 1.85 - public void testInferenceVerifier() { 1.86 - // interface I { int m() default { return 99; } } 1.87 - byte I_bytes[] = { 1.88 - (byte)0xca, (byte)0xfe, (byte)0xba, (byte)0xbe, 0x00, 0x00, 0x00, 0x33, 1.89 - 0x00, 0x08, 0x07, 0x00, 0x06, 0x07, 0x00, 0x07, 1.90 - 0x01, 0x00, 0x03, 0x66, 0x6f, 0x6f, 0x01, 0x00, 1.91 - 0x03, 0x28, 0x29, 0x49, 0x01, 0x00, 0x04, 0x43, 1.92 - 0x6f, 0x64, 0x65, 0x01, 0x00, 0x01, 0x49, 0x01, 1.93 - 0x00, 0x10, 0x6a, 0x61, 0x76, 0x61, 0x2f, 0x6c, 1.94 - 0x61, 0x6e, 0x67, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 1.95 - 0x63, 0x74, 0x06, 0x00, 0x00, 0x01, 0x00, 0x02, 1.96 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, 1.97 - 0x00, 0x03, 0x00, 0x04, 0x00, 0x01, 0x00, 0x05, 1.98 - 0x00, 0x00, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x01, 1.99 - 0x00, 0x00, 0x00, 0x03, 0x10, 0x63, (byte)0xac, 0x00, 1.100 - 0x00, 0x00, 0x00, 0x00, 0x00 1.101 - }; 1.102 - // public class C implements I {} /* -target 1.5 */ 1.103 - byte C_bytes[] = { 1.104 - (byte)0xca, (byte)0xfe, (byte)0xba, (byte)0xbe, 0x00, 0x00, 0x00, 0x31, 1.105 - 0x00, 0x0c, 0x0a, 0x00, 0x03, 0x00, 0x08, 0x07, 1.106 - 0x00, 0x09, 0x07, 0x00, 0x0a, 0x07, 0x00, 0x0b, 1.107 - 0x01, 0x00, 0x06, 0x3c, 0x69, 0x6e, 0x69, 0x74, 1.108 - 0x3e, 0x01, 0x00, 0x03, 0x28, 0x29, 0x56, 0x01, 1.109 - 0x00, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x0c, 0x00, 1.110 - 0x05, 0x00, 0x06, 0x01, 0x00, 0x01, 0x43, 0x01, 1.111 - 0x00, 0x10, 0x6a, 0x61, 0x76, 0x61, 0x2f, 0x6c, 1.112 - 0x61, 0x6e, 0x67, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 1.113 - 0x63, 0x74, 0x01, 0x00, 0x01, 0x49, 0x00, 0x21, 1.114 - 0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 1.115 - 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x05, 1.116 - 0x00, 0x06, 0x00, 0x01, 0x00, 0x07, 0x00, 0x00, 1.117 - 0x00, 0x11, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 1.118 - 0x00, 0x05, 0x2a, (byte)0xb7, 0x00, 0x01, (byte)0xb1, 0x00, 1.119 - 0x00, 0x00, 0x00, 0x00, 0x00 1.120 - }; 1.121 - 1.122 - ClassLoader cl = new ClassLoader() { 1.123 - protected Class<?> findClass(String name) { 1.124 - if (name.equals("I")) { 1.125 - return defineClass("I", I_bytes, 0, I_bytes.length); 1.126 - } else if (name.equals("C")) { 1.127 - return defineClass("C", C_bytes, 0, C_bytes.length); 1.128 - } else { 1.129 - return null; 1.130 - } 1.131 - } 1.132 - }; 1.133 - try { 1.134 - Class.forName("C", true, cl); 1.135 - } catch (Exception e) { 1.136 - // unmodified verifier will throw VerifyError 1.137 - fail("No exception should be thrown"); 1.138 - } 1.139 - } 1.140 -}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/test/tools/javac/defaultMethods/defaultMethodExecution/DefaultMethodRegressionTests.java Tue Dec 04 17:19:42 2012 +0000 2.3 @@ -0,0 +1,138 @@ 2.4 +/* 2.5 + * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. 2.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.7 + * 2.8 + * This code is free software; you can redistribute it and/or modify it 2.9 + * under the terms of the GNU General Public License version 2 only, as 2.10 + * published by the Free Software Foundation. Oracle designates this 2.11 + * particular file as subject to the "Classpath" exception as provided 2.12 + * by Oracle in the LICENSE file that accompanied this code. 2.13 + * 2.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 2.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2.17 + * version 2 for more details (a copy is included in the LICENSE file that 2.18 + * accompanied this code). 2.19 + * 2.20 + * You should have received a copy of the GNU General Public License version 2.21 + * 2 along with this work; if not, write to the Free Software Foundation, 2.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2.23 + * 2.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2.25 + * or visit www.oracle.com if you need additional information or have any 2.26 + * questions. 2.27 + */ 2.28 + 2.29 +/** 2.30 + * @test 2.31 + * @ignore 8004360 2.32 + * @bug 8003639 2.33 + * @summary convert lambda testng tests to jtreg and add them 2.34 + * @run testng DefaultMethodRegressionTests 2.35 + */ 2.36 + 2.37 +import java.util.ArrayList; 2.38 +import java.util.Arrays; 2.39 +import java.util.List; 2.40 +import org.testng.annotations.Test; 2.41 + 2.42 +import static org.testng.Assert.*; 2.43 + 2.44 +/** 2.45 + * This set of classes/interfaces (K/I/C) is specially designed to expose a 2.46 + * bug in the JVM where it did not find some overloaded methods in some 2.47 + * specific situations. (fixed by hotspot changeset ffb9316fd9ed) 2.48 + */ 2.49 +interface K { 2.50 + int bbb(Long l); 2.51 +} 2.52 + 2.53 +interface I extends K { 2.54 + default void aaa() {} 2.55 + default void aab() {} 2.56 + default void aac() {} 2.57 + 2.58 + default int bbb(Integer i) { return 22; } 2.59 + default int bbb(Float f) { return 33; } 2.60 + default int bbb(Long l) { return 44; } 2.61 + default int bbb(Double d) { return 55; } 2.62 + default int bbb(String s) { return 66; } 2.63 + 2.64 + default void caa() {} 2.65 + default void cab() {} 2.66 + default void cac() {} 2.67 +} 2.68 + 2.69 +class C implements I {} 2.70 + 2.71 +public class DefaultMethodRegressionTests { 2.72 + 2.73 + @Test(groups = "vm") 2.74 + public void testLostOverloadedMethod() { 2.75 + C c = new C(); 2.76 + assertEquals(c.bbb(new Integer(1)), 22); 2.77 + assertEquals(c.bbb(new Float(1.1)), 33); 2.78 + assertEquals(c.bbb(new Long(1L)), 44); 2.79 + assertEquals(c.bbb(new Double(0.01)), 55); 2.80 + assertEquals(c.bbb(new String("")), 66); 2.81 + } 2.82 + 2.83 + // Test to ensure that the inference verifier accepts older classfiles 2.84 + // with classes that implement interfaces with defaults. 2.85 + @Test(groups = "vm") 2.86 + public void testInferenceVerifier() { 2.87 + // interface I { int m() default { return 99; } } 2.88 + byte I_bytes[] = { 2.89 + (byte)0xca, (byte)0xfe, (byte)0xba, (byte)0xbe, 0x00, 0x00, 0x00, 0x33, 2.90 + 0x00, 0x08, 0x07, 0x00, 0x06, 0x07, 0x00, 0x07, 2.91 + 0x01, 0x00, 0x03, 0x66, 0x6f, 0x6f, 0x01, 0x00, 2.92 + 0x03, 0x28, 0x29, 0x49, 0x01, 0x00, 0x04, 0x43, 2.93 + 0x6f, 0x64, 0x65, 0x01, 0x00, 0x01, 0x49, 0x01, 2.94 + 0x00, 0x10, 0x6a, 0x61, 0x76, 0x61, 0x2f, 0x6c, 2.95 + 0x61, 0x6e, 0x67, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 2.96 + 0x63, 0x74, 0x06, 0x00, 0x00, 0x01, 0x00, 0x02, 2.97 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, 2.98 + 0x00, 0x03, 0x00, 0x04, 0x00, 0x01, 0x00, 0x05, 2.99 + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x01, 2.100 + 0x00, 0x00, 0x00, 0x03, 0x10, 0x63, (byte)0xac, 0x00, 2.101 + 0x00, 0x00, 0x00, 0x00, 0x00 2.102 + }; 2.103 + // public class C implements I {} /* -target 1.5 */ 2.104 + byte C_bytes[] = { 2.105 + (byte)0xca, (byte)0xfe, (byte)0xba, (byte)0xbe, 0x00, 0x00, 0x00, 0x31, 2.106 + 0x00, 0x0c, 0x0a, 0x00, 0x03, 0x00, 0x08, 0x07, 2.107 + 0x00, 0x09, 0x07, 0x00, 0x0a, 0x07, 0x00, 0x0b, 2.108 + 0x01, 0x00, 0x06, 0x3c, 0x69, 0x6e, 0x69, 0x74, 2.109 + 0x3e, 0x01, 0x00, 0x03, 0x28, 0x29, 0x56, 0x01, 2.110 + 0x00, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x0c, 0x00, 2.111 + 0x05, 0x00, 0x06, 0x01, 0x00, 0x01, 0x43, 0x01, 2.112 + 0x00, 0x10, 0x6a, 0x61, 0x76, 0x61, 0x2f, 0x6c, 2.113 + 0x61, 0x6e, 0x67, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 2.114 + 0x63, 0x74, 0x01, 0x00, 0x01, 0x49, 0x00, 0x21, 2.115 + 0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 2.116 + 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x05, 2.117 + 0x00, 0x06, 0x00, 0x01, 0x00, 0x07, 0x00, 0x00, 2.118 + 0x00, 0x11, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 2.119 + 0x00, 0x05, 0x2a, (byte)0xb7, 0x00, 0x01, (byte)0xb1, 0x00, 2.120 + 0x00, 0x00, 0x00, 0x00, 0x00 2.121 + }; 2.122 + 2.123 + ClassLoader cl = new ClassLoader() { 2.124 + protected Class<?> findClass(String name) { 2.125 + if (name.equals("I")) { 2.126 + return defineClass("I", I_bytes, 0, I_bytes.length); 2.127 + } else if (name.equals("C")) { 2.128 + return defineClass("C", C_bytes, 0, C_bytes.length); 2.129 + } else { 2.130 + return null; 2.131 + } 2.132 + } 2.133 + }; 2.134 + try { 2.135 + Class.forName("C", true, cl); 2.136 + } catch (Exception e) { 2.137 + // unmodified verifier will throw VerifyError 2.138 + fail("No exception should be thrown"); 2.139 + } 2.140 + } 2.141 +}