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 com.eviware.soapui.impl.wsdl.teststeps.assertions.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 = errors;
35 }
36
37 public int getErrorCount()
38 {
39 return errors.length;
40 }
41
42 public AssertionError getErrorAt( int c )
43 {
44 return errors[c];
45 }
46
47 public AssertionError[] getErrors()
48 {
49 return errors;
50 }
51
52 public String getMessage()
53 {
54 StringBuffer result = new StringBuffer();
55 for( int c = 0; c < errors.length; c++ )
56 {
57 if( c > 0 )
58 result.append( '\n' );
59 result.append( errors[c].getMessage() );
60 }
61
62 return result.toString();
63 }
64
65
66 }