1 23 24 package com.sun.enterprise.tools.verifier; 25 26 27 import java.util.Vector ; 28 import java.util.logging.LogRecord ; 29 30 35 36 public class ResultManager { 37 38 public void add(Result result) { 39 Result r = result; 40 addToResult(r); 41 } 42 43 public void log(LogRecord logRecord) { 44 error.add(logRecord); 45 } 46 47 public int getFailedCount() { 48 return (failedResults == null) ? 0 : failedResults.size(); 49 } 50 51 public int getWarningCount() { 52 return (warningResults == null) ? 0 : warningResults.size(); 53 } 54 55 public int getErrorCount() { 56 return (error == null) ? 0 : error.size(); 57 } 58 59 public Vector getFailedResults() { 60 return failedResults; 61 } 62 63 public Vector getOkayResults() { 64 return okayResults; 65 } 66 67 public Vector getWarningResults() { 68 return warningResults; 69 } 70 71 public Vector getNaResults() { 72 return naResults; 73 } 74 75 public Vector getError() { 76 return error; 77 } 78 79 84 private void addToResult(Result r) { 85 if (r.getStatus() == Result.FAILED) { 86 failedResults.add(r); 87 } else if (r.getStatus() == Result.PASSED) { 88 okayResults.add(r); 89 } else if (r.getStatus() == Result.WARNING) { 90 warningResults.add(r); 91 } else if ((r.getStatus() == Result.NOT_APPLICABLE) || 92 (r.getStatus() == Result.NOT_RUN) || 93 (r.getStatus() == Result.NOT_IMPLEMENTED)) { 94 naResults.add(r); 95 } 96 } 97 98 private Vector <Result> failedResults = new Vector <Result>(); 99 private Vector <Result> okayResults = new Vector <Result>(); 100 private Vector <Result> warningResults = new Vector <Result>(); 101 private Vector <Result> naResults = new Vector <Result>(); 102 private Vector <LogRecord > error = new Vector <LogRecord >(); 103 } 104 | Popular Tags |