Package org.codehaus.xharness.log

Examples of org.codehaus.xharness.log.LineBuffer


            assertEquals("Wrong message", "Task \"null\" not found!", be.getMessage());
        }
    }
   
    public void testEvalFalse() throws Exception {
        LineBuffer buffer = new LineBuffer(LogPriority.STDOUT);
        buffer.logLine("All good things must come to an end");
       
        MockControl prCtrl = MockClassControl.createNiceControl(Project.class);
        Project project = (Project)prCtrl.getMock();
       
        MockControl xhCtrl = MockClassControl.createNiceControl(XharnessTask.class);
View Full Code Here


        tlCtrl.verify();
        prCtrl.verify();
    }
   
    public void testEvalTrue() throws Exception {
        LineBuffer buffer = new LineBuffer(LogPriority.STDERR);
        buffer.logLine("All good things must come to an end");
        buffer.logLine("Beam me up, Scottie");
       
        MockControl prCtrl = MockClassControl.createNiceControl(Project.class);
        Project project = (Project)prCtrl.getMock();
       
        MockControl xhCtrl = MockClassControl.createNiceControl(XharnessTask.class);
View Full Code Here

                       server.getReceivedData());
    }

    public void testExecuteLogging() throws Exception {
        Project project = new Project();
        LineBuffer buffer = new LineBuffer();
       
        ProcessTester server = new ProcessTester();
       
        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM);
        task.createArg().setValue("-cp");
        task.createArg().setPath(new Path(project, getClassPath()));
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");
        task.enableLogging(buffer, 0, 1);
       
        task.execute();
        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        assertEquals("Wrong user dir", System.getProperty("user.dir"), server.getReceivedData());
        assertEquals("Wrong stderr", "Welcome stderr!", buffer.toString(1));
        String stdout = buffer.toString(0);
        assertTrue("Wrong stdout", stdout.startsWith("Welcome stdout!"));
        assertTrue("Wrong stdout", stdout.endsWith("...done. Exiting."));
    }
View Full Code Here

            assertEquals("Wrong message", "Task \"null\" not found!", be.getMessage());
        }
    }
   
    public void testLinesEqualsPass() throws Exception {
        LineBuffer buffer = new LineBuffer();
        buffer.logLine("All good things must come to an end");
       
        MockControl prCtrl = MockClassControl.createNiceControl(Project.class);
        Project project = (Project)prCtrl.getMock();
       
        MockControl xhCtrl = MockClassControl.createNiceControl(XharnessTask.class);
View Full Code Here

        tlCtrl.verify();
        prCtrl.verify();
    }
   
    public void testLinesEqualsFails() throws Exception {
        LineBuffer buffer = new LineBuffer();
        buffer.logLine("All good things must come to an end");
        buffer.logLine("Beam me up, Scottie");
       
        MockControl prCtrl = MockClassControl.createNiceControl(Project.class);
        Project project = (Project)prCtrl.getMock();
       
        MockControl xhCtrl = MockClassControl.createNiceControl(XharnessTask.class);
View Full Code Here

        tlCtrl.verify();
        prCtrl.verify();
    }
   
    public void testCharsEqualsPass() throws Exception {
        LineBuffer buffer = new LineBuffer();
        buffer.logLine("All good things must come to an end");
       
        MockControl prCtrl = MockClassControl.createNiceControl(Project.class);
        Project project = (Project)prCtrl.getMock();
       
        MockControl xhCtrl = MockClassControl.createNiceControl(XharnessTask.class);
View Full Code Here

        tlCtrl.verify();
        prCtrl.verify();
    }
   
    public void testCharsEqualsFails() throws Exception {
        LineBuffer buffer = new LineBuffer();
        buffer.logLine("All good things must come to an end");
       
        MockControl prCtrl = MockClassControl.createNiceControl(Project.class);
        Project project = (Project)prCtrl.getMock();
       
        MockControl xhCtrl = MockClassControl.createNiceControl(XharnessTask.class);
View Full Code Here

        tlCtrl.verify();
        prCtrl.verify();
    }
   
    public void testLinesLargerPass() throws Exception {
        LineBuffer buffer = new LineBuffer();
        buffer.logLine("All good things must come to an end");
        buffer.logLine("Beam me up, Scottie");
       
        MockControl prCtrl = MockClassControl.createNiceControl(Project.class);
        Project project = (Project)prCtrl.getMock();
       
        MockControl xhCtrl = MockClassControl.createNiceControl(XharnessTask.class);
View Full Code Here

        tlCtrl.verify();
        prCtrl.verify();
    }
   
    public void testLinesLargerFails() throws Exception {
        LineBuffer buffer = new LineBuffer();
        buffer.logLine("All good things must come to an end");
        buffer.logLine("Beam me up, Scottie");
       
        MockControl prCtrl = MockClassControl.createNiceControl(Project.class);
        Project project = (Project)prCtrl.getMock();
       
        MockControl xhCtrl = MockClassControl.createNiceControl(XharnessTask.class);
View Full Code Here

        tlCtrl.verify();
        prCtrl.verify();
    }
   
    public void testCharsLargerPass() throws Exception {
        LineBuffer buffer = new LineBuffer();
        buffer.logLine("All good things must come to an end");
       
        MockControl prCtrl = MockClassControl.createNiceControl(Project.class);
        Project project = (Project)prCtrl.getMock();
       
        MockControl xhCtrl = MockClassControl.createNiceControl(XharnessTask.class);
View Full Code Here

TOP

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

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.