TestC2.java revision 1952
0N/A * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A* @summary Some tests for the generic core reflection api. 0N/A* @author Gilad Bracha 0N/A public abstract T
mt(T t);
public abstract <E, R>
C0 mc1(E e);
"Superclass of C2 should be a parameterized type";
"The raw generic superclass of C2 should be C0";
"Superclass of C2 should have one type argument";
"Type argument to superclass of C2 should be a type variable";
"Name of type argument to superclass of C2 should be T1";
"T1 has one bound (superclass)";
"Bound of C0 should be a parameterized type";
"The raw bound of T1 should be C2";
"Bound of T1 should have three type arguments";
"First argument to bound of T1 is a type variable";
"Second argument to bound of T1 is a type variable";
"Third argument to bound of T1 is a type variable";
"First type arg to bound of T1 is T1";
"Seconmd type arg to bound of T1 is T2";
"Third type arg to bound of T1 is T3";
"C2 should have three generic superinterfaces";
"First superinterface of C2 should be a parameterized type";
"First super interface of C2 is instantiation of I1";
"First super interface of C2 has 2 type arguments";
"Second superinterface of C2 should be a parameterized type";
"Second super interface of C2 is instantiation of I2";
"Second super interface of C2 has 3 type arguments";
"Third superinterface of C2 is I3";
// Test interfaces themselves "I3 has two formal type parameters";
"Name of first formal type arg of I1 is X1";
"Name of second formal type arg of I1 is X2";
"The generic and non-generic superclasses of an interface must be the same";
"I1 has one generic superinterface";
"Superinterface of I1 is I3";
"I3 has three formal type parameters";
"Name of first formal type arg of I2 is E1";
"Name of second formal type arg of I2 is E2";
"Name of third formal type arg of I2 is E3";
"The generic and non-generic superclasses of an interface must be the same";
"I3 has no formal type parameters";
"The generic and non-generic superclasses of an interface must be the same";
"C2 should have three type parameters";
"T1 should have one bound";
"The bound of T1 should be a parameterized type";
"T2 should have one bound";
"The bound of T2 should be a parameterized type";
"T3 should have one bound";
"The bound of T3 should be Throwable";
"The return type of mc1t should be a parameterized type";
"The raw return type of mc1t should be C0";
"Return type of mc1t should have one type argument";
"Type argument of return type of mc1t is a type variable";
"Return type of mc1 is C0";
"Return type of mt is a type variable";
"C0.mc1t has three parameters";
"Generic type of the 1st parameter of mc1t(T) is a type variable";
"Name of 1st type parameter of mc1t is T3, not " +
tv.
getName();
"T3 should have one bound (mc1t)";
"The bound of T3 should be Throwable(mc1t)";
"The type of parameter 2 of mc1t is a parameterized type";
"Type of parameter 2 of mc1t is instantiation of C0";
"Type of parameter 2 of mc1t is has null owner";
"The type of parameter 2 of mc1t has one type argument";
"The actual type arg of C0<T> is a type variable (mc1t)";
"mc1t: Name of the type arg of C0<T> is T, not " +
tv.
getName();
"mc1t: The type argument of C0<T> should have one bound";
"mc1t: The bound of the type arg of C0<T> should be Object";
"Type of parameter 3 of mc1t is C0";
"C2.mc1 has one parameter";
"C2.mt has one parameter";
"The generic type of the parameter of mt(T) is a type variable";
"The name of the type parameter of mt is T2, not " +
tv.
getName();
"T2 should have one bound";
"The bound of T2 should be parameterized type";
"Method C0.mc1t should have no generic exception types";
"Method C0.mc1 should have no generic exception types";
"Method C0.mt should have no generic exception types";
"Method C2.mc1t should have one type parameter";
"Method C2.mc1 should have two type parameters";
"Method C2.mt should have no type parameters";
"The generic type of C0.ft is a type variable";
"The name of the type of ft is T1, not " +
tv.
getName();
"The type of ft should have one bound";
"The generic type of C0.fc1t is a parameterized type";
"Type of C2.fc1t is an instantiation of C0";
"Type of C2.fc1t is has null owner";
"The type of fc1t has one type argument";
"The actual type arg of C0<String> is String";
" Type of C2.fc1 should be C0";
" Type of C2.fi should be int";
"Constructor C0(T) should have one generic parameter type";
"The generic type of the parameter of C0(T2) is a type variable";
"The name of the type parameter of C2 is T2, not " +
tv.
getName();
"T should have one bound";
"Constructor C2(T2) should have no generic exception types";
"Constructor C2(T2) should have no type parameters";
"Constructor C0(T) should have one generic parameter type";
"The generic type of the parameter of C2(T) is a type variable";
"The name of the type parameter of C2 is T, not " +
tv.
getName();
"T should have one bound";
"Constructor C2(T) should have no generic exception types";
"Constructor C2(T) should have one type parameter";
"Constructor C2(T1,T2,T4) should have three generic parameter types";
"The generic type of the first parameter of C2(T1,T2,T4) is a type variable";
"The name of the type parameter of C2(T1,T2,T4) is T1, not " +
tv.
getName();
"T should have one bound";
"Constructor C2(T1,T2,T4) should have no generic exception types";
"Constructor C2(T1,T2,T4) should have four type parameters";
"Constructor C2() should have no generic parameter types";
"Constructor C2() should have one generic exception type";
"Constructor C2() should have no type parameters";