Test
string (for example: MapsDependencyTest
is a valid test class name), and with tests methods annotated with the @Test
annotation.public class MyTest { @Test public void aTestMethod { } }
assertEquals("The value is not equal to expected", 2, value)
. It is possible to check decimal values by providing an accepted delta, for example: assertEquals("The value is not equal to expected", 2.3f, value, 0.1f)
assertTrue("The value should be true", b)
. For false: assertFalse("The value should be false", b)
assertNull("The value should be null", o)
. For not null: assertNotNull("The value should not be null", o)
@Test public void aTestMethod { int i = 1 / 0; }And this test case will result in a fail:
@Test public void aTestMethod { assertTrue("Value must be true", false); }
Test
)@BeforeClass
method@Test
:@Before
method@After
method@AfterClass
method@BeforeClass
method.Copyright 2016-2017 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v2 licence