Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
77 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,8 @@ | |||
|
|||
# Author: Bela Ban | |||
|
|||
#!/bin/bash | |||
|
|||
JG=$HOME/JGroups | |||
|
|||
jgroups.sh org.jgroups.util.DumpData $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,63 @@ | |||
package org.jgroups.util; | |||
|
|||
import java.io.DataInputStream; | |||
import java.io.File; | |||
import java.io.FileInputStream; | |||
import java.io.FileNotFoundException; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
|
|||
/** | |||
* Dumps the data (tests.data) generated by {@link JUnitXMLReporter} to stdout | |||
* @author Bela Ban | |||
* @since 3.1 | |||
*/ | |||
public class DumpData { | |||
public static void main(String[] args) throws FileNotFoundException { | |||
if(args.length == 0) { | |||
System.out.println("DumpData <tests.data>"); | |||
return; | |||
} | |||
|
|||
File file=new File(args[0]); | |||
if(!file.exists()) { | |||
System.err.println(file + " not found"); | |||
return; | |||
} | |||
List<JUnitXMLReporter.TestCase> test_cases=new ArrayList<JUnitXMLReporter.TestCase>(); | |||
DataInputStream input=new DataInputStream(new FileInputStream(file)); | |||
try { | |||
for(;;) { | |||
JUnitXMLReporter.TestCase test_case=new JUnitXMLReporter.TestCase(); | |||
try { | |||
test_case.readFrom(input); | |||
test_cases.add(test_case); | |||
} | |||
catch(Exception e) { | |||
break; | |||
} | |||
} | |||
} | |||
finally { | |||
Util.close(input); | |||
} | |||
|
|||
if(test_cases.isEmpty()) { | |||
System.err.println("No test cases found in " + file); | |||
return; | |||
} | |||
|
|||
int num_failures=JUnitXMLReporter.getFailures(test_cases); | |||
int num_skips=JUnitXMLReporter.getSkips(test_cases); | |||
int num_errors=JUnitXMLReporter.getErrors(test_cases); | |||
long total_time=JUnitXMLReporter.getTotalTime(test_cases); | |||
|
|||
int cnt=1; | |||
for(JUnitXMLReporter.TestCase test_case: test_cases) { | |||
System.out.println(cnt++ + ": " + test_case); | |||
} | |||
|
|||
System.out.println(Util.bold(test_cases.size() + " tests " + num_failures + " failures " + num_errors + | |||
" errors " + num_skips + " skips time=" + (total_time / 1000.0) + "\n")); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters