01: /******************************************************************************
02: * jWebUnit project (http://jwebunit.sourceforge.net) *
03: * Distributed open-source, see full license under LICENCE.txt *
04: ******************************************************************************/package net.sourceforge.jwebunit.exception;
05:
06: /**
07: * This name reflects the name all of exceptions that will be thrown from a specific "testing engine".
08: *
09: * All testing engines will respond, if necessary, using this exception instead of the testing specific engine
10: * exceptions.
11: *
12: *
13: * @author Nicholas Neuberger
14: */
15: public class TestingEngineResponseException extends RuntimeException {
16:
17: private int httpStatusCode = -1;
18:
19: /**
20: *
21: */
22: public TestingEngineResponseException() {
23: super ();
24: }
25:
26: public TestingEngineResponseException(int httpStatusCode) {
27: super ();
28: this .httpStatusCode = httpStatusCode;
29: }
30:
31: public TestingEngineResponseException(int httpStatusCode, String msg) {
32: super (msg);
33: this .httpStatusCode = httpStatusCode;
34: }
35:
36: public TestingEngineResponseException(int httpStatusCode,
37: String msg, Throwable ex) {
38: super (msg, ex);
39: this .httpStatusCode = httpStatusCode;
40: }
41:
42: public TestingEngineResponseException(int httpStatusCode,
43: Exception e) {
44: super ("The server return " + httpStatusCode + " HTTP code.", e);
45: this .httpStatusCode = httpStatusCode;
46: }
47:
48: /**
49: * @param arg0
50: */
51: public TestingEngineResponseException(String msg) {
52: super (msg);
53: }
54:
55: /**
56: * @param arg0
57: * @param arg1
58: */
59: public TestingEngineResponseException(String msg, Throwable ex) {
60: super (msg, ex);
61: }
62:
63: /**
64: * @param arg0
65: */
66: public TestingEngineResponseException(Throwable ex) {
67: super (ex);
68: }
69:
70: /**
71: * Return the HTTP status code that throw this Exception or -1 if this exception
72: * was not thrown because of HTTP status code.
73: * @return
74: */
75: public int getHttpStatusCode() {
76: return httpStatusCode;
77: }
78:
79: }
|