Mercurial > hg > truffle
comparison graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_forName05.java @ 7282:390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
the HP_series and FloatingReads tests have been disabled temporarily
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 20 Dec 2012 14:59:57 +0100 |
parents | e808627bd16f |
children | c38d2870439e |
comparison
equal
deleted
inserted
replaced
7281:e960cda050d7 | 7282:390448a6b535 |
---|---|
22 */ | 22 */ |
23 package com.oracle.graal.jtt.lang; | 23 package com.oracle.graal.jtt.lang; |
24 | 24 |
25 import java.net.*; | 25 import java.net.*; |
26 | 26 |
27 import com.oracle.graal.jtt.*; | |
27 import org.junit.*; | 28 import org.junit.*; |
28 | 29 |
29 /* | 30 /* |
30 */ | 31 */ |
31 @SuppressWarnings("static-method") | 32 public final class Class_forName05 extends JTTTest { |
32 public final class Class_forName05 { | |
33 | 33 |
34 public static String test(int i) throws ClassNotFoundException { | 34 public static String test(int i) throws ClassNotFoundException { |
35 final URLClassLoader classLoader = new URLClassLoader(new URL[0], String.class.getClassLoader()); | 35 final URLClassLoader classLoader = new URLClassLoader(new URL[0], String.class.getClassLoader()); |
36 if (i == 0) { | 36 if (i == 0) { |
37 return Class.forName("java.lang.String", false, classLoader).toString(); | 37 return Class.forName("java.lang.String", false, classLoader).toString(); |
41 return null; | 41 return null; |
42 } | 42 } |
43 | 43 |
44 @Test | 44 @Test |
45 public void run0() throws Throwable { | 45 public void run0() throws Throwable { |
46 Assert.assertEquals("class java.lang.String", test(0)); | 46 runTest("test", 0); |
47 } | 47 } |
48 | 48 |
49 @Test | 49 @Test |
50 public void run1() throws Throwable { | 50 public void run1() throws Throwable { |
51 Assert.assertEquals("class [Ljava.lang.String;", test(1)); | 51 runTest("test", 1); |
52 } | 52 } |
53 | 53 |
54 @Test | 54 @Test |
55 public void run2() throws Throwable { | 55 public void run2() throws Throwable { |
56 Assert.assertEquals(null, test(5)); | 56 runTest("test", 5); |
57 } | 57 } |
58 | 58 |
59 } | 59 } |