Skip to content

Instantly share code, notes, and snippets.

@acdcjunior
Created December 5, 2013 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acdcjunior/7812834 to your computer and use it in GitHub Desktop.
Save acdcjunior/7812834 to your computer and use it in GitHub Desktop.
Exemplo de classe de teste JUnit que usa @rule - Example test class using JUnit's @rule
import org.junit.*;
public class ExemploTest {
@Rule
public ExemploMethodRule exemploRule = new ExemploMethodRule();
@BeforeClass
public static void beforeClass() {
System.out.println("@BeforeClass");
}
@AfterClass
public static void afterClass() {
System.out.println("@AfterClass");
}
@Before
public void before() {
System.out.println("@Before");
}
@After
public void after() {
System.out.println("@After");
}
@Test
public void aa() {
System.out.println("aa()");
}
@Test
public void bb() {
System.out.println("bb()");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment