Package junit.framework

Examples of junit.framework.TestCase


        }
        s.close();
    }

    private static Throwable runTestCaseTest(String testClass, String method, int port) throws Exception {
        TestCase test = (TestCase)Class.forName(testClass).newInstance();
        test.setName(method);
        TestResult result = new TestResult();
        test.run(result);
        if (result.failureCount() != 0) {
            Enumeration e = result.failures();
            return ((TestFailure)e.nextElement()).thrownException();
        }
        else if (result.errorCount() != 0) {
View Full Code Here


                        tr.addFailure(this.TEST_INSTANCE,
                                new AssertionFailedError(e.getMessage()));
                    }
                }
                final Method m = getMethod(this.TEST_INSTANCE,methodName);
                final TestCase theClazz = this.TEST_INSTANCE;
                tr.startTest(this.TEST_INSTANCE);
                sresult.sampleStart();
                // Do not use TestCase.run(TestResult) method, since it will
                // call setUp and tearDown. Doing that will result in calling
                // the setUp and tearDown method twice and the elapsed time
View Full Code Here

      // - Add each test result into the report.
      // - Add the category for the test result, if necessary.
      for (Iterator entryIt = testResults.entrySet().iterator(); entryIt.hasNext();) {
        Map.Entry entry = (Map.Entry) entryIt.next();
        TestCase test = (TestCase) entry.getKey();
        List/* <JUnitMessageQueue.TestResult> */results = (List/* <JUnitMessageQueue.TestResult> */) entry.getValue();
        BenchmarkXml xml = new BenchmarkXml(test, results);
        Element categoryElement = getCategoryElement(doc, report,
            xml.metaData.getCategory().getClassName());
        categoryElement.appendChild(xml.toElement(doc));
View Full Code Here

    }

    public static void main(String[] argv) {

        TestResult result        = new TestResult();
        TestCase   testKeepAlive = new TestHTTPKeepAlive("testKeepAlive");

        testKeepAlive.run(result);
        System.out.println("TestKeepAlive error count: "
                           + result.failureCount());

        Enumeration e = result.failures();
View Full Code Here

    /* Runs TestBug808460 test from the command line*/
    public static void main(String[] args) throws Exception {

        TestResult            result;
        TestCase              test;
        java.util.Enumeration failures;
        int                   count;

        result = new TestResult();
        test   = new TestBug808460("test");

        test.run(result);

        count = result.failureCount();

        System.out.println("TestBug808460 failure count: " + count);

View Full Code Here

    }

    public static void main(String[] argv) {

        TestResult result = new TestResult();
        TestCase   testC  = new TestSqlPersistent("testInsertObject");
        TestCase   testD  = new TestSqlPersistent("testSelectObject");

        testC.run(result);
        testD.run(result);
        System.out.println("TestSqlPersistent error count: "
                           + result.failureCount());
    }
View Full Code Here

     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception {

        TestResult            result;
        TestCase              test;
        java.util.Enumeration failures;
        int                   count;

        result = new TestResult();
        test   = new TestJDBCSavepoints("testJDBCSavepoints");

        test.run(result);

        count = result.failureCount();

        System.out.println("TestJDBCSavepoints failure count: " + count);

View Full Code Here

    public static void procTest3(Integer value) throws java.sql.SQLException {}

    public static void main(String[] args) throws Exception {

        TestResult            result;
        TestCase              test;
        java.util.Enumeration failures;
        int                   count;

        result = new TestResult();
        test   = new TestStoredProcedure("test");

        test.run(result);

        count = result.failureCount();

        System.out.println("TestStoredProcedure failure count: " + count);
View Full Code Here

    /* Runs TestBug778213_Part3 test from the command line*/
    public static void main(String[] args) throws Exception {

        TestResult            result;
        TestCase              test;
        java.util.Enumeration failures;
        int                   count;

        result = new TestResult();
        test   = new TestBug778213("test");

        test.run(result);

        count = result.failureCount();

        System.out.println("TestBug778213 failure count: " + count);

View Full Code Here

    }

    public static void main(String[] args) throws Exception {

        TestResult            result;
        TestCase              test;
        java.util.Enumeration exceptions;
        java.util.Enumeration failures;
        int                   count;

        result = new TestResult();
        test   = new TestBug785429("test");

        test.run(result);

        count = result.failureCount();

        System.out.println("TestBug785429 failure count: " + count);
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.