From 33e32db4d41b2be295c10d0cb3ef736efec0c244 Mon Sep 17 00:00:00 2001 From: Ben Lambeth Date: Mon, 25 Jul 2016 23:18:40 -0500 Subject: [PATCH] Issue #3369: Changed 2 tests to not make assumptions about the order of HashMap (#3370) --- .../checks/indentation/IndentationCheckTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheckTest.java index 4473c36cb..3e9d52edf 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheckTest.java @@ -177,17 +177,23 @@ public class IndentationCheckTest extends BaseCheckTestSupport { @Test public void testGetRequiredTokens() { final IndentationCheck checkObj = new IndentationCheck(); + final int[] requiredTokens = checkObj.getRequiredTokens(); final HandlerFactory handlerFactory = new HandlerFactory(); final int[] expected = handlerFactory.getHandledTypes(); - assertArrayEquals(expected, checkObj.getRequiredTokens()); + Arrays.sort(expected); + Arrays.sort(requiredTokens); + assertArrayEquals(expected, requiredTokens); } @Test public void testGetAcceptableTokens() { final IndentationCheck checkObj = new IndentationCheck(); + final int[] acceptableTokens = checkObj.getAcceptableTokens(); final HandlerFactory handlerFactory = new HandlerFactory(); final int[] expected = handlerFactory.getHandledTypes(); - assertArrayEquals(expected, checkObj.getAcceptableTokens()); + Arrays.sort(expected); + Arrays.sort(acceptableTokens); + assertArrayEquals(expected, acceptableTokens); } @Test