1 64 65 package com.jcorporate.expresso.ext.dbobj; 66 67 72 73 78 public class PerfTestResult { 79 private StringBuffer message = null; 80 private int failureCount = 0; 81 private int warningCount = 0; 82 private int cautionCount = 0; 83 private String sessionId = null; 84 private long runTime = 0; 85 private int currentUsers = 0; 86 87 90 public PerfTestResult() { 91 super(); 92 } 93 94 95 public void setSessionId(String newId) { 96 sessionId = newId; 97 } 98 99 public String getSessionId() { 100 return sessionId; 101 } 102 103 public int getCurrentUsers() { 104 return currentUsers; 105 } 106 107 public void setCurrentUsers(int newCurrentUsers) { 108 currentUsers = newCurrentUsers; 109 } 110 111 public void setRunTime(long newRunTime) { 112 runTime = newRunTime; 113 } 114 115 public long getRunTime() { 116 return runTime; 117 } 118 119 public void add(PerfTestResult oneResult) { 120 String newMessage = oneResult.getMessage(); 121 122 if (!newMessage.equals("")) { 123 addMessage("\n" + newMessage); 124 } 125 126 setWarningCount(getWarningCount() + oneResult.getWarningCount()); 127 setFailureCount(getFailureCount() + oneResult.getFailureCount()); 128 setCautionCount(getCautionCount() + oneResult.getCautionCount()); 129 130 if (sessionId == null) { 131 setSessionId(oneResult.getSessionId()); 132 } 133 134 setRunTime(getRunTime() + oneResult.getRunTime()); 135 136 if (oneResult.getCurrentUsers() > getCurrentUsers()) { 137 setCurrentUsers(oneResult.getCurrentUsers()); 138 } 139 } 140 141 public void setMessage(String newMessage) { 142 message = new StringBuffer (newMessage); 143 } 144 145 public void addMessage(String newMessage) { 146 if (message == null) { 147 message = new StringBuffer (); 148 } 149 if (newMessage != null) { 150 message.append(newMessage); 151 } 152 } 153 154 public void setFailureCount(int newCount) { 155 failureCount = newCount; 156 } 157 158 public void setWarningCount(int newCount) { 159 warningCount = newCount; 160 } 161 162 public void setCautionCount(int newCount) { 163 cautionCount = newCount; 164 } 165 166 public String getMessage() { 167 if (message != null) { 168 return message.toString(); 169 } else { 170 return ""; 171 } 172 } 173 174 public int getFailureCount() { 175 return failureCount; 176 } 177 178 public int getWarningCount() { 179 return warningCount; 180 } 181 182 public int getCautionCount() { 183 return cautionCount; 184 } 185 } 186 187 | Popular Tags |