Created
June 24, 2015 00:42
-
-
Save vaskoz/3c784a01701fa19b8cfd to your computer and use it in GitHub Desktop.
Run JUnit tests programmatically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.junit.Assert.assertEquals; | |
import org.junit.Test; | |
public class ProgrammaticJUnit { | |
@Test public void test1() { | |
assertEquals(3, 1+2); | |
} | |
@Test public void test2() { | |
assertEquals(8, 3*3); // INTENTIONAL FAIL | |
} | |
@Test public void test3() { | |
System.out.println("Just wanted to print here"); | |
} | |
public static void main(String[] args) { | |
org.junit.runner.JUnitCore.main("ProgrammaticJUnit"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment