Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/LazyClassLoadingTest.java @ 18778:cb3bdd77c809
Truffle-DSL: fixed class loading test.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 05 Jan 2015 12:39:27 +0100 |
parents | 15fe16c45d64 |
children | b1530a6cce8c |
comparison
equal
deleted
inserted
replaced
18777:76cbf5f33f82 | 18778:cb3bdd77c809 |
---|---|
40 | 40 |
41 NodeFactory<TestNode> factory = TestNodeFactory.getInstance(); | 41 NodeFactory<TestNode> factory = TestNodeFactory.getInstance(); |
42 Assert.assertTrue(isLoaded(factoryName)); | 42 Assert.assertTrue(isLoaded(factoryName)); |
43 Assert.assertTrue(isLoaded(nodeName)); | 43 Assert.assertTrue(isLoaded(nodeName)); |
44 | 44 |
45 Assert.assertFalse(isLoaded(nodeName + "$UninitializedNode")); | 45 Assert.assertFalse(isLoaded(nodeName + "$UninitializedNode_")); |
46 Assert.assertFalse(isLoaded(nodeName + "$BaseNode")); | 46 Assert.assertFalse(isLoaded(nodeName + "$BaseNode_")); |
47 Assert.assertFalse(isLoaded(nodeName + "$DoInt0Node")); | 47 Assert.assertFalse(isLoaded(nodeName + "$IntNode_")); |
48 Assert.assertFalse(isLoaded(nodeName + "$DoBoolean0Node")); | 48 Assert.assertFalse(isLoaded(nodeName + "$BooleanNode_")); |
49 Assert.assertFalse(isLoaded(nodeName + "$PolymorphicNode")); | 49 Assert.assertFalse(isLoaded(nodeName + "$PolymorphicNode_")); |
50 | 50 |
51 TestRootNode<TestNode> root = TestHelper.createRoot(factory); | 51 TestRootNode<TestNode> root = TestHelper.createRoot(factory); |
52 | 52 |
53 Assert.assertTrue(isLoaded(nodeName + "$BaseNode")); | 53 Assert.assertTrue(isLoaded(nodeName + "$UninitializedNode_")); |
54 Assert.assertTrue(isLoaded(nodeName + "$UninitializedNode")); | 54 Assert.assertTrue(isLoaded(nodeName + "$BaseNode_")); |
55 Assert.assertFalse(isLoaded(nodeName + "$DoInt0Node")); | 55 Assert.assertFalse(isLoaded(nodeName + "$IntNode_")); |
56 Assert.assertFalse(isLoaded(nodeName + "$DoBoolean0Node")); | 56 Assert.assertFalse(isLoaded(nodeName + "$BooleanNode_")); |
57 Assert.assertFalse(isLoaded(nodeName + "$PolymorphicNode")); | 57 Assert.assertFalse(isLoaded(nodeName + "$PolymorphicNode_")); |
58 | 58 |
59 Assert.assertEquals(42, TestHelper.executeWith(root, 42)); | 59 Assert.assertEquals(42, TestHelper.executeWith(root, 42)); |
60 | 60 |
61 Assert.assertTrue(isLoaded(nodeName + "$DoInt0Node")); | 61 Assert.assertTrue(isLoaded(nodeName + "$IntNode_")); |
62 Assert.assertFalse(isLoaded(nodeName + "$DoBoolean0Node")); | 62 Assert.assertFalse(isLoaded(nodeName + "$BooleanNode_")); |
63 Assert.assertFalse(isLoaded(nodeName + "$PolymorphicNode")); | 63 Assert.assertFalse(isLoaded(nodeName + "$PolymorphicNode_")); |
64 | 64 |
65 Assert.assertEquals(true, TestHelper.executeWith(root, true)); | 65 Assert.assertEquals(true, TestHelper.executeWith(root, true)); |
66 | 66 |
67 Assert.assertTrue(isLoaded(nodeName + "$DoInt0Node")); | 67 Assert.assertTrue(isLoaded(nodeName + "$IntNode_")); |
68 Assert.assertTrue(isLoaded(nodeName + "$DoBoolean0Node")); | 68 Assert.assertTrue(isLoaded(nodeName + "$BooleanNode_")); |
69 Assert.assertTrue(isLoaded(nodeName + "$PolymorphicNode")); | 69 Assert.assertTrue(isLoaded(nodeName + "$PolymorphicNode_")); |
70 } | 70 } |
71 | 71 |
72 private boolean isLoaded(String className) { | 72 private boolean isLoaded(String className) { |
73 ClassLoader classLoader = getClass().getClassLoader(); | 73 ClassLoader classLoader = getClass().getClassLoader(); |
74 Method m; | 74 Method m; |