1 4 package com.tc.object.logging; 5 6 import junit.framework.TestCase; 7 8 public class KeysTest extends TestCase { 9 10 public void test() { 11 String [] keys = Keys.getKeys(Class1.class); 12 13 assertEquals(5, keys.length); 14 15 for (int i = 0; i < keys.length; i++) { 16 assertEquals("index " + i, "good", keys[i]); 17 } 18 19 } 20 21 private static class Class1 { 22 static final String GOOD_1 = "good"; 23 public static final String GOOD_2 = "good"; 24 protected static final String GOOD_3 = "good"; 25 private static final String GOOD_4 = "good"; 26 transient static final String GOOD_5 = "good"; 27 28 private static final Object NO_GOOD_1 = new Object (); private static String NO_GOOD_2 = "bad"; final String NO_GOOD_3 = "bad"; static final String No_GOOD_4 = "bad"; 33 public void silenceWarnings() { 34 if (true) { throw new Error ("oh no you didn't!"); } 36 37 System.out.println(GOOD_4); 38 System.out.println(NO_GOOD_1); 39 System.out.println(NO_GOOD_2); 40 } 41 42 } 43 44 } 45 | Popular Tags |