Skip to content

Commit

Permalink
Adding the test suffix to the testname
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Feb 10, 2012
1 parent 56ec291 commit 92ef0ce
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/org/jgroups/util/JUnitXMLReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected void onTestCompleted(ITestResult tr, String message, PrintStream out)
Class<?> real_class=tr.getTestClass().getRealClass();
addTest(real_class,tr);
print(out,message,real_class.getName(),getMethodName(tr));
closeStreams(real_class);
closeStreams();
}

protected void setupStreams(ITestResult result, boolean printMethodName) {
Expand Down Expand Up @@ -149,14 +149,11 @@ protected void setupStreams(ITestResult result, boolean printMethodName) {
}
}

protected static void closeStreams(Class<?> clazz) {
protected static void closeStreams() {
Util.close(stdout.get());
stdout.set(null);
Util.close(stderr.get());
stderr.set(null);
// DataOutputStream output=tests.get(clazz);
// Util.close(output);
// tests.remove(clazz);
}

protected static void print(PrintStream out, String msg, String classname, String method_name) {
Expand Down Expand Up @@ -271,8 +268,12 @@ protected static void process(File dir) throws IOException {
File parent=dir.getParentFile();
File xml_file=new File(parent, "TESTS-" + dir.getName() + "-" + parent.getName() + ".xml");
Writer out=new FileWriter(xml_file);
String classname=dir.getName();
String suffix=parent.getName();
if(suffix != null && suffix.length() > 0)
classname=classname + "-" + suffix;
try {
generateReport(out, dir.getName(), test_cases, stdout_reader, stderr_reader);
generateReport(out, classname, test_cases, stdout_reader, stderr_reader);
}
finally {
out.close();
Expand Down

0 comments on commit 92ef0ce

Please sign in to comment.