Examples of VerificationException


Examples of org.jbehave.core.exception.VerificationException

        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

Examples of org.jbehave.core.exception.VerificationException

   
    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

Examples of org.jbehave.core.exception.VerificationException

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

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

Examples of org.jbehave.core.exception.VerificationException

            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

Examples of org.jbehave.core.exception.VerificationException

    }

    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

Examples of org.jbehave.core.exception.VerificationException

              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

Examples of org.jbehave.core.exception.VerificationException

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

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

Examples of org.jbehave.core.exception.VerificationException

    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

Examples of org.jbehave.core.exception.VerificationException

    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

Examples of org.jbehave.core.exception.VerificationException

        ensureThat(exception, isNotNull());       
    }
   
    public void shouldNotRethrowVerificationExceptionsInSteps() throws Exception {
        final Mock given = mock(GivenWithCleanUp.class, "given");
        VerificationException verificationException = new VerificationException("My message");
        given.expects("setUp").will(throwException(verificationException));
       
        final Scenario scenario = new MultiStepScenario(){
            public void specifySteps() {
                given((Given) given);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.