Package org.jbehave.core.exception

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


            public void specifySteps() {
                given((Given) given);
               
            }};
           
        given.expects("setUp").will(throwException(new VerificationException("")));
        given.expects("cleanUp").once();
           
        scenario.specify();
       
        try {
View Full Code Here

    protected Result newSuccessResult() {
        return new ScenarioResult("scenario", "container", ScenarioResult.SUCCEEDED);
    }

    protected Result newFailureResult() {
        return new ScenarioResult("Scenario", "container", new VerificationException("oops"));
    }
View Full Code Here

            }
        };
       
        Mock listener = mock(BehaviourListener.class);
        AScenario scenario = new AScenario();
        VerificationException ve = new VerificationException("Thrown by an outcome when an ensureThat fails");
        ScenarioResult result = new ScenarioResult("a scenario", "a story", ve);
        scenario.expects("run").with(world).will(throwException(ve));
        scenario.expects("cleanUp").with(world);
       
        story.addScenario((Scenario)scenario);
View Full Code Here

                step.perform(world);
            }
        } catch (VerificationException e) {
            throw e;
        } catch (Exception e) {
            throw new VerificationException("Exception in Scenario", e);
        } finally {
            state = RUN;
        }
    }
View Full Code Here

        Result result = new Result("shouldSucceed", "Container", Result.SUCCEEDED);
        verifyResult(result, Result.SUCCEEDED, true, false, false);
    }

    public void shouldHaveConsistentStateForFailure() throws Exception {
        Result result = new Result("shouldFail", "Container", new VerificationException("oops"));
        verifyResult(result, Result.FAILED, false, true, false);
    }
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.