/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4906359 4963461 4965058 4965039 4986770
* @summary Unit test for annotation reading
* @author Josh Bloch
*/
public class UnitTest {
private static final Class[] Y = { int.class };
// *** TESTS ON ANNOTATED METHODS ***
// MULTIMEMBER SCALAR TYPES ON METHOD
// MULTIMEMBER ARRAY TYPES ON METHOD
// MARKER TYPE ON METHOD
// SINGLE-MEMBER SCALAR TYPES ON METHOD
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-OVERRIDE ON METHOD
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-ACCEPT ON METHOD
// SINGLE-MEMBER ARRAY TYPES (EMPTY ARRAY) ON METHOD
// SINGLE-MEMBER ARRAY TYPES (ONE-ELEMENT ARRAY) ON METHOD
// SINGLE-MEMBER ARRAY TYPES (TWO-ELEMENT ARRAY) ON METHOD
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (OVERRIDE)ON METHOD
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (ACCEPT)ON METHOD
checkSingleMemberBooleanArrAcceptDef(UnitTest.class.getMethod("SingleMemberBooleanArrAcceptDef", X));
// *** TESTS ON ANNOTATED FIELDS ***
// MULTIMEMBER SCALAR TYPES ON FIELD
// MULTIMEMBER ARRAY TYPES ON FIELD
// MARKER TYPE ON FIELD
// SINGLE-MEMBER SCALAR TYPES ON FIELD
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-OVERRIDE ON FIELD
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-ACCEPT ON FIELD
// SINGLE-MEMBER ARRAY TYPES (EMPTY ARRAY) ON FIELD
// SINGLE-MEMBER ARRAY TYPES (ONE-ELEMENT ARRAY) ON FIELD
// SINGLE-MEMBER ARRAY TYPES (TWO-ELEMENT ARRAY) ON FIELD
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (OVERRIDE)ON FIELD
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (ACCEPT)ON FIELD
checkSingleMemberDoubleArrAcceptDef(UnitTest.class.getField("SingleMemberDoubleArrAcceptDefField"));
checkSingleMemberBooleanArrAcceptDef(UnitTest.class.getField("SingleMemberBooleanArrAcceptDefField"));
checkSingleMemberStringArrAcceptDef(UnitTest.class.getField("SingleMemberStringArrAcceptDefField"));
// *** TESTS ON ANNOTATED ENUM CONSTS ***
// MULTIMEMBER SCALAR TYPES ON ENUM CONST
// MULTIMEMBER ARRAY TYPES ON ENUM CONST
// MARKER TYPE ON CLASS
// SINGLE-MEMBER SCALAR TYPES ON CLASS
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-OVERRIDE ON CLASS
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-ACCEPT ON CLASS
// SINGLE-MEMBER ARRAY TYPES (TestType.class.getField("EMPTY ARRAY) ON CLASS
// SINGLE-MEMBER ARRAY TYPES (TestType.class.getField("ONE-ELEMENT ARRAY) ON CLASS
// SINGLE-MEMBER ARRAY TYPES (TestType.class.getField("TWO-ELEMENT ARRAY) ON CLASS
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (TestType.class.getField("OVERRIDE)ON CLASS
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (TestType.class.getField("ACCEPT)ON CLASS
// *** TESTS ON ANNOTATED CONSTRUCTORS ***
// MULTIMEMBER SCALAR TYPES ON CONSTRUCTOR
// MULTIMEMBER ARRAY TYPES ON CONSTRUCTOR
// MARKER TYPE ON CONSTRUCTOR
// SINGLE-MEMBER SCALAR TYPES ON CONSTRUCTOR
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-OVERRIDE ON CONSTRUCTOR
checkSingleMemberShortOvrdDef(UnitTest.class.getConstructor(new Class[] { short.class, Set.class }));
checkSingleMemberFloatOvrdDef(UnitTest.class.getConstructor(new Class[] { float.class, Set.class }));
checkSingleMemberDoubleOvrdDef(UnitTest.class.getConstructor(new Class[] { double.class, Set.class }));
checkSingleMemberBooleanOvrdDef(UnitTest.class.getConstructor(new Class[] { boolean.class, Set.class }));
checkSingleMemberStringOvrdDef(UnitTest.class.getConstructor(new Class[] { String.class, Set.class }));
checkSingleMemberClassOvrdDef(UnitTest.class.getConstructor(new Class[] { Class.class, Set.class }));
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-ACCEPT ON CONSTRUCTOR
checkSingleMemberByteAcceptDef(UnitTest.class.getConstructor(new Class[] { byte.class, Map.class }));
checkSingleMemberShortAcceptDef(UnitTest.class.getConstructor(new Class[] { short.class, Map.class }));
checkSingleMemberLongAcceptDef(UnitTest.class.getConstructor(new Class[] { long.class, Map.class }));
checkSingleMemberCharAcceptDef(UnitTest.class.getConstructor(new Class[] { char.class, Map.class }));
checkSingleMemberFloatAcceptDef(UnitTest.class.getConstructor(new Class[] { float.class, Map.class }));
checkSingleMemberDoubleAcceptDef(UnitTest.class.getConstructor(new Class[] { double.class, Map.class }));
checkSingleMemberBooleanAcceptDef(UnitTest.class.getConstructor(new Class[] { boolean.class, Map.class }));
checkSingleMemberStringAcceptDef(UnitTest.class.getConstructor(new Class[] { String.class, Map.class }));
checkSingleMemberClassAcceptDef(UnitTest.class.getConstructor(new Class[] { Class.class, Map.class }));
checkSingleMemberEnumAcceptDef(UnitTest.class.getConstructor(new Class[] { Enum.class, Map.class }));
// SINGLE-MEMBER ARRAY TYPES (EMPTY ARRAY) ON CONSTRUCTOR
// SINGLE-MEMBER ARRAY TYPES (ONE-ELEMENT ARRAY) ON CONSTRUCTOR
checkSingleMemberByteArrOne(UnitTest.class.getConstructor(new Class[] { byte[].class, Set.class }));
checkSingleMemberShortArrOne(UnitTest.class.getConstructor(new Class[] { short[].class, Set.class }));
checkSingleMemberLongArrOne(UnitTest.class.getConstructor(new Class[] { long[].class, Set.class }));
checkSingleMemberCharArrOne(UnitTest.class.getConstructor(new Class[] { char[].class, Set.class }));
checkSingleMemberFloatArrOne(UnitTest.class.getConstructor(new Class[] { float[].class, Set.class }));
checkSingleMemberDoubleArrOne(UnitTest.class.getConstructor(new Class[] { double[].class, Set.class }));
checkSingleMemberBooleanArrOne(UnitTest.class.getConstructor(new Class[] { boolean[].class, Set.class }));
checkSingleMemberStringArrOne(UnitTest.class.getConstructor(new Class[] { String[].class, Set.class }));
checkSingleMemberClassArrOne(UnitTest.class.getConstructor(new Class[] { Class[].class, Set.class }));
checkSingleMemberEnumArrOne(UnitTest.class.getConstructor(new Class[] { Enum[].class, Set.class }));
// SINGLE-MEMBER ARRAY TYPES (TWO-ELEMENT ARRAY) ON CONSTRUCTOR
checkSingleMemberByteArrTwo(UnitTest.class.getConstructor(new Class[] { byte[].class, Map.class }));
checkSingleMemberShortArrTwo(UnitTest.class.getConstructor(new Class[] { short[].class, Map.class }));
checkSingleMemberLongArrTwo(UnitTest.class.getConstructor(new Class[] { long[].class, Map.class }));
checkSingleMemberCharArrTwo(UnitTest.class.getConstructor(new Class[] { char[].class, Map.class }));
checkSingleMemberFloatArrTwo(UnitTest.class.getConstructor(new Class[] { float[].class, Map.class }));
checkSingleMemberDoubleArrTwo(UnitTest.class.getConstructor(new Class[] { double[].class, Map.class }));
checkSingleMemberBooleanArrTwo(UnitTest.class.getConstructor(new Class[] { boolean[].class, Map.class }));
checkSingleMemberStringArrTwo(UnitTest.class.getConstructor(new Class[] { String[].class, Map.class }));
checkSingleMemberClassArrTwo(UnitTest.class.getConstructor(new Class[] { Class[].class, Map.class }));
checkSingleMemberEnumArrTwo(UnitTest.class.getConstructor(new Class[] { Enum[].class, Map.class }));
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (OVERRIDE)ON CONSTRUCTOR
checkSingleMemberByteArrOvrdDef(UnitTest.class.getConstructor(new Class[] { byte[].class, List.class }));
checkSingleMemberShortArrOvrdDef(UnitTest.class.getConstructor(new Class[] { short[].class, List.class }));
checkSingleMemberIntArrOvrdDef(UnitTest.class.getConstructor(new Class[] { int[].class, List.class }));
checkSingleMemberLongArrOvrdDef(UnitTest.class.getConstructor(new Class[] { long[].class, List.class }));
checkSingleMemberCharArrOvrdDef(UnitTest.class.getConstructor(new Class[] { char[].class, List.class }));
checkSingleMemberFloatArrOvrdDef(UnitTest.class.getConstructor(new Class[] { float[].class, List.class }));
checkSingleMemberDoubleArrOvrdDef(UnitTest.class.getConstructor(new Class[] { double[].class, List.class }));
checkSingleMemberBooleanArrOvrdDef(UnitTest.class.getConstructor(new Class[] { boolean[].class, List.class }));
checkSingleMemberStringArrOvrdDef(UnitTest.class.getConstructor(new Class[] { String[].class, List.class }));
checkSingleMemberClassArrOvrdDef(UnitTest.class.getConstructor(new Class[] { Class[].class, List.class }));
checkSingleMemberEnumArrOvrdDef(UnitTest.class.getConstructor(new Class[] { Enum[].class, List.class }));
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (ACCEPT)ON CONSTRUCTOR
checkSingleMemberByteArrAcceptDef(UnitTest.class.getConstructor(new Class[] { byte[].class, Collection.class }));
checkSingleMemberShortArrAcceptDef(UnitTest.class.getConstructor(new Class[] { short[].class, Collection.class }));
checkSingleMemberIntArrAcceptDef(UnitTest.class.getConstructor(new Class[] { int[].class, Collection.class }));
checkSingleMemberLongArrAcceptDef(UnitTest.class.getConstructor(new Class[] { long[].class, Collection.class }));
checkSingleMemberCharArrAcceptDef(UnitTest.class.getConstructor(new Class[] { char[].class, Collection.class }));
checkSingleMemberFloatArrAcceptDef(UnitTest.class.getConstructor(new Class[] { float[].class, Collection.class }));
checkSingleMemberDoubleArrAcceptDef(UnitTest.class.getConstructor(new Class[] { double[].class, Collection.class }));
checkSingleMemberBooleanArrAcceptDef(UnitTest.class.getConstructor(new Class[] { boolean[].class, Collection.class }));
checkSingleMemberStringArrAcceptDef(UnitTest.class.getConstructor(new Class[] { String[].class, Collection.class }));
checkSingleMemberClassArrAcceptDef(UnitTest.class.getConstructor(new Class[] { Class[].class, Collection.class }));
checkSingleMemberEnumArrAcceptDef(UnitTest.class.getConstructor(new Class[] { Enum[].class, Collection.class }));
// *** TESTS ON ANNOTATED PARAMETERS ***
// MULTIMEMBER SCALAR TYPES ON PARAM
checkScalarTypesOverrideDefaultParam(UnitTest.class.getMethod("scalarTypesOverrideDefaultParam", Y));
// MULTIMEMBER ARRAY TYPES ON PARAM
// MARKER TYPE ON PARAMETER
// SINGLE-MEMBER SCALAR TYPES ON PARAMETER
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-OVERRIDE ON PARAMETER
checkSingleMemberBooleanOvrdDefParam(UnitTest.class.getMethod("SingleMemberBooleanOvrdDefParam", Y));
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-ACCEPT ON PARAMETER
checkSingleMemberShortAcceptDefParam(UnitTest.class.getMethod("SingleMemberShortAcceptDefParam", Y));
checkSingleMemberFloatAcceptDefParam(UnitTest.class.getMethod("SingleMemberFloatAcceptDefParam", Y));
checkSingleMemberDoubleAcceptDefParam(UnitTest.class.getMethod("SingleMemberDoubleAcceptDefParam", Y));
checkSingleMemberBooleanAcceptDefParam(UnitTest.class.getMethod("SingleMemberBooleanAcceptDefParam", Y));
checkSingleMemberStringAcceptDefParam(UnitTest.class.getMethod("SingleMemberStringAcceptDefParam", Y));
checkSingleMemberClassAcceptDefParam(UnitTest.class.getMethod("SingleMemberClassAcceptDefParam", Y));
// SINGLE-MEMBER ARRAY TYPES Param(UnitTest.class.getMethod("EMPTY ARRAY) ON PARAMETER
checkSingleMemberDoubleArrEmptyParam(UnitTest.class.getMethod("SingleMemberDoubleArrEmptyParam", Y));
checkSingleMemberBooleanArrEmptyParam(UnitTest.class.getMethod("SingleMemberBooleanArrEmptyParam", Y));
checkSingleMemberStringArrEmptyParam(UnitTest.class.getMethod("SingleMemberStringArrEmptyParam", Y));
// SINGLE-MEMBER ARRAY TYPES Param(UnitTest.class.getMethod("ONE-ELEMENT ARRAY) ON PARAMETER
// SINGLE-MEMBER ARRAY TYPES Param(UnitTest.class.getMethod("TWO-ELEMENT ARRAY) ON PARAMETER
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT Param(UnitTest.class.getMethod("OVERRIDE)ON PARAMETER
checkSingleMemberByteArrOvrdDefParam(UnitTest.class.getMethod("SingleMemberByteArrOvrdDefParam", Y));
checkSingleMemberShortArrOvrdDefParam(UnitTest.class.getMethod("SingleMemberShortArrOvrdDefParam", Y));
checkSingleMemberLongArrOvrdDefParam(UnitTest.class.getMethod("SingleMemberLongArrOvrdDefParam", Y));
checkSingleMemberCharArrOvrdDefParam(UnitTest.class.getMethod("SingleMemberCharArrOvrdDefParam", Y));
checkSingleMemberFloatArrOvrdDefParam(UnitTest.class.getMethod("SingleMemberFloatArrOvrdDefParam", Y));
checkSingleMemberDoubleArrOvrdDefParam(UnitTest.class.getMethod("SingleMemberDoubleArrOvrdDefParam", Y));
checkSingleMemberBooleanArrOvrdDefParam(UnitTest.class.getMethod("SingleMemberBooleanArrOvrdDefParam", Y));
checkSingleMemberStringArrOvrdDefParam(UnitTest.class.getMethod("SingleMemberStringArrOvrdDefParam", Y));
checkSingleMemberClassArrOvrdDefParam(UnitTest.class.getMethod("SingleMemberClassArrOvrdDefParam", Y));
checkSingleMemberEnumArrOvrdDefParam(UnitTest.class.getMethod("SingleMemberEnumArrOvrdDefParam", Y));
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT Param(UnitTest.class.getMethod("ACCEPT)ON PARAMETER
checkSingleMemberByteArrAcceptDefParam(UnitTest.class.getMethod("SingleMemberByteArrAcceptDefParam", Y));
checkSingleMemberShortArrAcceptDefParam(UnitTest.class.getMethod("SingleMemberShortArrAcceptDefParam", Y));
checkSingleMemberIntArrAcceptDefParam(UnitTest.class.getMethod("SingleMemberIntArrAcceptDefParam", Y));
checkSingleMemberLongArrAcceptDefParam(UnitTest.class.getMethod("SingleMemberLongArrAcceptDefParam", Y));
checkSingleMemberCharArrAcceptDefParam(UnitTest.class.getMethod("SingleMemberCharArrAcceptDefParam", Y));
checkSingleMemberFloatArrAcceptDefParam(UnitTest.class.getMethod("SingleMemberFloatArrAcceptDefParam", Y));
checkSingleMemberDoubleArrAcceptDefParam(UnitTest.class.getMethod("SingleMemberDoubleArrAcceptDefParam", Y));
checkSingleMemberBooleanArrAcceptDefParam(UnitTest.class.getMethod("SingleMemberBooleanArrAcceptDefParam", Y));
checkSingleMemberStringArrAcceptDefParam(UnitTest.class.getMethod("SingleMemberStringArrAcceptDefParam", Y));
checkSingleMemberClassArrAcceptDefParam(UnitTest.class.getMethod("SingleMemberClassArrAcceptDefParam", Y));
checkSingleMemberEnumArrAcceptDefParam(UnitTest.class.getMethod("SingleMemberEnumArrAcceptDefParam", Y));
// *** TESTS ON ANNOTATED CLASSES ***
// MULTIMEMBER SCALAR TYPES ON CLASS
checkScalarTypes(scalarTypesClass.class);
// MULTIMEMBER ARRAY TYPES ON CLASS
checkArrayTypes0(emptyArrayTypesClass.class);
// MARKER TYPE ON CLASS
checkMarker(markerClass.class);
// SINGLE-MEMBER SCALAR TYPES ON CLASS
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-OVERRIDE ON CLASS
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-ACCEPT ON CLASS
// SINGLE-MEMBER ARRAY TYPES (EMPTY ARRAY) ON CLASS
// SINGLE-MEMBER ARRAY TYPES (ONE-ELEMENT ARRAY) ON CLASS
// SINGLE-MEMBER ARRAY TYPES (TWO-ELEMENT ARRAY) ON CLASS
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (OVERRIDE)ON CLASS
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (ACCEPT)ON CLASS
// *** TESTS FOR EQUALS AND HASHCODE - POSITIVE
// MULTIMEMBER SCALAR TYPES
ScalarTypes.class);
checkEquals(scalarTypesOverrideDefaultClass.class, UnitTest.class.getField("scalarTypesOverrideDefaultField"),
ScalarTypesWithDefault.class);
checkEquals(scalarTypesAcceptDefaultClass.class, UnitTest.class.getField("scalarTypesAcceptDefaultField"),
ScalarTypesWithDefault.class);
// MULTIMEMBER ARRAY TYPES
ArrayTypes.class);
checkEquals(singleElementArrayTypesClass.class, UnitTest.class.getField("singleElementArrayTypesField"),
ArrayTypes.class);
ArrayTypes.class);
checkEquals(arrayTypesOverrideDefaultClass.class, UnitTest.class.getField("arrayTypesOverrideDefaultField"),
ArrayTypesWithDefault.class);
checkEquals(arrayTypesAcceptDefaultClass.class, UnitTest.class.getField("arrayTypesAcceptDefaultField"),
ArrayTypesWithDefault.class);
// MARKER TYPE
Marker.class);
// SINGLE-MEMBER SCALAR TYPES
SingleMemberByte.class);
SingleMemberShort.class);
SingleMemberInt.class);
SingleMemberLong.class);
SingleMemberChar.class);
SingleMemberFloat.class);
SingleMemberDouble.class);
SingleMemberBoolean.class);
SingleMemberString.class);
SingleMemberClass.class);
SingleMemberEnum.class);
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-OVERRIDE
checkEquals(SingleMemberByteOvrdDefClass.class, UnitTest.class.getField("SingleMemberByteOvrdDefField"),
SingleMemberByteWithDef.class);
checkEquals(SingleMemberShortOvrdDefClass.class, UnitTest.class.getField("SingleMemberShortOvrdDefField"),
SingleMemberShortWithDef.class);
checkEquals(SingleMemberIntOvrdDefClass.class, UnitTest.class.getField("SingleMemberIntOvrdDefField"),
SingleMemberIntWithDef.class);
checkEquals(SingleMemberLongOvrdDefClass.class, UnitTest.class.getField("SingleMemberLongOvrdDefField"),
SingleMemberLongWithDef.class);
checkEquals(SingleMemberCharOvrdDefClass.class, UnitTest.class.getField("SingleMemberCharOvrdDefField"),
SingleMemberCharWithDef.class);
checkEquals(SingleMemberFloatOvrdDefClass.class, UnitTest.class.getField("SingleMemberFloatOvrdDefField"),
SingleMemberFloatWithDef.class);
checkEquals(SingleMemberDoubleOvrdDefClass.class, UnitTest.class.getField("SingleMemberDoubleOvrdDefField"),
SingleMemberDoubleWithDef.class);
checkEquals(SingleMemberBooleanOvrdDefClass.class, UnitTest.class.getField("SingleMemberBooleanOvrdDefField"),
SingleMemberBooleanWithDef.class);
checkEquals(SingleMemberStringOvrdDefClass.class, UnitTest.class.getField("SingleMemberStringOvrdDefField"),
SingleMemberStringWithDef.class);
checkEquals(SingleMemberClassOvrdDefClass.class, UnitTest.class.getField("SingleMemberClassOvrdDefField"),
SingleMemberClassWithDef.class);
checkEquals(SingleMemberEnumOvrdDefClass.class, UnitTest.class.getField("SingleMemberEnumOvrdDefField"),
SingleMemberEnumWithDef.class);
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-ACCEPT
checkEquals(SingleMemberByteAcceptDefClass.class, UnitTest.class.getField("SingleMemberByteAcceptDefField"),
SingleMemberByteWithDef.class);
checkEquals(SingleMemberShortAcceptDefClass.class, UnitTest.class.getField("SingleMemberShortAcceptDefField"),
SingleMemberShortWithDef.class);
checkEquals(SingleMemberIntAcceptDefClass.class, UnitTest.class.getField("SingleMemberIntAcceptDefField"),
SingleMemberIntWithDef.class);
checkEquals(SingleMemberLongAcceptDefClass.class, UnitTest.class.getField("SingleMemberLongAcceptDefField"),
SingleMemberLongWithDef.class);
checkEquals(SingleMemberCharAcceptDefClass.class, UnitTest.class.getField("SingleMemberCharAcceptDefField"),
SingleMemberCharWithDef.class);
checkEquals(SingleMemberFloatAcceptDefClass.class, UnitTest.class.getField("SingleMemberFloatAcceptDefField"),
SingleMemberFloatWithDef.class);
checkEquals(SingleMemberDoubleAcceptDefClass.class, UnitTest.class.getField("SingleMemberDoubleAcceptDefField"),
SingleMemberDoubleWithDef.class);
checkEquals(SingleMemberBooleanAcceptDefClass.class, UnitTest.class.getField("SingleMemberBooleanAcceptDefField"),
SingleMemberBooleanWithDef.class);
checkEquals(SingleMemberStringAcceptDefClass.class, UnitTest.class.getField("SingleMemberStringAcceptDefField"),
SingleMemberStringWithDef.class);
checkEquals(SingleMemberClassAcceptDefClass.class, UnitTest.class.getField("SingleMemberClassAcceptDefField"),
SingleMemberClassWithDef.class);
checkEquals(SingleMemberEnumAcceptDefClass.class, UnitTest.class.getField("SingleMemberEnumAcceptDefField"),
SingleMemberEnumWithDef.class);
// SINGLE-MEMBER ARRAY TYPES (EMPTY ARRAY)
checkEquals(SingleMemberByteArrEmptyClass.class, UnitTest.class.getField("SingleMemberByteArrEmptyField"),
SingleMemberByteArray.class);
checkEquals(SingleMemberShortArrEmptyClass.class, UnitTest.class.getField("SingleMemberShortArrEmptyField"),
SingleMemberShortArray.class);
checkEquals(SingleMemberIntArrEmptyClass.class, UnitTest.class.getField("SingleMemberIntArrEmptyField"),
SingleMemberIntArray.class);
checkEquals(SingleMemberLongArrEmptyClass.class, UnitTest.class.getField("SingleMemberLongArrEmptyField"),
SingleMemberLongArray.class);
checkEquals(SingleMemberCharArrEmptyClass.class, UnitTest.class.getField("SingleMemberCharArrEmptyField"),
SingleMemberCharArray.class);
checkEquals(SingleMemberFloatArrEmptyClass.class, UnitTest.class.getField("SingleMemberFloatArrEmptyField"),
SingleMemberFloatArray.class);
checkEquals(SingleMemberDoubleArrEmptyClass.class, UnitTest.class.getField("SingleMemberDoubleArrEmptyField"),
SingleMemberDoubleArray.class);
checkEquals(SingleMemberBooleanArrEmptyClass.class, UnitTest.class.getField("SingleMemberBooleanArrEmptyField"),
SingleMemberBooleanArray.class);
checkEquals(SingleMemberStringArrEmptyClass.class, UnitTest.class.getField("SingleMemberStringArrEmptyField"),
SingleMemberStringArray.class);
checkEquals(SingleMemberClassArrEmptyClass.class, UnitTest.class.getField("SingleMemberClassArrEmptyField"),
SingleMemberClassArray.class);
checkEquals(SingleMemberEnumArrEmptyClass.class, UnitTest.class.getField("SingleMemberEnumArrEmptyField"),
SingleMemberEnumArray.class);
// SINGLE-MEMBER ARRAY TYPES (ONE-ELEMENT ARRAY)
checkEquals(SingleMemberByteArrOneClass.class, UnitTest.class.getField("SingleMemberByteArrOneField"),
SingleMemberByteArray.class);
checkEquals(SingleMemberShortArrOneClass.class, UnitTest.class.getField("SingleMemberShortArrOneField"),
SingleMemberShortArray.class);
checkEquals(SingleMemberIntArrOneClass.class, UnitTest.class.getField("SingleMemberIntArrOneField"),
SingleMemberIntArray.class);
checkEquals(SingleMemberLongArrOneClass.class, UnitTest.class.getField("SingleMemberLongArrOneField"),
SingleMemberLongArray.class);
checkEquals(SingleMemberCharArrOneClass.class, UnitTest.class.getField("SingleMemberCharArrOneField"),
SingleMemberCharArray.class);
checkEquals(SingleMemberFloatArrOneClass.class, UnitTest.class.getField("SingleMemberFloatArrOneField"),
SingleMemberFloatArray.class);
checkEquals(SingleMemberDoubleArrOneClass.class, UnitTest.class.getField("SingleMemberDoubleArrOneField"),
SingleMemberDoubleArray.class);
checkEquals(SingleMemberBooleanArrOneClass.class, UnitTest.class.getField("SingleMemberBooleanArrOneField"),
SingleMemberBooleanArray.class);
checkEquals(SingleMemberStringArrOneClass.class, UnitTest.class.getField("SingleMemberStringArrOneField"),
SingleMemberStringArray.class);
checkEquals(SingleMemberClassArrOneClass.class, UnitTest.class.getField("SingleMemberClassArrOneField"),
SingleMemberClassArray.class);
checkEquals(SingleMemberEnumArrOneClass.class, UnitTest.class.getField("SingleMemberEnumArrOneField"),
SingleMemberEnumArray.class);
// SINGLE-MEMBER ARRAY TYPES (TWO-ELEMENT ARRAY)
checkEquals(SingleMemberByteArrTwoClass.class, UnitTest.class.getField("SingleMemberByteArrTwoField"),
SingleMemberByteArray.class);
checkEquals(SingleMemberShortArrTwoClass.class, UnitTest.class.getField("SingleMemberShortArrTwoField"),
SingleMemberShortArray.class);
checkEquals(SingleMemberIntArrTwoClass.class, UnitTest.class.getField("SingleMemberIntArrTwoField"),
SingleMemberIntArray.class);
checkEquals(SingleMemberLongArrTwoClass.class, UnitTest.class.getField("SingleMemberLongArrTwoField"),
SingleMemberLongArray.class);
checkEquals(SingleMemberCharArrTwoClass.class, UnitTest.class.getField("SingleMemberCharArrTwoField"),
SingleMemberCharArray.class);
checkEquals(SingleMemberFloatArrTwoClass.class, UnitTest.class.getField("SingleMemberFloatArrTwoField"),
SingleMemberFloatArray.class);
checkEquals(SingleMemberDoubleArrTwoClass.class, UnitTest.class.getField("SingleMemberDoubleArrTwoField"),
SingleMemberDoubleArray.class);
checkEquals(SingleMemberBooleanArrTwoClass.class, UnitTest.class.getField("SingleMemberBooleanArrTwoField"),
SingleMemberBooleanArray.class);
checkEquals(SingleMemberStringArrTwoClass.class, UnitTest.class.getField("SingleMemberStringArrTwoField"),
SingleMemberStringArray.class);
checkEquals(SingleMemberClassArrTwoClass.class, UnitTest.class.getField("SingleMemberClassArrTwoField"),
SingleMemberClassArray.class);
checkEquals(SingleMemberEnumArrTwoClass.class, UnitTest.class.getField("SingleMemberEnumArrTwoField"),
SingleMemberEnumArray.class);
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (OVERRIDE)
checkEquals(SingleMemberByteArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberByteArrOvrdDefField"),
SingleMemberByteArrayDef.class);
checkEquals(SingleMemberShortArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberShortArrOvrdDefField"),
SingleMemberShortArrayDef.class);
checkEquals(SingleMemberIntArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberIntArrOvrdDefField"),
SingleMemberIntArrayDef.class);
checkEquals(SingleMemberLongArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberLongArrOvrdDefField"),
SingleMemberLongArrayDef.class);
checkEquals(SingleMemberCharArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberCharArrOvrdDefField"),
SingleMemberCharArrayDef.class);
checkEquals(SingleMemberFloatArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberFloatArrOvrdDefField"),
SingleMemberFloatArrayDef.class);
checkEquals(SingleMemberDoubleArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberDoubleArrOvrdDefField"),
SingleMemberDoubleArrayDef.class);
checkEquals(SingleMemberBooleanArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberBooleanArrOvrdDefField"),
SingleMemberBooleanArrayDef.class);
checkEquals(SingleMemberStringArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberStringArrOvrdDefField"),
SingleMemberStringArrayDef.class);
checkEquals(SingleMemberClassArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberClassArrOvrdDefField"),
SingleMemberClassArrayDef.class);
checkEquals(SingleMemberEnumArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberEnumArrOvrdDefField"),
SingleMemberEnumArrayDef.class);
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (ACCEPT)
checkEquals(SingleMemberByteArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberByteArrAcceptDefField"),
SingleMemberByteArrayDef.class);
checkEquals(SingleMemberShortArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberShortArrAcceptDefField"),
SingleMemberShortArrayDef.class);
checkEquals(SingleMemberIntArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberIntArrAcceptDefField"),
SingleMemberIntArrayDef.class);
checkEquals(SingleMemberLongArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberLongArrAcceptDefField"),
SingleMemberLongArrayDef.class);
checkEquals(SingleMemberCharArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberCharArrAcceptDefField"),
SingleMemberCharArrayDef.class);
checkEquals(SingleMemberFloatArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberFloatArrAcceptDefField"),
SingleMemberFloatArrayDef.class);
checkEquals(SingleMemberDoubleArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberDoubleArrAcceptDefField"),
SingleMemberDoubleArrayDef.class);
checkEquals(SingleMemberBooleanArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberBooleanArrAcceptDefField"),
SingleMemberBooleanArrayDef.class);
checkEquals(SingleMemberStringArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberStringArrAcceptDefField"),
SingleMemberStringArrayDef.class);
checkEquals(SingleMemberClassArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberClassArrAcceptDefField"),
SingleMemberClassArrayDef.class);
checkEquals(SingleMemberEnumArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberEnumArrAcceptDefField"),
SingleMemberEnumArrayDef.class);
// *** TESTS FOR EQUALS AND HASHCODE - NEGATIVE
// MULTIMEMBER SCALAR TYPES
checkUnequals(scalarTypesOverrideDefaultClass.class, UnitTest.class.getField("scalarTypesAcceptDefaultField"),
ScalarTypesWithDefault.class);
checkUnequals(scalarTypesAcceptDefaultClass.class, UnitTest.class.getField("scalarTypesOverrideDefaultField"),
ScalarTypesWithDefault.class);
// MULTIMEMBER ARRAY TYPES
ArrayTypes.class);
checkUnequals(singleElementArrayTypesClass.class, UnitTest.class.getField("twoElementArrayTypesField"),
ArrayTypes.class);
checkUnequals(twoElementArrayTypesClass.class, UnitTest.class.getField("singleElementArrayTypesField"),
ArrayTypes.class);
checkUnequals(arrayTypesOverrideDefaultClass.class, UnitTest.class.getField("arrayTypesAcceptDefaultField"),
ArrayTypesWithDefault.class);
checkUnequals(arrayTypesAcceptDefaultClass.class, UnitTest.class.getField("arrayTypesOverrideDefaultField"),
ArrayTypesWithDefault.class);
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-OVERRIDE
checkUnequals(SingleMemberByteOvrdDefClass.class, UnitTest.class.getField("SingleMemberByteAcceptDefField"),
SingleMemberByteWithDef.class);
checkUnequals(SingleMemberShortOvrdDefClass.class, UnitTest.class.getField("SingleMemberShortAcceptDefField"),
SingleMemberShortWithDef.class);
checkUnequals(SingleMemberIntOvrdDefClass.class, UnitTest.class.getField("SingleMemberIntAcceptDefField"),
SingleMemberIntWithDef.class);
checkUnequals(SingleMemberLongOvrdDefClass.class, UnitTest.class.getField("SingleMemberLongAcceptDefField"),
SingleMemberLongWithDef.class);
checkUnequals(SingleMemberCharOvrdDefClass.class, UnitTest.class.getField("SingleMemberCharAcceptDefField"),
SingleMemberCharWithDef.class);
checkUnequals(SingleMemberFloatOvrdDefClass.class, UnitTest.class.getField("SingleMemberFloatAcceptDefField"),
SingleMemberFloatWithDef.class);
checkUnequals(SingleMemberDoubleOvrdDefClass.class, UnitTest.class.getField("SingleMemberDoubleAcceptDefField"),
SingleMemberDoubleWithDef.class);
checkUnequals(SingleMemberBooleanOvrdDefClass.class, UnitTest.class.getField("SingleMemberBooleanAcceptDefField"),
SingleMemberBooleanWithDef.class);
checkUnequals(SingleMemberStringOvrdDefClass.class, UnitTest.class.getField("SingleMemberStringAcceptDefField"),
SingleMemberStringWithDef.class);
checkUnequals(SingleMemberClassOvrdDefClass.class, UnitTest.class.getField("SingleMemberClassAcceptDefField"),
SingleMemberClassWithDef.class);
checkUnequals(SingleMemberEnumOvrdDefClass.class, UnitTest.class.getField("SingleMemberEnumAcceptDefField"),
SingleMemberEnumWithDef.class);
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-ACCEPT
checkUnequals(SingleMemberByteAcceptDefClass.class, UnitTest.class.getField("SingleMemberByteOvrdDefField"),
SingleMemberByteWithDef.class);
checkUnequals(SingleMemberShortAcceptDefClass.class, UnitTest.class.getField("SingleMemberShortOvrdDefField"),
SingleMemberShortWithDef.class);
checkUnequals(SingleMemberIntAcceptDefClass.class, UnitTest.class.getField("SingleMemberIntOvrdDefField"),
SingleMemberIntWithDef.class);
checkUnequals(SingleMemberLongAcceptDefClass.class, UnitTest.class.getField("SingleMemberLongOvrdDefField"),
SingleMemberLongWithDef.class);
checkUnequals(SingleMemberCharAcceptDefClass.class, UnitTest.class.getField("SingleMemberCharOvrdDefField"),
SingleMemberCharWithDef.class);
checkUnequals(SingleMemberFloatAcceptDefClass.class, UnitTest.class.getField("SingleMemberFloatOvrdDefField"),
SingleMemberFloatWithDef.class);
checkUnequals(SingleMemberDoubleAcceptDefClass.class, UnitTest.class.getField("SingleMemberDoubleOvrdDefField"),
SingleMemberDoubleWithDef.class);
checkUnequals(SingleMemberBooleanAcceptDefClass.class, UnitTest.class.getField("SingleMemberBooleanOvrdDefField"),
SingleMemberBooleanWithDef.class);
checkUnequals(SingleMemberStringAcceptDefClass.class, UnitTest.class.getField("SingleMemberStringOvrdDefField"),
SingleMemberStringWithDef.class);
checkUnequals(SingleMemberClassAcceptDefClass.class, UnitTest.class.getField("SingleMemberClassOvrdDefField"),
SingleMemberClassWithDef.class);
checkUnequals(SingleMemberEnumAcceptDefClass.class, UnitTest.class.getField("SingleMemberEnumOvrdDefField"),
SingleMemberEnumWithDef.class);
// SINGLE-MEMBER ARRAY TYPES (EMPTY ARRAY)
checkUnequals(SingleMemberByteArrEmptyClass.class, UnitTest.class.getField("SingleMemberByteArrOneField"),
SingleMemberByteArray.class);
checkUnequals(SingleMemberShortArrEmptyClass.class, UnitTest.class.getField("SingleMemberShortArrOneField"),
SingleMemberShortArray.class);
checkUnequals(SingleMemberIntArrEmptyClass.class, UnitTest.class.getField("SingleMemberIntArrOneField"),
SingleMemberIntArray.class);
checkUnequals(SingleMemberLongArrEmptyClass.class, UnitTest.class.getField("SingleMemberLongArrOneField"),
SingleMemberLongArray.class);
checkUnequals(SingleMemberCharArrEmptyClass.class, UnitTest.class.getField("SingleMemberCharArrOneField"),
SingleMemberCharArray.class);
checkUnequals(SingleMemberFloatArrEmptyClass.class, UnitTest.class.getField("SingleMemberFloatArrOneField"),
SingleMemberFloatArray.class);
checkUnequals(SingleMemberDoubleArrEmptyClass.class, UnitTest.class.getField("SingleMemberDoubleArrOneField"),
SingleMemberDoubleArray.class);
checkUnequals(SingleMemberBooleanArrEmptyClass.class, UnitTest.class.getField("SingleMemberBooleanArrOneField"),
SingleMemberBooleanArray.class);
checkUnequals(SingleMemberStringArrEmptyClass.class, UnitTest.class.getField("SingleMemberStringArrOneField"),
SingleMemberStringArray.class);
checkUnequals(SingleMemberClassArrEmptyClass.class, UnitTest.class.getField("SingleMemberClassArrOneField"),
SingleMemberClassArray.class);
checkUnequals(SingleMemberEnumArrEmptyClass.class, UnitTest.class.getField("SingleMemberEnumArrOneField"),
SingleMemberEnumArray.class);
// SINGLE-MEMBER ARRAY TYPES (ONE-ELEMENT ARRAY)
checkUnequals(SingleMemberByteArrOneClass.class, UnitTest.class.getField("SingleMemberByteArrTwoField"),
SingleMemberByteArray.class);
checkUnequals(SingleMemberShortArrOneClass.class, UnitTest.class.getField("SingleMemberShortArrTwoField"),
SingleMemberShortArray.class);
checkUnequals(SingleMemberIntArrOneClass.class, UnitTest.class.getField("SingleMemberIntArrTwoField"),
SingleMemberIntArray.class);
checkUnequals(SingleMemberLongArrOneClass.class, UnitTest.class.getField("SingleMemberLongArrTwoField"),
SingleMemberLongArray.class);
checkUnequals(SingleMemberCharArrOneClass.class, UnitTest.class.getField("SingleMemberCharArrTwoField"),
SingleMemberCharArray.class);
checkUnequals(SingleMemberFloatArrOneClass.class, UnitTest.class.getField("SingleMemberFloatArrTwoField"),
SingleMemberFloatArray.class);
checkUnequals(SingleMemberDoubleArrOneClass.class, UnitTest.class.getField("SingleMemberDoubleArrTwoField"),
SingleMemberDoubleArray.class);
checkUnequals(SingleMemberBooleanArrOneClass.class, UnitTest.class.getField("SingleMemberBooleanArrTwoField"),
SingleMemberBooleanArray.class);
checkUnequals(SingleMemberStringArrOneClass.class, UnitTest.class.getField("SingleMemberStringArrTwoField"),
SingleMemberStringArray.class);
checkUnequals(SingleMemberClassArrOneClass.class, UnitTest.class.getField("SingleMemberClassArrTwoField"),
SingleMemberClassArray.class);
checkUnequals(SingleMemberEnumArrOneClass.class, UnitTest.class.getField("SingleMemberEnumArrTwoField"),
SingleMemberEnumArray.class);
// SINGLE-MEMBER ARRAY TYPES (TWO-ELEMENT ARRAY)
checkUnequals(SingleMemberByteArrTwoClass.class, UnitTest.class.getField("SingleMemberByteArrOneField"),
SingleMemberByteArray.class);
checkUnequals(SingleMemberShortArrTwoClass.class, UnitTest.class.getField("SingleMemberShortArrOneField"),
SingleMemberShortArray.class);
checkUnequals(SingleMemberIntArrTwoClass.class, UnitTest.class.getField("SingleMemberIntArrOneField"),
SingleMemberIntArray.class);
checkUnequals(SingleMemberLongArrTwoClass.class, UnitTest.class.getField("SingleMemberLongArrOneField"),
SingleMemberLongArray.class);
checkUnequals(SingleMemberCharArrTwoClass.class, UnitTest.class.getField("SingleMemberCharArrOneField"),
SingleMemberCharArray.class);
checkUnequals(SingleMemberFloatArrTwoClass.class, UnitTest.class.getField("SingleMemberFloatArrOneField"),
SingleMemberFloatArray.class);
checkUnequals(SingleMemberDoubleArrTwoClass.class, UnitTest.class.getField("SingleMemberDoubleArrOneField"),
SingleMemberDoubleArray.class);
checkUnequals(SingleMemberBooleanArrTwoClass.class, UnitTest.class.getField("SingleMemberBooleanArrOneField"),
SingleMemberBooleanArray.class);
checkUnequals(SingleMemberStringArrTwoClass.class, UnitTest.class.getField("SingleMemberStringArrOneField"),
SingleMemberStringArray.class);
checkUnequals(SingleMemberClassArrTwoClass.class, UnitTest.class.getField("SingleMemberClassArrOneField"),
SingleMemberClassArray.class);
checkUnequals(SingleMemberEnumArrTwoClass.class, UnitTest.class.getField("SingleMemberEnumArrOneField"),
SingleMemberEnumArray.class);
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (OVERRIDE)
checkUnequals(SingleMemberByteArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberByteArrAcceptDefField"),
SingleMemberByteArrayDef.class);
checkUnequals(SingleMemberShortArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberShortArrAcceptDefField"),
SingleMemberShortArrayDef.class);
checkUnequals(SingleMemberIntArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberIntArrAcceptDefField"),
SingleMemberIntArrayDef.class);
checkUnequals(SingleMemberLongArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberLongArrAcceptDefField"),
SingleMemberLongArrayDef.class);
checkUnequals(SingleMemberCharArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberCharArrAcceptDefField"),
SingleMemberCharArrayDef.class);
checkUnequals(SingleMemberFloatArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberFloatArrAcceptDefField"),
SingleMemberFloatArrayDef.class);
checkUnequals(SingleMemberDoubleArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberDoubleArrAcceptDefField"),
SingleMemberDoubleArrayDef.class);
checkUnequals(SingleMemberBooleanArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberBooleanArrAcceptDefField"),
SingleMemberBooleanArrayDef.class);
checkUnequals(SingleMemberStringArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberStringArrAcceptDefField"),
SingleMemberStringArrayDef.class);
checkUnequals(SingleMemberClassArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberClassArrAcceptDefField"),
SingleMemberClassArrayDef.class);
checkUnequals(SingleMemberEnumArrOvrdDefClass.class, UnitTest.class.getField("SingleMemberEnumArrAcceptDefField"),
SingleMemberEnumArrayDef.class);
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (ACCEPT)
checkUnequals(SingleMemberByteArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberByteArrOvrdDefField"),
SingleMemberByteArrayDef.class);
checkUnequals(SingleMemberShortArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberShortArrOvrdDefField"),
SingleMemberShortArrayDef.class);
checkUnequals(SingleMemberIntArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberIntArrOvrdDefField"),
SingleMemberIntArrayDef.class);
checkUnequals(SingleMemberLongArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberLongArrOvrdDefField"),
SingleMemberLongArrayDef.class);
checkUnequals(SingleMemberCharArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberCharArrOvrdDefField"),
SingleMemberCharArrayDef.class);
checkUnequals(SingleMemberFloatArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberFloatArrOvrdDefField"),
SingleMemberFloatArrayDef.class);
checkUnequals(SingleMemberDoubleArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberDoubleArrOvrdDefField"),
SingleMemberDoubleArrayDef.class);
checkUnequals(SingleMemberBooleanArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberBooleanArrOvrdDefField"),
SingleMemberBooleanArrayDef.class);
checkUnequals(SingleMemberStringArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberStringArrOvrdDefField"),
SingleMemberStringArrayDef.class);
checkUnequals(SingleMemberClassArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberClassArrOvrdDefField"),
SingleMemberClassArrayDef.class);
checkUnequals(SingleMemberEnumArrAcceptDefClass.class, UnitTest.class.getField("SingleMemberEnumArrOvrdDefField"),
SingleMemberEnumArrayDef.class);
// *** TESTS FOR SERIALIZATION AND DESERIALIZATION
// MULTIMEMBER SCALAR TYPES
// MULTIMEMBER ARRAY TYPES
// MARKER TYPE
// SINGLE-MEMBER SCALAR TYPES
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-OVERRIDE
// SINGLE-MEMBER SCALAR TYPES WITH DEFAULT-ACCEPT
// SINGLE-MEMBER ARRAY TYPES (EMPTY ARRAY)
// SINGLE-MEMBER ARRAY TYPES (ONE-ELEMENT ARRAY)
// SINGLE-MEMBER ARRAY TYPES (TWO-ELEMENT ARRAY)
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (OVERRIDE)
// SINGLE-MEMBER ARRAY TYPES WITH DEFAULT (ACCEPT)
// *** TESTS FOR ANNOTATION INHERITANCE AND ENUMERATING DECLARED ANNOTATIONS
// Inheritance tests
checkInheritence(Grandpa.class, true, true);
checkInheritence(Dad.class, true, false);
checkInheritence(Son.class, true, true);
// Declared annotations tests
checkDeclaredAnnotations(Grandpa.class, true, true);
checkDeclaredAnnotations(Dad.class, false, false);
checkDeclaredAnnotations(Son.class, false, true);
// Generate summary
if (failCount != 0)
else
}
failCount++;
}
// ANNOTATION-VERIFICATION METHODS
// Scalar multi-member
try {
} catch(Throwable t) {
t.printStackTrace();
}
}
numTests++;
if (!(st.b() == 1 &&
st.s() == 2 &&
st.i() == 3 &&
st.l() == 4L &&
st.c() == '5' &&
st.f() == 6.0f &&
st.d() == 7.0 &&
fail("ScalarTypes" + e);
}
try {
} catch(Throwable t) {
}
}
numTests++;
if (!(st.b() == 1 &&
st.s() == 2 &&
st.i() == 3 &&
st.l() == 4L &&
st.c() == '5' &&
st.f() == 6.0f &&
st.d() == 7.0 &&
fail("ScalarTypesOverrideDefaults" + e);
}
try {
} catch(Throwable t) {
}
}
numTests++;
if (!(st.b() == 11 &&
st.s() == 12 &&
st.i() == 13 &&
st.l() == 14L &&
st.c() == 'V' &&
st.f() == 16.0f &&
st.d() == 17.0 &&
fail("ScalarTypesAcceptDefaults" + e);
}
// Array multi-member
try {
} catch(Throwable t) {
}
}
numTests++;
fail("ArrayTypes(Empty)" + e);
}
}
try {
} catch(Throwable t) {
}
}
numTests++;
fail("ArrayTypes(One element)" + e);
}
try {
} catch(Throwable t) {
}
}
numTests++;
fail("ArrayTypes(Two element)" + e);
}
try {
} catch(Throwable t) {
}
}
numTests++;
fail("ArrayTypesOverrideDefault" + e);
}
try {
} catch(Throwable t) {
}
}
numTests++;
fail("ArrayTypesAcceptDefault" + e);
}
// Scalar multi-member for parameters
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
// Array multi-member for parameters
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
// marker type on parameter
try {
} catch(Throwable t) {
}
}
// single-member scalar types on parameter
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
// single-member scalar types with default-override on parameter
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
// single-member scalar types with default-accept on PARAMETER
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
checkSingleMemberBooleanAcceptDef((SingleMemberBooleanWithDef) m.getParameterAnnotations()[0][0], m);
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
// single-member array types (empty array) parameter
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
// single-member array types (one-element array) on parameter
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
// single-member array types (two-element array) on parameter
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
// single-member array types with default (override)on parameter
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
checkSingleMemberDoubleArrOvrdDef((SingleMemberDoubleArrayDef) m.getParameterAnnotations()[0][0], m);
} catch(Throwable t) {
}
}
try {
checkSingleMemberBooleanArrOvrdDef((SingleMemberBooleanArrayDef) m.getParameterAnnotations()[0][0], m);
} catch(Throwable t) {
}
}
try {
checkSingleMemberStringArrOvrdDef((SingleMemberStringArrayDef) m.getParameterAnnotations()[0][0], m);
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
// single-member array types with default (accept)on parameter
try {
} catch(Throwable t) {
}
}
try {
checkSingleMemberShortArrAcceptDef((SingleMemberShortArrayDef) m.getParameterAnnotations()[0][0], m);
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
try {
checkSingleMemberFloatArrAcceptDef((SingleMemberFloatArrayDef) m.getParameterAnnotations()[0][0], m);
} catch(Throwable t) {
}
}
try {
checkSingleMemberDoubleArrAcceptDef((SingleMemberDoubleArrayDef) m.getParameterAnnotations()[0][0], m);
} catch(Throwable t) {
}
}
try {
checkSingleMemberBooleanArrAcceptDef((SingleMemberBooleanArrayDef) m.getParameterAnnotations()[0][0], m);
} catch(Throwable t) {
}
}
try {
checkSingleMemberStringArrAcceptDef((SingleMemberStringArrayDef) m.getParameterAnnotations()[0][0], m);
} catch(Throwable t) {
}
}
try {
checkSingleMemberClassArrAcceptDef((SingleMemberClassArrayDef) m.getParameterAnnotations()[0][0], m);
} catch(Throwable t) {
}
}
try {
} catch(Throwable t) {
}
}
// Marker
}
numTests++;
try {
} catch(Throwable t) {
}
}
// Single-member
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
// Single-member with default (Override)
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
// Single-member with default (Accept)
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
// Single member array (empty array)
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
// Single member array (one element array)
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
// Single member array (two element array)
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
// Single member array with default (override)
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
// Single member array with default (accept)
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
static void checkSingleMemberBooleanArrAcceptDef(SingleMemberBooleanArrayDef a, AnnotatedElement e) {
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
}
numTests++;
try {
} catch(Throwable t) {
}
}
// Verfification methods for equals/hashCode/serialization
static <T extends Annotation> void checkEquals(AnnotatedElement e1, AnnotatedElement e2, Class<T> annoType) {
numTests++;
try {
} catch(Throwable t) {
}
}
static <T extends Annotation> void checkUnequals(AnnotatedElement e1, AnnotatedElement e2, Class<T> annoType) {
numTests++;
try {
} catch(Throwable t) {
}
}
// Verfification method for serialization/deserialization
numTests++;
try {
fail("Serialization: " + a1 + ".hashCode() [" + a1.hashCode() + "] != " + a2 + " .hashCode()["+a2.hashCode()+"]");
} catch(Throwable t) {
}
}
try {
bos.toByteArray());
return ois.readObject();
} catch(Exception e) {
throw new IllegalArgumentException(e);
}
}
// Verification method for inheritance test
numTests++;
try {
// Now test getAnnotations
for (Annotation a : allAnnotations) {
if (a instanceof Foo)
hasFoo = true;
else if (a instanceof Bar)
hasBar = true;
}
} catch(Throwable t) {
}
}
// Verification method for declared annotations test
static void checkDeclaredAnnotations(AnnotatedElement e, boolean shouldHaveFoo, boolean shouldHaveBar) {
numTests++;
try {
boolean hasFoo = false;
boolean hasBar = false;
for (Annotation a : declaredAnnotations) {
if (a instanceof Foo)
hasFoo = true;
else if (a instanceof Bar)
hasBar = true;
}
} catch(Throwable t) {
}
}
// ANNOTATED METHODS
@ScalarTypes (
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
public void scalarTypesMethod() { }
public void scalarTypesAcceptDefaultMethod() { }
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
public void scalarTypesOverrideDefaultMethod() { }
@ArrayTypes (
b = { },
s = { },
i = { },
l = { },
c = { },
f = { },
d = { },
bool = { },
str = { },
cls = { },
e = { },
a = { }
)
public void emptyArrayTypesMethod() { }
@ArrayTypes (
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
public void singleElementArrayTypesMethod() { }
@ArrayTypes (
b = { 1, 2 },
s = { 2, 3 },
i = { 3, 4 },
l = { 4L, 5L },
c = { '5', '6' },
f = { 6.0f, 7.0f },
d = { 7.0, 8.0 },
bool = { true, false },
)
public void twoElementArrayTypesMethod() { }
)
public void arrayTypesAcceptDefaultMethod() { }
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
public void arrayTypesOverrideDefaultMethod() { }
// Marker
// Single-member (shorthand)
// Single-member with default (Override)
// Single-member with default (Accept)
// Single member array (empty array)
// Single member array (one-element shorthand)
// Single member array (two elements)
// Single member array with default (override)
// Single member array with default - accept
// ANNOTATED FIELDS
@ScalarTypes (
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
public int scalarTypesField;
public int scalarTypesAcceptDefaultField;
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
public int scalarTypesOverrideDefaultField;
@ArrayTypes (
b = { },
s = { },
i = { },
l = { },
c = { },
f = { },
d = { },
bool = { },
str = { },
cls = { },
e = { },
a = { }
)
public int emptyArrayTypesField;
@ArrayTypes (
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
public int singleElementArrayTypesField;
@ArrayTypes (
b = { 1, 2 },
s = { 2, 3 },
i = { 3, 4 },
l = { 4L, 5L },
c = { '5', '6' },
f = { 6.0f, 7.0f },
d = { 7.0, 8.0 },
bool = { true, false },
)
public int twoElementArrayTypesField;
public int arrayTypesAcceptDefaultField;
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
public int arrayTypesOverrideDefaultField;
// Single-member (shorthand)
// Single-member with default (Override)
// Single-member with default (Accept)
// Single member array (empty array)
// Single member array (one-element shorthand)
// Single member array (two elements)
// Single member array with default (override)
// Single member array with default - accept
// ANNOTATED ENUM CONSTANTS
enum TestType {
@ScalarTypes (
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
@ArrayTypes (
b = { },
s = { },
i = { },
l = { },
c = { },
f = { },
d = { },
bool = { },
str = { },
cls = { },
e = { },
a = { }
)
@ArrayTypes (
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
@ArrayTypes (
b = { 1, 2 },
s = { 2, 3 },
i = { 3, 4 },
l = { 4L, 5L },
c = { '5', '6' },
f = { 6.0f, 7.0f },
d = { 7.0, 8.0 },
bool = { true, false },
)
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
// marker
// Single-member (shorthand)
// Single-member with default (Override)
// Single-member with default (Accept)
// Single member array (empty array)
// Single member array (one-element shorthand)
// Single member array (two elements)
// Single member array with default (override)
// Single member array with default - accept
}
// ANNOTATED CONSTRUCTORS
@ScalarTypes (
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
@ArrayTypes (
b = { },
s = { },
i = { },
l = { },
c = { },
f = { },
d = { },
bool = { },
str = { },
cls = { },
e = { },
a = { }
)
@ArrayTypes (
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
@ArrayTypes (
b = { 1, 2 },
s = { 2, 3 },
i = { 3, 4 },
l = { 4L, 5L },
c = { '5', '6' },
f = { 6.0f, 7.0f },
d = { 7.0, 8.0 },
bool = { true, false },
)
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
// Marker
// Single-member (shorthand)
// Single-member with default (Override)
// Single-member with default (Accept)
// Single member array (empty array)
// Single member array (one-element shorthand)
// Single member array (two elements)
// Single member array with default (override)
// Single member array with default - accept
// ANNOTATED PARAMETERS
public void scalarTypesParam(
@ScalarTypes (
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
int x) { }
public void scalarTypesAcceptDefaultParam(
@ScalarTypesWithDefault int x) { }
public void scalarTypesOverrideDefaultParam(
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
int x) { }
public void emptyArrayTypesParam(
@ArrayTypes (
b = { },
s = { },
i = { },
l = { },
c = { },
f = { },
d = { },
bool = { },
str = { },
cls = { },
e = { },
a = { }
)
int x) { }
public void singleElementArrayTypesParam(
@ArrayTypes (
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
int x) { }
public void twoElementArrayTypesParam(
@ArrayTypes (
b = { 1, 2 },
s = { 2, 3 },
i = { 3, 4 },
l = { 4L, 5L },
c = { '5', '6' },
f = { 6.0f, 7.0f },
d = { 7.0, 8.0 },
bool = { true, false },
)
int x) { }
public void arrayTypesAcceptDefaultParam(
int x) { }
public void arrayTypesOverrideDefaultParam(
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
int x) { }
// Marker
// Single-member (shorthand)
// Single-member with default (Override)
// Single-member with default (Accept)
// Single member array (empty array)
// Single member array (one-element shorthand)
// Single member array (two elements)
public void SingleMemberEnumArrTwoParam(@SingleMemberEnumArray({Stooge.MOE, Stooge.CURLY}) int x) {}
// Single member array with default (override)
// Single member array with default - accept
}
// Helper types
// ANNOTATION TYPES
byte b();
short s();
int i();
long l();
char c();
float f();
double d();
boolean bool();
Stooge e();
Point a();
}
byte b() default 11;
short s() default 12;
int i() default 13;
long l() default 14;
char c() default 'V';
float f() default 16.0f;
double d() default 17.0;
boolean bool() default false;
}
byte[] b();
short[] s();
int[] i();
long[] l();
char[] c();
float[] f();
double[] d();
boolean[] bool();
Stooge[] e();
Point[] a();
}
byte[] b() default { 11 };
short[] s() default { 12 };
int[] i() default { 13 };
long[] l() default { 14L };
char[] c() default { 'V' };
float[] f() default { 16.0f };
double[] d() default { 17.0 };
boolean[] bool() default { false };
}
}
}
}
// Annotation types for inheritance and declared-annotations tests
// ANNOTATED CLASSES
@ScalarTypes (
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
class scalarTypesClass { }
class scalarTypesAcceptDefaultClass { }
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
class scalarTypesOverrideDefaultClass { }
@ArrayTypes (
b = { },
s = { },
i = { },
l = { },
c = { },
f = { },
d = { },
bool = { },
str = { },
cls = { },
e = { },
a = { }
)
class emptyArrayTypesClass { }
@ArrayTypes (
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
class singleElementArrayTypesClass { }
@ArrayTypes (
b = { 1, 2 },
s = { 2, 3 },
i = { 3, 4 },
l = { 4L, 5L },
c = { '5', '6' },
f = { 6.0f, 7.0f },
d = { 7.0, 8.0 },
bool = { true, false },
)
class twoElementArrayTypesClass { }
)
class arrayTypesAcceptDefaultClass { }
b = 1,
s = 2,
i = 3,
l = 4L,
c = '5',
f = 6.0f,
d = 7.0,
bool = true,
str = "custom",
)
class arrayTypesOverrideDefaultClass { }
// Single-member (shorthand)
// Single-member with default (Override)
// Single-member with default (Accept)
// Single member array (empty array)
// Single member array (one-element shorthand)
// Single member array (two elements)
// Single member array with default (override)
// Single member array with default - accept
// Annotated classes for inheritance and declared-annotations tests