Login

Login
  • Register
  • VectorDesign blog

    Testing Automation and general Tech Geek stuff

    JUnit Annotations Cheat Sheet

    @Before is executed before each test, @BeforeClass runs once before the entire test fixture. If your test class has ten tests, @Before code will be executed ten times, but @BeforeClass will be executed only once. In general, you use @BeforeClass when multiple tests need to share the same computationally expensive setup code. Establishing a database connection falls into this category. You can move […]

    Wednesday, September 13th, 2017

    junit get test name

    import org.junit.Rule; public class NameRuleTest { @Rule public TestName name = new TestName(); @Test public void testA() { assertEquals(“testA”, name.getMethodName()); } @Test public void testB() { assertEquals(“testB”, name.getMethodName()); } }

    Thursday, June 30th, 2016