- Reduce CheckStyle, FindBugs, and PMD output for recently changed files.

This commit is contained in:
Braids
2011-08-19 03:48:50 +00:00
parent fdb1199223
commit 664a535a47
5 changed files with 572 additions and 495 deletions

View File

@@ -22,11 +22,17 @@ import java.util.TreeSet;
* @author Forge
* @version $Id$
*/
@Test(groups = {"UnitTest"}, timeOut = 5000)
@Test(groups = {"UnitTest" }, timeOut = CardFactoryTest.DEFAULT_TEST_TIMEOUT_MS)
public class CardFactoryTest implements NewConstants {
private CardFactoryInterface factory;
/** The default time to allow a test to run before TestNG ignores it. */
public static final int DEFAULT_TEST_TIMEOUT_MS = 5000; // NOPMD by Braids on 8/18/11 11:43 PM
private transient CardFactoryInterface factory;
/**
* Executed before each test method, as in JUnit.
*/
@BeforeMethod
public final void setUp() {
OldGuiNewGame.loadDynamicGamedata();
@@ -37,8 +43,8 @@ public class CardFactoryTest implements NewConstants {
* Just a quick test to see if Arc-Slogger is in the database, and if it
* has the correct owner.
*/
@Test(enabled = true, timeOut = 5000)
public final void test_getCard_1() {
@Test(enabled = true, timeOut = DEFAULT_TEST_TIMEOUT_MS)
public final void test_getCard_1() { // NOPMD by Braids on 8/18/11 11:39 PM
final Card card = factory.getCard("Arc-Slogger", null);
Assert.assertNotNull(card, "card is not null");
Assert.assertNull(card.getOwner(), "card has correct owner");
@@ -47,19 +53,19 @@ public class CardFactoryTest implements NewConstants {
/**
* Make sure the method throws an exception when it's supposed to.
*/
@Test(enabled = true, timeOut = 5000)
public final void test_getRandomCombinationWithoutRepetition_tooLarge() {
@Test(enabled = true, timeOut = DEFAULT_TEST_TIMEOUT_MS)
public final void test_getRandomCombinationWithoutRepetition_tooLarge() { // NOPMD by Braids on 8/18/11 11:39 PM
BraidsAssertFunctions.assertThrowsException(IllegalArgumentException.class,
new ClumsyRunnable() {
public void run() throws Exception {
public void run() throws Exception { // NOPMD by Braids on 8/18/11 11:40 PM
factory.getRandomCombinationWithoutRepetition(factory.size());
}
});
BraidsAssertFunctions.assertThrowsException(IllegalArgumentException.class,
new ClumsyRunnable() {
public void run() throws Exception {
int largeDivisorForRandomCombo = 4;
public void run() throws Exception { // NOPMD by Braids on 8/18/11 11:40 PM
final int largeDivisorForRandomCombo = 4; // NOPMD by Braids on 8/18/11 11:41 PM
factory.getRandomCombinationWithoutRepetition(factory.size() / largeDivisorForRandomCombo);
}
});
@@ -70,10 +76,10 @@ public class CardFactoryTest implements NewConstants {
*
* This doesn't work with LazyCardFactory, so it is too slow to enable by default.
*/
@Test(enabled = false, timeOut = 5000)
public final void test_getRandomCombinationWithoutRepetition_oneTenth() {
@Test(enabled = false, timeOut = DEFAULT_TEST_TIMEOUT_MS)
public final void test_getRandomCombinationWithoutRepetition_oneTenth() { // NOPMD by Braids on 8/18/11 11:39 PM
factory = new PreloadingCardFactory(ForgeProps.getFile(CARDSFOLDER));
int divisor = 10;
final int divisor = 10; // NOPMD by Braids on 8/18/11 11:41 PM
final CardList actual = factory.getRandomCombinationWithoutRepetition(factory.size() / divisor);
final Set<String> cardNames = new TreeSet<String>();