Package org.codehaus.xharness.exceptions

Examples of org.codehaus.xharness.exceptions.AssertionWarningException


        nested.setName("foo");

        MockControl ukeCtrl = MockClassControl.createControl(UnknownElement.class);
        UnknownElement mockUke = getMockUnknownElement(ukeCtrl,
                                                       nested,
                                                       new AssertionWarningException());

        ukeCtrl.replay();
        group.addTask(mockUke);
        group.execute();
        ukeCtrl.verify();
View Full Code Here


            log(msg, Project.MSG_INFO);
            throw new TestSkippedException(msg, true);
        }
        log("Performing " + toString(), Project.MSG_INFO);
        BuildException error = null;
        AssertionWarningException warning = null;
        Iterator iter = children.iterator();
        while (iter.hasNext()) {
            Task currentTask = (Task)iter.next();

            try {
                currentTask.perform();
            } catch (TestSkippedException ex) {
                currentTask = unwrapTask(currentTask);
                if (!(currentTask instanceof TestGroupTask)) {
                    throw ex;
                }
            } catch (AssertionWarningException ex) {
                if (ex.getMessage() != null) {
                    log(ex.getMessage(), Project.MSG_ERR);
                } else {
                    StringWriter sw = new StringWriter();
                    ex.printStackTrace(new PrintWriter(sw, true));
                    log(sw.toString(), Project.MSG_ERR);
                   
                }
                if (warning == null) {
                    TaskRegistry.setErrorProperty(ex);
                    currentTask = unwrapTask(currentTask);
                    if (currentTask instanceof ServiceDef) {
                        String name = ((ServiceDef)currentTask).getName();
                        warning = new AssertionWarningException("Warning in Service " + name, ex);
                    } else if (currentTask instanceof ServiceInstance) {
                        String name = currentTask.getTaskName();
                        warning = new AssertionWarningException("Warning in Service " + name, ex);
                    } else if (currentTask instanceof TestGroupTask) {
                        String name = ((TestGroupTask)currentTask).getName();
                        if (currentTask instanceof TestCaseTask) {
                            warning = new AssertionWarningException("Warning in Testcase " + name,
                                                                    ex);
                        } else if (failOnError()) {
                            warning = new AssertionWarningException("Warning in Testgroup " + name,
                                                                    ex);
                        }
                    } else {
                        String name = currentTask.getTaskName();
                        warning = new AssertionWarningException("Warning in Task " + name, ex);
                    }
                }
            } catch (Exception ex) {
                if (ex instanceof BuildException && ex.getMessage() != null) {
                    log(ex.getMessage(), Project.MSG_ERR);
View Full Code Here

            try {
                nestedStart.perform();
                state = RUNNING;
            } catch (AssertionWarningException ex) {
                state = WARNING;
                throw new AssertionWarningException("Assertion failed during startup of Service.");
            } catch (BuildException ex) {
                state = FAILED;
                throw new BuildException("Startup of Service failed.");
            } finally {
                if (state != RUNNING) {
View Full Code Here

                log("Stopping service " + getName(), Project.MSG_INFO);
                nestedStop.perform();
            }
        } catch (AssertionWarningException ex) {
            log("Stop of service " + getName() + " failed", Project.MSG_INFO);
            throw new AssertionWarningException("Assertion failed during shutdown of Service.");
        } catch (BuildException ex) {
            log("Stop of service " + getName() + " failed", Project.MSG_INFO);
            throw new BuildException("Shutdown of Service failed.");
        } finally {
            int prevState = state;
            state = STOPPED;
            if (prevState == FAILED) {
                throw new BuildException("Startup of Service failed.");
            }
            if (prevState == WARNING) {
                throw new AssertionWarningException("Assertion failed during startup of Service.");
            }
        }
    }
View Full Code Here

                }
                log(msg, Project.MSG_ERR);
                if (erroronfail) {
                    throw new BuildException(message);
                }
                throw new AssertionWarningException(message);
            }
        } while (true);
    }
View Full Code Here

        MockControl evCtrl = MockClassControl.createControl(BuildEvent.class);
        BuildEvent event = (BuildEvent)evCtrl.getMock();
        event.getTask();
        evCtrl.setReturnValue(task, 3);
        event.getException();
        evCtrl.setReturnValue(new AssertionWarningException());
       
        prCtrl.replay();
        trCtrl.replay();
        tkCtrl.replay();
        evCtrl.replay();
View Full Code Here

TOP

Related Classes of org.codehaus.xharness.exceptions.AssertionWarningException

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.