hello,
my JUnit test is as follow :
public class Toto{
@BeforeClass
public static void initTest1()
{
try{
openAppli();
}catch(Exception e){
e.printStackTrace();
}
}
@Test
public void test1(){
try{
//do some actions
}catch(Exception e){
e.printStackTrace();
}
}
@AfterClass
public static void AfterTest1()
{
CloseAppli();
}
}
I would like to know :
- is it the expected manner to write a JUnit test?
- should I call try/catch or throws ?
- could I call the same BeforeTest1() and AfterTest1() in other test class ?
thanks.