1 23 package com.sun.enterprise.admin.verifier; 24 25 import java.util.*; 26 import com.sun.enterprise.util.LocalStringManagerImpl; 27 28 public class Result { 29 30 public static final int PASSED = 0; 31 public static final int FAILED = 1; 32 public static final int WARNING = 2; 33 public static final int NOT_APPLICABLE = 3; 34 public static final int NOT_RUN = 4; 35 public static final int NOT_IMPLEMENTED = 5; 36 private int status = NOT_RUN; 37 private String componentName; 38 private String assertion; 39 private String testName; 40 private Vector errorDetails = new Vector(); 41 private Vector goodDetails = new Vector(); 42 private Vector warningDetails = new Vector(); 43 private Vector naDetails = new Vector(); 44 boolean debug = false; 46 47 51 public void Result(){ 52 } 53 54 55 60 public void init(Class c){ 61 String this_package = "com.sun.enterprise.admin.verifier."; 63 if(c.getName().indexOf("com.iplanet.ias")!=-1) 65 this_package = "com.sun.enterprise.admin.verifier."; 66 setTestName(c.getName().substring(this_package.length())); 68 } 69 70 75 public void passed(String detail){ 76 setStatus(PASSED); 77 addGoodDetails(detail); 78 } 79 80 85 public void warning(String detail){ 86 setStatus(WARNING); 87 addWarningDetails(detail); 88 } 89 90 95 public void notApplicable(String detail){ 96 setStatus(NOT_APPLICABLE); 97 addNaDetails(detail); 98 } 99 100 105 public void failed(String detail){ 106 setStatus(FAILED); 107 addErrorDetails(detail); 108 } 109 110 115 public Vector getNaDetails(){ 116 return naDetails; 117 } 118 119 124 public Vector getWarningDetails(){ 125 return warningDetails; 126 } 127 128 133 public void addNaDetails(String s){ 134 naDetails.addElement(s); 135 if (debug) { 136 System.out.println (s); 137 } 138 } 139 140 145 public Vector getGoodDetails(){ 146 return goodDetails; 147 } 148 149 154 public void addGoodDetails(String s){ 155 goodDetails.addElement(s); 156 if (debug) 157 System.out.println (s); 158 } 159 160 165 public void addWarningDetails(String s){ 166 warningDetails.addElement(s); 167 if (debug) 168 System.out.println (s); 169 } 170 171 176 public Vector getErrorDetails(){ 177 return errorDetails; 178 } 179 180 185 public void addErrorDetails(String s){ 186 errorDetails.addElement(s); 187 if (debug) 188 System.out.println (s); 189 } 190 191 196 public int getStatus(){ 197 return status; 198 } 199 200 205 public void setStatus(int s){ 206 status = s; 207 } 208 209 214 public String getAssertion(){ 215 return assertion; 216 } 217 218 223 public void setAssertion(String s){ 224 assertion = s; 225 } 226 227 232 public String getComponentName(){ 233 return componentName; 234 } 235 236 241 public void setComponentName(String s){ 242 componentName = s; 243 } 244 245 250 public String getTestName(){ 251 return testName; 252 } 253 254 259 public void setTestName(String s){ 260 testName = s; 261 } 262 263 } | Popular Tags |