Skip to content

Commit

Permalink
Issue #3378: Fixed TransaltionCheckTest to not depend on a specific o…
Browse files Browse the repository at this point in the history
…rdering of non-deterministic APIs
  • Loading branch information
Ben Lambeth authored and romani committed Aug 4, 2016
1 parent bcbcf28 commit ffceb9d
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -31,12 +31,14 @@
import java.nio.charset.StandardCharsets;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.stream.Collectors;

import com.google.common.base.Charsets;
import com.google.common.base.Predicate;
Expand Down Expand Up @@ -156,10 +158,13 @@ protected void verify(Checker checker,
try (LineNumberReader lnr = new LineNumberReader(
new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {

final List<String> actuals = lnr.lines().limit(expected.length)
.sorted().collect(Collectors.toList());
Arrays.sort(expected);

for (int i = 0; i < expected.length; i++) {
final String expectedResult = messageFileName + ":" + expected[i];
final String actual = lnr.readLine();
assertEquals("error message " + i, expectedResult, actual);
assertEquals("error message " + i, expectedResult, actuals.get(i));
}

assertEquals("unexpected output: " + lnr.readLine(),
Expand Down

0 comments on commit ffceb9d

Please sign in to comment.