Package org.javalite.test.jspec
Class JSpec
java.lang.Object
org.javalite.test.jspec.JSpec
-
Method Summary
Modifier and TypeMethodDescriptionstatic Expectation<Object>Synonym of methodsthe(Object)ora(Object).static Expectation<Object>static <T> voidExpect an exception.static <T> voidexpect(DifferenceExpectation<T> expectation)Expect that the results are different, throw TestException if same.static <T> voidexpect(ExceptionExpectation<T> expectation)static <T> voidexpect(ExceptionExpectation<T> expectation, String message)static <T> Expectation<T>it(T o1)Works the same way as methodsthe(Object)ora(Object), but takes generalized instance as parameter.static Expectation<Object>
-
Method Details
-
a
-
$
Synonym of methodsthe(Object)ora(Object).- Parameters:
o1- instance for checking- Returns:
- generalized expectation
-
the
-
it
Works the same way as methodsthe(Object)ora(Object), but takes generalized instance as parameter. For example you can't use it(12345).shouldBeEqual("12345"); you will get compilation error. You can perform checking only for the same type instances. Valid examples:it(1).shouldNotBeEqual(2)it("a").shouldNotBeEqual("b")
it(1L).shouldNotBeEqual(2)it("aaa").shouldNotBeEqual(1)
- Type Parameters:
T- generic type of expectation- Parameters:
o1- generic instance for checking- Returns:
- generalized expectation
-
expect
-
expect
Expect an exception.- Parameters:
type- class of exception to expectmessage- message to expect. This can be nullrunnable- instance ofjava.lang.Runnableto execute
-
expect
-
expect
Expect that the results are different, throw TestException if same.- Parameters:
expectation- difference expectation.
-