@@ -0,0 +1,1103 @@
+package hudson.tasks.junit;%0A%0Aimport hudson.maven.MavenModuleSet;%0Aimport hudson.maven.MavenModuleSetBuild;%0Aimport static hudson.model.Result.UNSTABLE;%0Aimport hudson.scm.SubversionSCM;%0Aimport hudson.tasks.test.AbstractTestResultAction;%0Aimport org.jvnet.hudson.test.HudsonTestCase;%0A%0A/**%0A * @author Kohsuke Kawaguchi%0A */%0Apublic class CaseResultTest extends HudsonTestCase %7B%0A    /**%0A     * Verifies that Hudson can capture the stdout/stderr output from Maven surefire.%0A     */%0A    public void testSurefireOutput() throws Exception %7B%0A        configureDefaultMaven();%0A        %0A        MavenModuleSet p = createMavenProject();%0A        p.setScm(new SubversionSCM(%22https://www.dev.java.net/svn/hudson/trunk/hudson/test-projects/junit-failure@16411%22));%0A        MavenModuleSetBuild b = assertBuildStatus(UNSTABLE,p.scheduleBuild2(0).get());%0A        AbstractTestResultAction%3C?%3E t = b.getTestResultAction();%0A        assertSame(1,t.getFailCount());%0A        CaseResult tc = t.getFailedTests().get(0);%0A        assertTrue(tc.getStderr().contains(%22stderr%22));%0A        assertTrue(tc.getStdout().contains(%22stdout%22));%0A    %7D%0A%7D%0A

test case for capturing output from Maven