Thursday, 27 December 2012

Selenium Runwith annotation program

//  Main program ( Sample.java )
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({two.class})

public class Sample {
}


//   Subprogram   (two.java) (Called program)
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class two {

    @Before
    public  void before(){
        System.out.println("Before");
    }
   
    @Test
     public  void test(){
        System.out.println("Test");
    }
   
     @After
     public  void after(){
            System.out.println("After");
    }

}

No comments:

Post a Comment