Class_getField01.java revision 12651:6ef01bd40ce2
11556Srgrimes/* 21556Srgrimes * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. 31556Srgrimes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 41556Srgrimes * 51556Srgrimes * This code is free software; you can redistribute it and/or modify it 61556Srgrimes * under the terms of the GNU General Public License version 2 only, as 71556Srgrimes * published by the Free Software Foundation. 81556Srgrimes * 91556Srgrimes * This code is distributed in the hope that it will be useful, but WITHOUT 101556Srgrimes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 111556Srgrimes * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 121556Srgrimes * version 2 for more details (a copy is included in the LICENSE file that 131556Srgrimes * accompanied this code). 141556Srgrimes * 151556Srgrimes * You should have received a copy of the GNU General Public License version 161556Srgrimes * 2 along with this work; if not, write to the Free Software Foundation, 171556Srgrimes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 181556Srgrimes * 191556Srgrimes * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 201556Srgrimes * or visit www.oracle.com if you need additional information or have any 211556Srgrimes * questions. 221556Srgrimes */ 231556Srgrimespackage org.graalvm.compiler.jtt.reflect; 241556Srgrimes 251556Srgrimesimport org.junit.Test; 261556Srgrimes 271556Srgrimesimport org.graalvm.compiler.jtt.JTTTest; 281556Srgrimes 291556Srgrimes/* 30114433Sobrien */ 311556Srgrimespublic class Class_getField01 extends JTTTest { 3227959Ssteve 331556Srgrimes public static String field; 341556Srgrimes public String field2; 3527964Ssteve String field3; 3627964Ssteve 3727964Ssteve public static String test(String input) throws NoSuchFieldException { 3827964Ssteve return Class_getField01.class.getField(input).getName(); 39114433Sobrien } 4027964Ssteve 4199110Sobrien @Test 4299110Sobrien public void run0() throws Throwable { 431556Srgrimes runTest("test", "test"); 441556Srgrimes } 4547584Skris 4647584Skris @Test 471556Srgrimes public void run1() throws Throwable { 481556Srgrimes runTest("test", "field"); 491556Srgrimes } 501556Srgrimes 511556Srgrimes @Test 5290644Simp public void run2() throws Throwable { 5390644Simp runTest("test", "field2"); 54241014Smdf } 551556Srgrimes 561556Srgrimes @Test 571556Srgrimes public void run3() throws Throwable { 5850539Smharo runTest("test", "field3"); 591556Srgrimes } 601556Srgrimes 61226961Sed} 62249948Seadler