Package junit.framework

Examples of junit.framework.TestResult.addListener()


        TestDescriptorInternal testInternal = new DefaultTestClassDescriptor(idGenerator.generateId(), testClassName);
        resultProcessor.started(testInternal, new TestStartEvent(timeProvider.getCurrentTime()));

        Test adapter = createTest(testClassName);
        TestResult result = new TestResult();
        result.addListener(listener);
        adapter.run(result);

        resultProcessor.completed(testInternal.getId(), new TestCompleteEvent(timeProvider.getCurrentTime()));
    }
View Full Code Here


                // - set the report location
                final File report = new File(this.reportDirectory, this.project.getArtifactId() + ".txt");
                formatter.setReportFile(report);
                final TestResult result = new TestResult();
                result.addListener(formatter);
                final Test suite = CartridgeTest.suite();
                formatter.startTestSuite(this.project.getName());
                suite.run(result);
                this.getLog().info("");
                this.getLog().info("Results:");
View Full Code Here

                // - set the report location
                final File report = new File(this.reportDirectory, this.getProject().getArtifactId() + ".txt");
                formatter.setReportFile(report);
                final TestResult result = new TestResult();
                formatter.startTestSuite(this.getProject().getName());
                result.addListener(formatter);
                processor.setResult(result);
                processor.runSuite();
                this.getLog().info("");
                this.getLog().info("Results:");
                this.getLog().info(formatter.endTestSuite());
View Full Code Here

                // - set the report location
                final File report = new File(this.reportDirectory, this.getProject().getArtifactId() + ".txt");
                formatter.setReportFile(report);
                final TestResult result = new TestResult();
                formatter.startTestSuite(this.getProject().getName());
                result.addListener(formatter);
                processor.setResult(result);
                processor.runSuite();
                this.getLog().info("");
                this.getLog().info("Results:");
                this.getLog().info(formatter.endTestSuite());
View Full Code Here

    con.add(asserterNode, RDF.TYPE, EARL.SOFTWARE);
    con.add(asserterNode, DC.TITLE, vf.createLiteral("OpenRDF SPARQL compliance test"));

    TestResult testResult = new TestResult();
    EarlTestListener listener = new EarlTestListener();
    testResult.addListener(listener);

    MemorySPARQLQueryTest.suite().run(testResult);
    SPARQLSyntaxTest.suite().run(testResult);

    con.commit();
View Full Code Here

         resultFormatter.startTestSuite(dummyJUnit);

         OutputStream writer = new FileOutputStream(new File(reportFile));
         resultFormatter.setOutput(writer);

         result.addListener(resultFormatter);

         TestSuite suite = new TestSuite();

        
         JUnitClientTest test = null;
View Full Code Here

                m_executeButton.setText("Running...");
                m_progress.setIndeterminate(true);
                model.clear();
                for (int i = 0; i < list.size(); i++) {
                    TestResult tr = new TestResult();
                    tr.addListener(new MyTestListener());
                    list.get(i).run(tr);
                }
                m_running = false;
                m_progress.setIndeterminate(false);
                m_progress.setMaximum(100);
View Full Code Here

    @Test
    public void generatedErrorTestsMatchUp() {
        junit.framework.Test shouldFail = fAdapter.getTests().get(0);
        TestResult result = new TestResult();
        ErrorRememberingListener listener = new ErrorRememberingListener();
        result.addListener(listener);
        fAdapter.run(result);
        assertNotNull(listener.getError());
        assertTrue(shouldFail == listener.getError());
    }
View Full Code Here

    public void testNotifyResult() {
        JUnit4TestAdapter adapter = new JUnit4TestAdapter(ErrorTest.class);
        TestResult result = new TestResult();
        final StringBuffer log = new StringBuffer();
        result.addListener(new TestListener() {

            public void startTest(junit.framework.Test test) {
                log.append(" start ").append(test);
            }
View Full Code Here

            XMLReport report = new XMLReport();
            String name = getTestName(test);
            System.out.println("Running " + name);

            TestResult tr = new TestResult();
            tr.addListener(new ResultListener(report));
            test.run(tr);
            m_results.add(tr);

            if (tr.wasSuccessful()) {
                System.out.println("Tests run: "
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.