Package junit.framework

Examples of junit.framework.TestCase


    }

    public void testTwoTests() {
        String expected = expected(new String[]{"..", "Time: 0", "", "OK (2 tests)", ""});
        TestSuite suite = new TestSuite();
        suite.addTest(new TestCase() {
            @Override
            public void runTest() {
            }
        });
        suite.addTest(new TestCase() {
            @Override
            public void runTest() {
            }
        });
        runner.doRun(suite);
View Full Code Here


                getWriter().println("Failures here");
            }
        };
        runner.setPrinter(printer);
        TestSuite suite = new TestSuite();
        suite.addTest(new TestCase() {
            @Override
            public void runTest() {
                throw new AssertionFailedError();
            }
        });
View Full Code Here

                getWriter().println("Errors here");
            }
        };
        runner.setPrinter(printer);
        TestSuite suite = new TestSuite();
        suite.addTest(new TestCase() {
            @Override
            public void runTest() throws Exception {
                throw new Exception();
            }
        });
View Full Code Here

    }

    private DoubleTestCase fTest;

    public TestImplementorTest() {
        TestCase testCase = new TestCase() {
            @Override
            public void runTest() {
            }
        };
        fTest = new DoubleTestCase(testCase);
View Full Code Here

    public void startTest(Test test) {
        fStartCount++;
    }

    public void testError() {
        TestCase test = new TestCase("noop") {
            @Override
            public void runTest() {
                throw new Error();
            }
        };
        test.run(fResult);
        assertEquals(1, fErrorCount);
        assertEquals(1, fEndCount);
    }
View Full Code Here

        assertEquals(1, fErrorCount);
        assertEquals(1, fEndCount);
    }

    public void testFailure() {
        TestCase test = new TestCase("noop") {
            @Override
            public void runTest() {
                fail();
            }
        };
        test.run(fResult);
        assertEquals(1, fFailureCount);
        assertEquals(1, fEndCount);
    }
View Full Code Here

        assertEquals(1, fFailureCount);
        assertEquals(1, fEndCount);
    }

    public void testStartStop() {
        TestCase test = new TestCase("noop") {
            @Override
            public void runTest() {
            }
        };
        test.run(fResult);
        assertEquals(1, fStartCount);
        assertEquals(1, fEndCount);
    }
View Full Code Here

                getWriter().println("Errors here");
            }
        };
        runner.setPrinter(printer);
        TestSuite suite = new TestSuite();
        suite.addTest(new TestCase() {
            @Override
            public void runTest() throws Exception {
                throw new Exception();
            }
        });
View Full Code Here

              assertContents(pdttFile.getExpected(),
                  buf.toString());
            }
          });
        } catch (final Exception e) {
          suite.addTest(new TestCase(fileName) { // dummy test
                              // indicating PDTT
                              // file parsing
                              // failure
            protected void runTest() throws Throwable {
              throw e;
View Full Code Here

    assertThat(Tests.testClassNameFrom(test)).isEqualTo("world");
  }

  @Test
  public void shouldReturnToStringAsClassNameIfTestIsInstanceOfTestCase() {
    TestCase test = new TestCase("Leia") {};
    assertThat(Tests.testClassNameFrom(test)).isEqualTo(test.getClass().getName());
  }
View Full Code Here

TOP

Related Classes of junit.framework.TestCase

Copyright © 2018 www.massapicom. 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.