Package org.djunits
Class Try
- java.lang.Object
-
- org.djunits.Try
-
public abstract class Try extends Object
Use the Try class as follows:new Try( public @Override void execute() { // code to test that should fail }).test();
Copyright (c) 2019-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.- Author:
- Alexander Verbraeck
-
-
Constructor Summary
Constructors Constructor Description Try()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
execute()
implement the execute method to test failure.void
test()
call the test method to test failure of the try.void
test(String message)
call the test method to test failure of the try.void
test(String message, Class<? extends Exception> expectedExceptionClass)
call the test method to test failure of the try with an expected exception type.
-
-
-
Method Detail
-
execute
public abstract void execute()
implement the execute method to test failure.
-
test
public void test()
call the test method to test failure of the try.
-
test
public void test(String message)
call the test method to test failure of the try.- Parameters:
message
- the message to print
-
-