S
sakcee
is there a way to run an instance/object of this type using Junit. The
reason is that I want to call setVar for setting var. junit can run
class but can it run an object of this class?
something like
import org.junit.*;
import org.junit.After;
import org.junit.Test;
import org.junit.Before;
public class TT {
private String var =null;
public setVar(String s){
var = s;
}
@Before
public void Before(){
}
@Test
public void tt(){
System.out.println("Test1" );
}
@Test
public void tt2(){
System.out.println("Test2" );
}
@Test
public void tt3(){
System.out.println("Test3" );
}
@After
public void After() throws Exception {
System.out.println("after");
}
}
reason is that I want to call setVar for setting var. junit can run
class but can it run an object of this class?
something like
import org.junit.*;
import org.junit.After;
import org.junit.Test;
import org.junit.Before;
public class TT {
private String var =null;
public setVar(String s){
var = s;
}
@Before
public void Before(){
}
@Test
public void tt(){
System.out.println("Test1" );
}
@Test
public void tt2(){
System.out.println("Test2" );
}
@Test
public void tt3(){
System.out.println("Test3" );
}
@After
public void After() throws Exception {
System.out.println("after");
}
}