Examples of runAndCatch()


Examples of org.jbehave.core.mock.UsingMatchers.runAndCatch()

    }
   
    public void shouldCatchAndReturnAThrownException() throws Exception {
        UsingMatchers m = new UsingMatchers() {};
       
        Exception exception = m.runAndCatch(IllegalArgumentException.class, EXCEPTION_BLOCK);
        Ensure.that(exception, m.isNotNull());
    }
   
    public void shouldCatchAndReturnNullIfNoExceptionThrown() throws Exception {
        UsingMatchers m = new UsingMatchers() {};
View Full Code Here

Examples of org.jbehave.core.mock.UsingMatchers.runAndCatch()

    }
   
    public void shouldCatchAndReturnNullIfNoExceptionThrown() throws Exception {
        UsingMatchers m = new UsingMatchers() {};
       
        Exception exception = m.runAndCatch(IllegalArgumentException.class, EMPTY_BLOCK);
        Ensure.that(exception, m.isNull());
    }
   
    public void shouldCatchAndRethrowExceptionOfAnUnexpectedType() throws Exception {
        UsingMatchers m = new UsingMatchers() {};
View Full Code Here

Examples of org.jbehave.core.mock.UsingMatchers.runAndCatch()

   
    public void shouldCatchAndRethrowExceptionOfAnUnexpectedType() throws Exception {
        UsingMatchers m = new UsingMatchers() {};
       
        try {
            Exception exception = m.runAndCatch(UnsupportedOperationException.class, EXCEPTION_BLOCK);
            m.fail("Should have thrown IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            // expected
        }
    }
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.