From c09a1ecf33f1ab0451bdf8686ceb240cef4c4496 Mon Sep 17 00:00:00 2001 From: Ruslan Diachenko Date: Wed, 15 Jul 2015 01:03:29 +0100 Subject: [PATCH] Issue #1289: 'EmptyForIteratorPadCheck' UT coverage improved --- pom.xml | 1 - .../EmptyForIteratorPadCheckTest.java | 24 ++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 2e609a106..180b34285 100644 --- a/pom.xml +++ b/pom.xml @@ -1203,7 +1203,6 @@ .*.checks.whitespace.AbstractParenPadCheck88100 .*.checks.whitespace.EmptyForInitializerPadCheck9193 - .*.checks.whitespace.EmptyForIteratorPadCheck10092 .*.checks.whitespace.EmptyLineSeparatorCheck9598 .*.checks.whitespace.GenericWhitespaceCheck8696 .*.checks.whitespace.NoWhitespaceAfterCheck9498 diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheckTest.java index e6888cd0b..68e93d742 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheckTest.java @@ -19,15 +19,16 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace; -import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport; -import com.puppycrawl.tools.checkstyle.DefaultConfiguration; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck.WS_FOLLOWED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck.WS_NOT_FOLLOWED; + +import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck -.WS_FOLLOWED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck -.WS_NOT_FOLLOWED; +import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport; +import com.puppycrawl.tools.checkstyle.DefaultConfiguration; +import com.puppycrawl.tools.checkstyle.api.TokenTypes; public class EmptyForIteratorPadCheckTest extends BaseCheckTestSupport { @@ -55,4 +56,15 @@ public class EmptyForIteratorPadCheckTest }; verify(checkConfig, getPath("InputForWhitespace.java"), expected); } + + @Test + public void testGetAcceptableTokens() { + EmptyForIteratorPadCheck emptyForIteratorPadCheckObj = new EmptyForIteratorPadCheck(); + int[] actual = emptyForIteratorPadCheckObj.getAcceptableTokens(); + int[] expected = new int[] { + TokenTypes.FOR_ITERATOR, + }; + Assert.assertNotNull(actual); + Assert.assertArrayEquals(expected, actual); + } }