main.
*/ - @Test(timeOut = 1000) + @Test(groups = {"UnitTest", "fast"}, timeOut = 5000) public void GameActionTest1() throws Exception { System.out.println("GameActionTest"); GameAction gameAction = new GameAction(); diff --git a/src/test/java/forge/GuiBoosterDraftTest.java b/src/test/java/forge/GuiBoosterDraftTest.java index 59e6d4d9074..ca690a40a12 100644 --- a/src/test/java/forge/GuiBoosterDraftTest.java +++ b/src/test/java/forge/GuiBoosterDraftTest.java @@ -16,7 +16,7 @@ public class GuiBoosterDraftTest { * * */ - @Test() + @Test(groups = {"UnitTest", "fast"}) public void GuiBoosterDraftTest1() { Constant.Runtime.GameType[0] = Constant.GameType.Draft; Constant.Runtime.HumanDeck[0] = new Deck(Constant.GameType.Sealed); diff --git a/src/test/java/forge/GuiFilterTest.java b/src/test/java/forge/GuiFilterTest.java index cad480c45b9..304190c693c 100644 --- a/src/test/java/forge/GuiFilterTest.java +++ b/src/test/java/forge/GuiFilterTest.java @@ -3,8 +3,6 @@ package forge; import org.testng.Assert; import org.testng.annotations.Test; -import javax.swing.*; - /** * Created by IntelliJ IDEA. * User: dhudson @@ -15,11 +13,10 @@ public class GuiFilterTest { * * */ - @Test() + @Test(groups = {"UnitTest", "fast"}) public void guiFilterTest1() { try { GuiFilter dialog = new GuiFilter(null, null); - dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); dialog.setVisible(true); Assert.assertNotNull(dialog); dialog.dispose(); diff --git a/src/test/java/forge/GuiProgressBarWindowTest.java b/src/test/java/forge/GuiProgressBarWindowTest.java index 83825ace4cf..9a43806bf79 100644 --- a/src/test/java/forge/GuiProgressBarWindowTest.java +++ b/src/test/java/forge/GuiProgressBarWindowTest.java @@ -15,7 +15,7 @@ public class GuiProgressBarWindowTest { * * */ - @Test() + @Test(groups = {"UnitTest", "fast"}) public void GuiProgressBarWindowTest1() { try { Gui_ProgressBarWindow dialog = new Gui_ProgressBarWindow(); diff --git a/src/test/java/forge/GuiQuestFilterTest.java b/src/test/java/forge/GuiQuestFilterTest.java index 522b625b841..b33856bc8da 100644 --- a/src/test/java/forge/GuiQuestFilterTest.java +++ b/src/test/java/forge/GuiQuestFilterTest.java @@ -15,7 +15,7 @@ public class GuiQuestFilterTest { * * */ - @Test() + @Test(groups = {"UnitTest", "fast"}) public void guiQuestFilterTest1() { try { GuiQuestFilter dialog = new GuiQuestFilter(null, null); diff --git a/src/test/java/forge/GuiQuestOptionsTest.java b/src/test/java/forge/GuiQuestOptionsTest.java index e971f092528..571d2533481 100644 --- a/src/test/java/forge/GuiQuestOptionsTest.java +++ b/src/test/java/forge/GuiQuestOptionsTest.java @@ -13,7 +13,7 @@ public class GuiQuestOptionsTest { * * */ - @Test() + @Test(groups = {"UnitTest", "fast"}) public void GuiQuestOptionsTest1() { Gui_QuestOptions dialog = new Gui_QuestOptions(); dialog.setVisible(true); diff --git a/src/test/java/forge/GuiWinLoseTest.java b/src/test/java/forge/GuiWinLoseTest.java index e336fcec3ee..113bcfd4d69 100644 --- a/src/test/java/forge/GuiWinLoseTest.java +++ b/src/test/java/forge/GuiWinLoseTest.java @@ -1,7 +1,5 @@ package forge; -import forge.deck.Deck; - import org.testng.Assert; import org.testng.annotations.Test; @@ -9,13 +7,13 @@ import org.testng.annotations.Test; * Created by IntelliJ IDEA. * User: dhudson */ -@Test(groups = {"UnitTest"}) +@Test(groups = {"UnitTest", "fast"}) public class GuiWinLoseTest { /** * * */ - @Test() + @Test(groups = {"UnitTest", "fast"}) public void GuiWinLoseTest1() { Gui_WinLose dialog = new Gui_WinLose(); dialog.setVisible(true); diff --git a/src/test/java/forge/MoveTest.java b/src/test/java/forge/MoveTest.java deleted file mode 100644 index 69305343de7..00000000000 --- a/src/test/java/forge/MoveTest.java +++ /dev/null @@ -1,147 +0,0 @@ -package forge; - - -import org.testng.annotations.Test; - -import java.util.ArrayList; - - -/** - *MoveTest class.
- * - * @author Forge - * @version $Id$ - */ -@Test(groups = {"UnitTest"}, timeOut = 1000) -public class MoveTest { - - class MoveConcrete extends Move { - - private final int myNumber; - - /** - * ConstantclassNumber=-1
- */
- private int classNumber = -1;
- /**
- * Constant array=
- */
- private int[] array;
-
- /**
- * Constant classIndex=
- */
- private int classIndex;
- private int myIndex = -1;
-
- /**
- * Constructor for MoveTest.
- * - * @param i_array an array of int. - */ - public MoveConcrete(int i_array[]) { - this(); - - classIndex = 0; - array = i_array; - } - - /** - *Constructor for MoveTest.
- */ - public MoveConcrete() { - myNumber = classNumber; - classNumber++; - } - - /** - *Getter for the field classNumber.
Getter for the field myNumber.
test.
- */ - @Test(timeOut = 1000) - public void MoveTest1() { - MoveConcrete t; - - t = new MoveConcrete(new int[]{4, 1, 6, 3, 2, 7, 6, 9}); - test("1", t.max(t, 3, true) == 7); - - t = new MoveConcrete(new int[]{1, 2}); - test("2", t.max(t, 1, true) == 2); - - t = new MoveConcrete(new int[]{2, 1}); - test("3", t.max(t, 1, true) == 2); - - - t = new MoveConcrete(new int[]{1, 2, 3, 4}); - test("4", t.max(t, 2, true) == 3); - - t = new MoveConcrete(new int[]{2, 1, 4, 3}); - test("5", t.max(t, 2, true) == 3); - - t = new MoveConcrete(new int[]{4, 3, 1, 2}); - test("6", t.max(t, 2, true) == 3); - - t = new MoveConcrete(new int[]{3, 4, 2, 1}); - test("7", t.max(t, 2, true) == 3); - } - - /** - *test.
- * - * @param message a {@link java.lang.String} object. - * @param shouldBeTrue a boolean. - */ - public void test(String message, boolean shouldBeTrue) { - if (!shouldBeTrue) { - throw new RuntimeException(message); - } - } -} diff --git a/src/test/java/forge/PhaseTest.java b/src/test/java/forge/PhaseTest.java index 4695db27cd5..55329d50851 100644 --- a/src/test/java/forge/PhaseTest.java +++ b/src/test/java/forge/PhaseTest.java @@ -12,7 +12,7 @@ public class PhaseTest { * * */ - @Test(timeOut = 5000, enabled = false) + @Test(groups = {"UnitTest", "fast"}, timeOut = 5000, enabled = false) public void PhaseTest1() { Phase phase = new Phase(); for (int i = 0; i < phase.phaseOrder.length; i++) { diff --git a/src/test/java/forge/ReadQuestAssignmentTest.java b/src/test/java/forge/ReadQuestAssignmentTest.java index ed0d49d414d..9e426d40bbd 100644 --- a/src/test/java/forge/ReadQuestAssignmentTest.java +++ b/src/test/java/forge/ReadQuestAssignmentTest.java @@ -15,7 +15,7 @@ public class ReadQuestAssignmentTest implements NewConstants { * * */ - @Test(timeOut = 1000) + @Test(groups = {"UnitTest", "fast"}, timeOut = 1000) public void ReadQuestAssignmentTest1() { try { ReadQuest_Assignment read = new ReadQuest_Assignment(ForgeProps.getFile(QUEST.QUESTS), null); diff --git a/src/test/java/forge/TinyTest.java b/src/test/java/forge/TinyTest.java index f113bc31470..f128693fe0a 100644 --- a/src/test/java/forge/TinyTest.java +++ b/src/test/java/forge/TinyTest.java @@ -14,7 +14,7 @@ public class TinyTest { /** * Just a quick test to see if TestNG and Assert are working. */ - @Test() + @Test(groups = {"UnitTest", "fast"}) public void test_true() { Assert.assertTrue(true); } diff --git a/src/test/java/forge/card/cardFactory/CardFactoryTest.java b/src/test/java/forge/card/cardFactory/CardFactoryTest.java index a76005dc562..33b379a8793 100644 --- a/src/test/java/forge/card/cardFactory/CardFactoryTest.java +++ b/src/test/java/forge/card/cardFactory/CardFactoryTest.java @@ -21,7 +21,7 @@ import java.util.TreeSet; * @author Forge * @version $Id$ */ -@Test(groups = {"UnitTest"}) +@Test(groups = {"UnitTest"}, timeOut = 5000) public class CardFactoryTest implements NewConstants { private static CardFactoryInterface factory; @@ -35,7 +35,7 @@ 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) + @Test(enabled = true, timeOut = 5000) public final void test_getCard_1() { final Card card = factory.getCard("Arc-Slogger", null); Assert.assertNotNull(card, "card is not null"); @@ -47,7 +47,7 @@ public class CardFactoryTest implements NewConstants { * * This doesn't work with LazyCardFactory, so it is too slow to enable by default. */ - @Test(enabled = false) + @Test(enabled = false, timeOut = 5000) public final void test_getRandomCombinationWithoutRepetition_tooLarge() { BraidsAssertFunctions.assertThrowsException(IllegalArgumentException.class, new ClumsyRunnable() { @@ -70,7 +70,7 @@ public class CardFactoryTest implements NewConstants { * * This doesn't work with LazyCardFactory, so it is too slow to enable by default. */ - @Test(enabled = false) + @Test(enabled = false, timeOut = 5000) public final void test_getRandomCombinationWithoutRepetition_oneTenth() { int divisor = 10; final CardList actual = factory.getRandomCombinationWithoutRepetition(factory.size() / divisor); diff --git a/src/test/java/forge/card/mana/Mana_PartTest.java b/src/test/java/forge/card/mana/Mana_PartTest.java index fa2a41de061..b0a696e6a0e 100644 --- a/src/test/java/forge/card/mana/Mana_PartTest.java +++ b/src/test/java/forge/card/mana/Mana_PartTest.java @@ -15,7 +15,7 @@ public class Mana_PartTest { /** *testPayManaCost.
*/ - @Test + @Test(groups = {"UnitTest", "fast"}, timeOut = 5000) public void testPayManaCost() { { //test constructor diff --git a/src/test/java/forge/gui/ListChooserTest.java b/src/test/java/forge/gui/ListChooserTest.java index b64f7cb856a..b2e69ae3bae 100644 --- a/src/test/java/forge/gui/ListChooserTest.java +++ b/src/test/java/forge/gui/ListChooserTest.java @@ -12,7 +12,7 @@ public class ListChooserTest { * * */ - @Test(timeOut = 1000) + @Test(groups = {"UnitTest", "fast"}, timeOut = 1000) public void ListChooserTest1() { ListChooser