I know the below question is not related to this group but still i am asking...If someone might have come accross with this scenario can help me out...
Suppose I am running a @Test annotation in Junit..How to know that whether the @Test is passing or failing from Junit programmatically? Is there any way to do this kind of scenario?
My intention is to capture the result of the test either fail or pass for the JUint. At the end of the test run I need to know the status of the test.
Currently I am executing with the help of @Test annotations
import junit.framework.Assert;
import org.junit.Test;
public class TestApp2 {
@Test
public void testPrintHelloWorld2() {
Assert.assertEquals(App.getHelloWorld2(), "Hello World 2");
}
}
My point here is to verify the status of the @Test. Here in the above example if the assertion will fail then the JUNIT will fail. But I want to know how the JUNIT is failing - how to know that the JUNIT is failing. My intention is not check the Juint console to check whether the @Test passed or failed.