Methods Summary |
---|
public int | compareTo(java.lang.Object object)
// first sort is alphabetical, on class name.
// second test is on account name
// third test is by startTime.
// fourth test uses hashcode
Test otherTest = (Test) object;
String otherClassName = (otherTest.getClass()).getName();
int firstTest = _className.compareTo(otherClassName);
if (0 != firstTest) {
return firstTest;
}
int secondTest = accountName.compareTo(otherTest.accountName);
if (0 != secondTest) {
return secondTest;
}
if (startTime < otherTest.startTime) {
return -1;
} else {
if (startTime > otherTest.startTime) {
return +1;
}
}
return hashCode() - otherTest.hashCode();
|
protected abstract java.lang.String | describeOperation()
|
public java.lang.String | describeOutcome()
return "Attempted to " + describeOperation() + " account " + accountName
+ " at " + startTime + ". \n\t The operation took " + duration
+ " milliseconds and the result was : " + status + "\n";
|
private Account3 | getAccount()
accountName = _nameRepository.getAName();
Account3 account = null;;
try {
account = (Account3) Naming.lookup(accountName);
} catch (Exception e) {
}
return account;
|
protected Money | getRandomMoney()
/*
Sometimes the money will be negative. But,
most of the time, we'll send in positive amounts.
*/
int cents = -2000 + (int) (Math.random() * 100000);
return new Money(cents);
|
protected abstract java.lang.String | performActualTest(java.lang.String idNumber, Account3 account)
|
public void | performTest(java.lang.String idNumber)
Account3 account = getAccount();
if (null == account) {
status = UNABLE_TO_CONNECT;
duration = 0;
return;
}
startTime = System.currentTimeMillis();
status = performActualTest(idNumber, account);
duration = System.currentTimeMillis() - startTime;
return;
|