Skip to content

Commit

Permalink
Update StatelessXmlReporter.java
Browse files Browse the repository at this point in the history
Sort methodRunHistoryMap
  • Loading branch information
lanlingxueyu authored and nhojpatrick committed Mar 13, 2022
1 parent 68bca29 commit ce01353
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.LinkedHashMap;
import java.util.List;
Expand Down Expand Up @@ -151,7 +153,22 @@ public void testSetCompleted( WrappedReportEntry testSetReportEntry, TestSetStat

showProperties( ppw, testSetReportEntry.getSystemProperties() );

for ( Entry<String, Map<String, List<WrappedReportEntry>>> statistics : classMethodStatistics.entrySet() )
List<Entry<String, Map<String, List<WrappedReportEntry>>>> classMethodStatisticsEntries =
new ArrayList<>( classMethodStatistics.entrySet() );

Collections.sort( classMethodStatisticsEntries,
new Comparator<Entry<String, Map<String, List<WrappedReportEntry>>>>()
{
@Override
public int compare( Entry<String, Map<String, List<WrappedReportEntry>>> o1,
Entry<String, Map<String, List<WrappedReportEntry>>> o2 )
{
return o1.getKey().compareTo( o2.getKey() );
}
}
);

for ( Entry<String, Map<String, List<WrappedReportEntry>>> statistics : classMethodStatisticsEntries )
{
for ( Entry<String, List<WrappedReportEntry>> thisMethodRuns : statistics.getValue().entrySet() )
{
Expand Down

0 comments on commit ce01353

Please sign in to comment.