1 3 package org.jmock.core.matcher; 4 5 import junit.framework.AssertionFailedError; 6 import org.jmock.core.Invocation; 7 import org.jmock.core.InvocationMatcher; 8 9 10 public class TestFailureMatcher 11 implements InvocationMatcher 12 { 13 private String errorMessage; 14 15 public TestFailureMatcher( String errorMessage ) { 16 this.errorMessage = errorMessage; 17 } 18 19 public boolean matches( Invocation invocation ) { 20 return true; 21 } 22 23 public boolean hasDescription() { 24 return true; 25 } 26 27 public StringBuffer describeTo( StringBuffer buffer ) { 28 return buffer.append(errorMessage); 29 } 30 31 public void invoked( Invocation invocation ) { 32 throw new AssertionFailedError(errorMessage); 33 } 34 35 public void verify() { 36 } 38 } 39 | Popular Tags |