[JBoss JIRA] (JGRP-1725) JGroups testsuite output not processed correctly on Windows
by Richard Achmatowicz (JIRA)
[ https://issues.jboss.org/browse/JGRP-1725?page=com.atlassian.jira.plugin.... ]
Richard Achmatowicz commented on JGRP-1725:
-------------------------------------------
For a fix, I added some static code to the MyObject class which will choose a temporary filename which matches the OS type:
{noformat}
protected static class MyOutput extends PrintStream {
private static final String TMPFILE_NAME;
static {
if (Util.checkForWindows()) {
TMPFILE_NAME = System.getProperty("java.io.tmpdir") + "\\" + "tmp.txt";
} else {
TMPFILE_NAME = System.getProperty("java.io.tmpdir") + "/" + "tmp.txt";
}
}
final int type;
public MyOutput(int type) throws FileNotFoundException {
super(TMPFILE_NAME); // dummy name
this.type=type;
if(type != 1 && type != 2)
throw new IllegalArgumentException("index has to be 1 or 2");
}
...
{noformat}
> JGroups testsuite output not processed correctly on Windows
> -----------------------------------------------------------
>
> Key: JGRP-1725
> URL: https://issues.jboss.org/browse/JGRP-1725
> Project: JGroups
> Issue Type: Bug
> Affects Versions: 3.5
> Environment: Windows
> Reporter: Richard Achmatowicz
> Assignee: Bela Ban
> Fix For: 3.5
>
>
> When running the testsuite on Windows, testsuite output ends up on the console and not in the test case reports.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months
[JBoss JIRA] (JGRP-1725) JGroups testsuite output not processed correctly on Windows
by Richard Achmatowicz (JIRA)
[ https://issues.jboss.org/browse/JGRP-1725?page=com.atlassian.jira.plugin.... ]
Richard Achmatowicz commented on JGRP-1725:
-------------------------------------------
The problem here is in JUnitXMLReporter.
The classes MyOutput which are used to redirect System.out and System.err from test cases into per-test case files needs to initialise itself with a temporary file name. The file name hard-coded in the class is "/tmp/tmp.txt". On non-Windows hosts, this file name works fine; on Windows hosts, it causes the initialization of the redirection to fail with a FileNotFoundException:
{noformat}
public void onStart(ITestContext context) {
output_dir=context.getOutputDirectory();
// Uncomment to delete dir created by previous run of this testsuite
File dir=new File(output_dir);
if(dir.exists())
deleteContents(dir);
try {
System.setOut(new MyOutput(1));
System.setErr(new MyOutput(2));
}
catch(FileNotFoundException e) {
// EXCEPTION OCCURS HERE
}
}
{noformat}
Because the output redirection failed, all output goes to the console.
> JGroups testsuite output not processed correctly on Windows
> -----------------------------------------------------------
>
> Key: JGRP-1725
> URL: https://issues.jboss.org/browse/JGRP-1725
> Project: JGroups
> Issue Type: Bug
> Affects Versions: 3.5
> Environment: Windows
> Reporter: Richard Achmatowicz
> Assignee: Bela Ban
> Fix For: 3.5
>
>
> When running the testsuite on Windows, testsuite output ends up on the console and not in the test case reports.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months