AsJavaTypeDataProvider.java revision 11707:ad7af1afda7a
1/*
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24package jdk.vm.ci.hotspot.test;
25
26import jdk.vm.ci.meta.JavaConstant;
27import org.testng.annotations.DataProvider;
28
29import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
30import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
31
32public class AsJavaTypeDataProvider {
33
34    @DataProvider(name = "asJavaTypeDataProvider")
35    public static Object[][] asJavaTypeDataProvider() {
36        return new Object[][]{
37                        {CONSTANT_REFLECTION_PROVIDER.forObject(DummyClass.class),
38                                        "jdk.vm.ci.hotspot.test.DummyClass"},
39                        {CONSTANT_REFLECTION_PROVIDER.forObject(boolean.class), "boolean"},
40                        {CONSTANT_REFLECTION_PROVIDER.forObject(byte.class), "byte"},
41                        {CONSTANT_REFLECTION_PROVIDER.forObject(short.class), "short"},
42                        {CONSTANT_REFLECTION_PROVIDER.forObject(char.class), "char"},
43                        {CONSTANT_REFLECTION_PROVIDER.forObject(int.class), "int"},
44                        {CONSTANT_REFLECTION_PROVIDER.forObject(long.class), "long"},
45                        {CONSTANT_REFLECTION_PROVIDER.forObject(float.class), "float"},
46                        {CONSTANT_REFLECTION_PROVIDER.forObject(double.class), "double"},
47                        {CONSTANT_REFLECTION_PROVIDER.forObject(Object.class), "java.lang.Object"},
48                        {CONSTANT_REFLECTION_PROVIDER.forObject(boolean[].class), "boolean[]"},
49                        {CONSTANT_REFLECTION_PROVIDER.forObject(boolean[][].class), "boolean[][]"},
50                        {CONSTANT_REFLECTION_PROVIDER.forObject(Object[].class), "java.lang.Object[]"},
51                        {CONSTANT_REFLECTION_PROVIDER.forObject(Object[][].class), "java.lang.Object[][]"},
52                        {JavaConstant.forBoolean(DUMMY_CLASS_INSTANCE.booleanField), null},
53                        {CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.objectField), null},
54                        {CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE), null},
55                        {CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.booleanArrayWithValues), null},
56                        {CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.booleanArrayArrayWithValues), null},
57                        {JavaConstant.NULL_POINTER, null}, {null, null}};
58    }
59}
60