01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: * See the GNU Lesser General Public License for more details at gnu.org.
11: */
12:
13: package com.eviware.soapui.impl.wsdl.teststeps.assertions;
14:
15: import com.eviware.soapui.support.SoapUIException;
16:
17: /**
18: * Exception thrown during assertion
19: *
20: * @author Ole.Matzura
21: */
22:
23: public class AssertionException extends SoapUIException {
24: private AssertionError[] errors;
25:
26: public AssertionException(AssertionError error) {
27: this (new AssertionError[] { error });
28: }
29:
30: public AssertionException(AssertionError[] errors) {
31: this .errors = new AssertionError[errors.length];
32: for (int c = 0; c < errors.length; c++)
33: this .errors[c] = errors[c];
34: }
35:
36: public int getErrorCount() {
37: return errors.length;
38: }
39:
40: public AssertionError getErrorAt(int c) {
41: return errors[c];
42: }
43:
44: public AssertionError[] getErrors() {
45: return errors;
46: }
47:
48: public String getMessage() {
49: StringBuffer result = new StringBuffer();
50: for (int c = 0; c < errors.length; c++) {
51: if (c > 0)
52: result.append('\n');
53: result.append(errors[c].getMessage());
54: }
55:
56: return result.toString();
57: }
58:
59: }
|