Package org.jbehave.core.exception

Examples of org.jbehave.core.exception.VerificationException


    public void specify() {
       
    }

    public void run() {
        throw new VerificationException("Failed");
    }
View Full Code Here


        String message = "Expected at least " + minInvocations + " calls but got " + invocations
                + " for " + mockName + "." + methodToString();
            if (!id.equals(methodName)) {
                message += " id=" + id;
            }
            throw new VerificationException(message);
    }
    }
View Full Code Here

   
    public static void doesNotThrowException(Block block) throws Exception {
        try {
            block.run();
        } catch (Exception e) {
            throw new VerificationException("Expected no exception", e);
        }
    }
View Full Code Here

    protected Result newSuccessResult() {
        return new BehaviourMethodResult(shouldDoSomething);
    }

    protected Result newFailureResult() {
        return new BehaviourMethodResult(shouldDoSomething, new VerificationException("oops"));
    }
View Full Code Here

            Expectation expectation = (Expectation) i.next();
            if (expectation.id().equals(id)) {
                return expectation;
            }
        }
        throw new VerificationException("Unknown expectation id '" + id + "' for " + this);
    }
View Full Code Here

    }

    protected static Mock strictMock(Class type, String name) {
        return mock(type, name, new InvocationHandler() {
            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                throw new VerificationException("Unexpected call to "
                        + method.getName() + "[" +
                        Arrays.asList(args) + "]");
            }
        });
    }
View Full Code Here

              StringBuffer message = new StringBuffer();
              message.append("Unexpected arguments for " + name + ".").append(method.getName())
                  .append(newLine())
                    .append("Expected:").append(newLine()).append(toString(expectations))
                    .append("Got:").append(newLine()).append(method.getName()).append("[").append(toString(args)).append("]");
                throw new VerificationException(message.toString());
            }
        }
View Full Code Here

          fail("Expected condition was not met");
        }
    }

    public void fail(String message) {
        throw new VerificationException(message);
    }
View Full Code Here

    public void fail(String message) {
        throw new VerificationException(message);
    }
   
    public void fail(String message, Exception e) {
        throw new VerificationException(message, e);
    }
View Full Code Here

    public void fail(String message, Exception e) {
        throw new VerificationException(message, e);
    }

    public void fail(String message, Object expected, Object actual) {
        throw new VerificationException(message, expected, actual);
    }
View Full Code Here

TOP

Related Classes of org.jbehave.core.exception.VerificationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.