Issue #3369: Changed 2 tests to not make assumptions about the order of HashMap (#3370)

This commit is contained in:
Ben Lambeth 2016-07-25 23:18:40 -05:00 committed by Roman Ivanov
parent 4ecd2193dd
commit 33e32db4d4
1 changed files with 8 additions and 2 deletions

View File

@ -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