001: package org.jzonic.webtester.commands;
002:
003: /**
004: * This class represents the result of a WebTestNode. This is
005: * the result for one single step in the testcase.
006: *
007: * @author Mecky
008: */
009: public class WebTestNodeResult {
010:
011: private int lineNumber;
012: private boolean success;
013: private Exception throwable;
014: private String errorMessage;
015: private String command;
016: private String param;
017:
018: private WebTestNodeResult() {
019: }
020:
021: public WebTestNodeResult(String command, String param) {
022: this .command = command;
023: this .param = param;
024: }
025:
026: public WebTestNodeResult(String command) {
027: this .command = command;
028: this .param = "";
029: }
030:
031: /**
032: * Returns the state of the result
033: *
034: * @return true if the test was successfull
035: */
036: public boolean isSuccess() {
037: return success;
038: }
039:
040: public void setSuccess(boolean success) {
041: this .success = success;
042: }
043:
044: /**
045: * If the test raised an exception then this method
046: * will return the exception caught by the WebTestNode
047: *
048: * @return the exception
049: */
050: public Exception getException() {
051: return throwable;
052: }
053:
054: public void setException(Exception e) {
055: throwable = e;
056: }
057:
058: /**
059: * Returns the error message if the WebTestNode has failed.
060: * The error message is set by the WebTestNode.
061: *
062: * @return the error message
063: */
064: public String getErrorMessage() {
065: return errorMessage;
066: }
067:
068: public void setErrorMessage(String errorMessage) {
069: this .errorMessage = errorMessage;
070: }
071:
072: /**
073: * Returns the command name for this WebTestNode
074: *
075: * @return the name of the command
076: */
077: public String getCommand() {
078: return command;
079: }
080:
081: public void setCommand(String command) {
082: this .command = command;
083: }
084:
085: public String getParam() {
086: return param;
087: }
088:
089: public void setParam(String param) {
090: this .param = param;
091: }
092:
093: public int getLineNumber() {
094: return lineNumber;
095: }
096:
097: public void setLineNumber(int lineNumber) {
098: this.lineNumber = lineNumber;
099: }
100:
101: }
|