Examples of exceptionMessage()


Examples of junit.framework.TestFailure.exceptionMessage()

        TestResult result = new TestResult();
        junit.framework.Test adapter = new JUnit4TestAdapter(InvalidMethodTest.class);
        adapter.run(result);
        assertEquals(1, result.errorCount());
        TestFailure failure = result.errors().nextElement();
        assertTrue(failure.exceptionMessage().contains("Method shouldBeStatic() should be static"));
    }

    private static boolean wasRun = false;

    public static class MarkerRunner extends Runner {
View Full Code Here

Examples of junit.framework.TestFailure.exceptionMessage()

    TestResult result= new TestResult();
    junit.framework.Test adapter= new JUnit4TestAdapter(InvalidMethodTest.class);
    adapter.run(result);
    assertEquals(1, result.errorCount())
    TestFailure failure= result.errors().nextElement();
    assertTrue(failure.exceptionMessage().contains("Method shouldBeStatic() should be static"));
  }
 
  private static boolean wasRun= false;
 
  public static class MarkerRunner extends Runner {
View Full Code Here

Examples of junit.framework.TestFailure.exceptionMessage()

    Enumeration e = testResult.errors();
    while (e.hasMoreElements()) {
      TestFailure f = (TestFailure) e.nextElement();
      System.out.println(f);
      System.out.println(f.exceptionMessage());
    }

    Assert.assertEquals(0, testResult.errorCount());

  }
View Full Code Here

Examples of junit.framework.TestFailure.exceptionMessage()

        antUnitTestCase.run(testResult);

        assertEquals(1 , testResult.errorCount());
        TestFailure error = (TestFailure) testResult.errors().nextElement();
        assertSame(antUnitTestCase, error.failedTest());
        assertTrue("Unexpected error : " + error.exceptionMessage(),
                error.exceptionMessage().contains("unknown"));
    }

    public void testInvalidFile() {
        //when the ant script has changed (or just disappeared) and the user try
View Full Code Here

Examples of junit.framework.TestFailure.exceptionMessage()

        assertEquals(1 , testResult.errorCount());
        TestFailure error = (TestFailure) testResult.errors().nextElement();
        assertSame(antUnitTestCase, error.failedTest());
        assertTrue("Unexpected error : " + error.exceptionMessage(),
                error.exceptionMessage().contains("unknown"));
    }

    public void testInvalidFile() {
        //when the ant script has changed (or just disappeared) and the user try
        //to rerun this target.
View Full Code Here

Examples of junit.framework.TestFailure.exceptionMessage()

        antUnitTestCase.run(testResult);

        assertEquals(1 , testResult.errorCount());
        TestFailure error = (TestFailure) testResult.errors().nextElement();
        assertSame(antUnitTestCase, error.failedTest());
        assertTrue("Unexpected error : " + error.exceptionMessage(),
                error.exceptionMessage().contains("invalidFile"));
    }

}
View Full Code Here

Examples of junit.framework.TestFailure.exceptionMessage()

        assertEquals(1 , testResult.errorCount());
        TestFailure error = (TestFailure) testResult.errors().nextElement();
        assertSame(antUnitTestCase, error.failedTest());
        assertTrue("Unexpected error : " + error.exceptionMessage(),
                error.exceptionMessage().contains("invalidFile"));
    }

}
View Full Code Here

Examples of junit.framework.TestFailure.exceptionMessage()

        suite.run(testResult);
       
        assertNotNull(suite.getName());
        assertEquals(1 , testResult.errorCount());
        TestFailure error = (TestFailure) testResult.errors().nextElement();
        assertTrue("Unexpected error : " + error.exceptionMessage(),
                error.exceptionMessage().contains("xxxx"));
    }
   
    //TODO test missing target error reporting
}
View Full Code Here

Examples of junit.framework.TestFailure.exceptionMessage()

       
        assertNotNull(suite.getName());
        assertEquals(1 , testResult.errorCount());
        TestFailure error = (TestFailure) testResult.errors().nextElement();
        assertTrue("Unexpected error : " + error.exceptionMessage(),
                error.exceptionMessage().contains("xxxx"));
    }
   
    //TODO test missing target error reporting
}
View Full Code Here

Examples of junit.framework.TestFailure.exceptionMessage()

            Enumeration<TestFailure> failures = result.failures();
            while(failures.hasMoreElements()){
                TestFailure failure = failures.nextElement();

                TestFailureResultBean t = new TestFailureResultBean();
                t.setExceptionMessage(failure.exceptionMessage());
                t.setLineNumber(getLineNumber(failure.trace()));
                l.add(t);
            }
            resultBean.setFailures(l);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.