1
2
3
4
5
6
7
8
9
10
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 {
25 private AssertionError[] errors;
26
27 public AssertionException( AssertionError error )
28 {
29 this( new AssertionError[] {error});
30 }
31
32 public AssertionException(AssertionError[] errors)
33 {
34 this.errors = new AssertionError[errors.length];
35 for( int c = 0; c < errors.length; c++ )
36 this.errors[c] = errors[c];
37 }
38
39 public int getErrorCount()
40 {
41 return errors.length;
42 }
43
44 public AssertionError getErrorAt( int c )
45 {
46 return errors[c];
47 }
48
49 public AssertionError[] getErrors()
50 {
51 return errors;
52 }
53
54 public String getMessage()
55 {
56 StringBuffer result = new StringBuffer();
57 for( int c = 0; c < errors.length; c++ )
58 {
59 if( c > 0 )
60 result.append( '\n' );
61 result.append( errors[c].getMessage() );
62 }
63
64 return result.toString();
65 }
66
67
68 }