1 28 29 package com.idaremedia.antx.tests; 30 31 import com.idaremedia.antx.Iteration; 32 33 42 43 public final class FakeIteration extends Iteration 44 { 45 public static final String INIVALUE= "uninitialized"; 46 public static final String TESTFIELD = "m_testField"; 47 48 public FakeIteration() 49 { 50 super(); 51 } 52 53 public static final FakeIteration getf() 54 { 55 return (FakeIteration)get(); 56 } 57 58 public String getPrivateField() 59 { 60 return privateField; 61 } 62 63 public static final String privateField() 64 { 65 return ((FakeIteration)get()).getPrivateField(); 66 } 67 68 public String getProtectedField() 69 { 70 return protectedField; 71 } 72 73 public static final String protectedField() 74 { 75 return ((FakeIteration)get()).getProtectedField(); 76 } 77 78 public String getInheritedField(String fieldname) 79 throws Exception 80 { 81 if (fieldname.startsWith("inherited:")) { 82 fieldname = fieldname.substring("inherited:".length()); 83 } 84 Object value = getFieldValue(fieldname); 85 if (value!=null) { 86 if (TESTFIELD.equals(fieldname)) { 87 return String.valueOf(value); 88 } 89 return value.getClass().getName(); 90 } 91 return null; 92 } 93 94 public static final String inheritedField(String fieldname) 95 throws Exception 96 { 97 return getf().getInheritedField(fieldname); 98 } 99 100 101 private String privateField= INIVALUE; 102 protected String protectedField= INIVALUE; 103 public String publicField= INIVALUE; 104 } 105 106 107 | Popular Tags |