Package org.codehaus.xharness.log

Examples of org.codehaus.xharness.log.TaskRegistry


        condition.setTask("foo");

        xhCtrl.replay();
        tlCtrl.replay();
        prCtrl.replay();
        TaskRegistry registry = null;
        try {
            registry = TaskRegistry.init(task);
            registry.setCurrentTest(new MockTestLogger(registry, logger));
            assertTrue("Condition evaled incorrectly", !condition.eval());
        } finally {
            MockTaskRegistry.reset();
        }
        xhCtrl.verify();
View Full Code Here


        condition.setStream(stream);

        xhCtrl.replay();
        tlCtrl.replay();
        prCtrl.replay();
        TaskRegistry registry = null;
        try {
            registry = TaskRegistry.init(task);
            registry.setCurrentTest(new MockTestLogger(registry, logger));
            assertTrue("Condition evaled incorrectly", condition.eval());
        } finally {
            MockTaskRegistry.reset();
        }
        xhCtrl.verify();
View Full Code Here

    public void execute() throws BuildException {
        if (resultsdir == null) {
            throw new BuildException("Required attribute \"resultsdir\" not set!");
        }

        TaskRegistry registry = TaskRegistry.init(this);
        BuildException exception = null;
        try {
            super.execute();
        } catch (BuildException be) {
            exception = be;
        } finally {
            registry.shutdown(exception);
            log("Completed " + toString(), Project.MSG_INFO);
        }
    }
View Full Code Here

        XharnessTask xhTask = new XharnessTask();
        xhTask.setName("bar");
        xhTask.setPattern("spam");
        xhTask.setProject(project);
        xhTask.setResultsdir(resultsDir);
        TaskRegistry registry = null;
        try {
            registry = TaskRegistry.init(xhTask);
            TestCaseTask test = new TestCaseTask();
            test.setProject(project);
            test.setName("foo");
           
            TestLogger logger = new TestLogger(registry, test, "foo", registry.getCurrentTest());
            registry.setCurrentTest(logger);
           
            MockControl ctrl = MockClassControl.createControl(Task.class);
            Task mock = (Task)ctrl.getMock();

            ctrl.replay();
            test.addTask(mock);
            try {
                test.execute();
                fail("Expected TestSkippedException");
            } catch (TestSkippedException tse) {
                assertEquals("Wrong message",
                             "testcase foo doesn't match pattern. Skipped.",
                             tse.getMessage());
            }
            ctrl.verify();
        } finally {
            if (registry != null) {
                registry.shutdown(null);
            }
            TempDir.removeFiles(resultsDir);
        }
       
    }
View Full Code Here

        XharnessTask xhTask = new XharnessTask();
        xhTask.setName("bar");
        xhTask.setPattern("spam");
        xhTask.setProject(project);
        xhTask.setResultsdir(resultsDir);
        TaskRegistry registry = null;
        try {
            registry = TaskRegistry.init(xhTask);
            TestGroupTask group = new TestGroupTask();
            group.setProject(project);
            group.setName("foo");
           
            TestLogger logger = new TestLogger(registry, group, "foo", registry.getCurrentTest());
            registry.setCurrentTest(logger);
           
            MockControl ctrl = MockClassControl.createControl(Task.class);
            Task mock = (Task)ctrl.getMock();
            mock.getProject();
            ctrl.setReturnValue(project, 2);
            mock.maybeConfigure();
            ctrl.setVoidCallable();
            mock.execute();
            ctrl.setVoidCallable();

            ctrl.replay();
            group.addTask(mock);
            group.execute();
            ctrl.verify();
        } finally {
            if (registry != null) {
                registry.shutdown(null);
            }
            TempDir.removeFiles(resultsDir);
        }
       
    }
View Full Code Here

        condition.setTask("foo");

        xhCtrl.replay();
        tlCtrl.replay();
        prCtrl.replay();
        TaskRegistry registry = null;
        try {
            registry = TaskRegistry.init(task);
            registry.setCurrentTest(new MockTestLogger(registry, logger));
            assertTrue("Condition evaled incorrectly", !condition.eval());
        } finally {
            MockTaskRegistry.reset();
        }
        xhCtrl.verify();
View Full Code Here

        condition.setStream(stream);

        xhCtrl.replay();
        tlCtrl.replay();
        prCtrl.replay();
        TaskRegistry registry = null;
        try {
            registry = TaskRegistry.init(task);
            registry.setCurrentTest(new MockTestLogger(registry, logger));
            assertTrue("Condition evaled incorrectly", condition.eval());
        } finally {
            MockTaskRegistry.reset();
        }
        xhCtrl.verify();
View Full Code Here

        condition.setStream(stream);

        xhCtrl.replay();
        tlCtrl.replay();
        prCtrl.replay();
        TaskRegistry registry = null;
        try {
            registry = TaskRegistry.init(task);
            registry.setCurrentTest(new MockTestLogger(registry, logger));
            assertTrue("Condition evaled incorrectly", condition.eval());
        } finally {
            MockTaskRegistry.reset();
        }
        xhCtrl.verify();
View Full Code Here

        condition.setTask("foo");

        xhCtrl.replay();
        tlCtrl.replay();
        prCtrl.replay();
        TaskRegistry registry = null;
        try {
            registry = TaskRegistry.init(task);
            registry.setCurrentTest(new MockTestLogger(registry, logger));
            assertTrue("Condition evaled incorrectly", !condition.eval());
        } finally {
            MockTaskRegistry.reset();
        }
        xhCtrl.verify();
View Full Code Here

        condition.setTask("foo");

        xhCtrl.replay();
        tlCtrl.replay();
        prCtrl.replay();
        TaskRegistry registry = null;
        try {
            registry = TaskRegistry.init(task);
            registry.setCurrentTest(new MockTestLogger(registry, logger));
            assertTrue("Condition evaled incorrectly", condition.eval());
        } finally {
            MockTaskRegistry.reset();
        }
        xhCtrl.verify();
View Full Code Here

TOP

Related Classes of org.codehaus.xharness.log.TaskRegistry

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.