@@ -58,9 +58,9 @@ public class ParallelTest extends BuildFileTest {
/** tests basic operation of the parallel task */
/** tests basic operation of the parallel task */
public void testBasic() {
public void testBasic() {
// should get no output at all
// should get no output at all
Project project = getProject();
project .setUserProperty("test.direct", DIRECT_MESSAGE);
project .setUserProperty("test.delayed", DELAYED_MESSAGE);
Project p = getProject();
p.setUserProperty("test.direct", DIRECT_MESSAGE);
p.setUserProperty("test.delayed", DELAYED_MESSAGE);
expectOutputAndError("testBasic", "", "");
expectOutputAndError("testBasic", "", "");
String log = getLog();
String log = getLog();
assertEquals("parallel tasks didn't output correct data", log,
assertEquals("parallel tasks didn't output correct data", log,
@@ -71,9 +71,9 @@ public class ParallelTest extends BuildFileTest {
/** tests basic operation of the parallel task */
/** tests basic operation of the parallel task */
public void testThreadCount() {
public void testThreadCount() {
// should get no output at all
// should get no output at all
Project project = getProject();
project .setUserProperty("test.direct", DIRECT_MESSAGE);
project .setUserProperty("test.delayed", DELAYED_MESSAGE);
Project p = getProject();
p.setUserProperty("test.direct", DIRECT_MESSAGE);
p.setUserProperty("test.delayed", DELAYED_MESSAGE);
expectOutputAndError("testThreadCount", "", "");
expectOutputAndError("testThreadCount", "", "");
String log = getLog();
String log = getLog();
int pos = 0;
int pos = 0;
@@ -126,24 +126,24 @@ public class ParallelTest extends BuildFileTest {
/** tests the failure of a task within a parallel construction */
/** tests the failure of a task within a parallel construction */
public void testFail() {
public void testFail() {
// should get no output at all
// should get no output at all
Project project = getProject();
project .setUserProperty("test.failure", FAILURE_MESSAGE);
project .setUserProperty("test.delayed", DELAYED_MESSAGE);
Project p = getProject();
p.setUserProperty("test.failure", FAILURE_MESSAGE);
p.setUserProperty("test.delayed", DELAYED_MESSAGE);
expectBuildExceptionContaining("testFail",
expectBuildExceptionContaining("testFail",
"fail task in one parallel branch", FAILURE_MESSAGE);
"fail task in one parallel branch", FAILURE_MESSAGE);
}
}
/** tests the demuxing of output streams in a multithreaded situation */
/** tests the demuxing of output streams in a multithreaded situation */
public void testDemux() {
public void testDemux() {
Project project = getProject();
project .addTaskDefinition("demuxtest", DemuxOutputTask.class);
Project p = getProject();
p.addTaskDefinition("demuxtest", DemuxOutputTask.class);
PrintStream out = System.out;
PrintStream out = System.out;
PrintStream err = System.err;
PrintStream err = System.err;
System.setOut(new PrintStream(new DemuxOutputStream(project , false)));
System.setErr(new PrintStream(new DemuxOutputStream(project , true)));
System.setOut(new PrintStream(new DemuxOutputStream(p, false)));
System.setErr(new PrintStream(new DemuxOutputStream(p, true)));
try {
try {
project .executeTarget("testDemux");
p.executeTarget("testDemux");
} finally {
} finally {
System.setOut(out);
System.setOut(out);
System.setErr(err);
System.setErr(err);