1 8 package test.optimizations; 9 10 import junit.framework.TestCase; 11 12 15 public class OptimizeTest extends TestCase { 16 17 private static String s_log = ""; 18 19 public static void log(String s) { 20 s_log += s + " "; 21 } 22 23 58 public void testRtti() { 59 s_log = ""; 60 IOptimize target = new OptimizeRtti(); 61 target.before(); 62 target.around(); 63 target.beforeAround(); 64 target.before(0); 65 target.around(0); 66 } 67 68 public static interface IOptimize { 69 public void before(); 70 public void around(); 71 public void beforeAround(); 72 public void before(int arg); 73 public void around(int arg); 74 } 75 76 public static class OptimizeNothing implements IOptimize { 77 78 public void before() { 79 } 80 81 public void around() { 82 } 83 84 public void beforeAround() { 85 } 86 87 public void before(int arg) { 88 } 89 90 public void around(int arg) { 91 } 92 } 93 94 public static class OptimizeStaticJoinPoint implements IOptimize { 95 96 public void before() { 97 } 98 99 public void around() { 100 } 101 102 public void beforeAround() { 103 } 104 105 public void before(int arg) { 106 } 107 108 public void around(int arg) { 109 } 110 } 111 112 public static class OptimizeJoinPoint implements IOptimize { 113 114 public String toString() {return "OptimizeJoinPoint"; } 115 116 public void before() { 117 } 118 119 public void around() { 120 } 121 122 public void beforeAround() { 123 } 124 125 public void before(int arg) { 126 } 127 128 public void around(int arg) { 129 } 130 } 131 132 public static class OptimizeRtti implements IOptimize { 133 134 public String toString() {return "OptimizeRtti"; } 135 136 public void before() { 137 } 138 139 public void around() { 140 } 141 142 public void beforeAround() { 143 } 144 145 public void before(int arg) { 146 } 147 148 public void around(int arg) { 149 } 150 } 151 152 public static void main(String [] args) { 153 junit.textui.TestRunner.run(suite()); 154 } 155 156 public static junit.framework.Test suite() { 157 return new junit.framework.TestSuite(OptimizeTest.class); 158 } 159 160 public String toString() {return "OptimizeTest";} 161 162 } 163 | Popular Tags |