@Test
 public void test2() {
   h.setPacketFactory(pf);
   h.setCards(TestDataProvider.getSmallCardList());
   h.setButtonsEnabled(true);
 }
 @Test
 public void test() {
   h.setCards(TestDataProvider.getSmallCardList());
 }
Example #3
0
 @Test
 public void test2() {
   t = new TablePanel();
   t.init(6);
   t.updateTable(TestDataProvider.getPlayingTestUIData());
 }
public class HandCardPanelTest {
  private TimedJLabel t;
  private HandCardPanel h;

  private PacketFactoryInterface pf = TestDataProvider.getPacketFactory();

  MouseEvent me =
      new MouseEvent(
          new JComponent() {
            private static final long serialVersionUID = 1L;

            @Override
            public String getName() {
              return "1_1";
            }
          },
          0,
          0,
          0,
          100,
          100,
          1,
          false);
  MouseEvent me_error =
      new MouseEvent(
          new JComponent() {
            private static final long serialVersionUID = 1L;

            @Override
            public String getName() {
              return "x_1";
            }
          },
          0,
          0,
          0,
          100,
          100,
          1,
          false);
  private Status status = new Status();

  @Before
  public void setUp() {
    t = new TimedJLabel(1000);
    h = new HandCardPanel(t, status);
  }

  @Test
  public void test() {
    h.setCards(TestDataProvider.getSmallCardList());
  }

  @Test
  public void test2() {
    h.setPacketFactory(pf);
    h.setCards(TestDataProvider.getSmallCardList());
    h.setButtonsEnabled(true);
  }

  @Test(expected = IllegalStateException.class)
  public void test3() {
    h.setPacketFactory(pf);
    h.setPacketFactory(pf);
  }

  @Test
  public void test4() {
    h.setPacketFactory(pf);
    h.setButtonsEnabled(true);
    h.getMouseListener().mouseClicked(me);
    h.getMouseListener().mouseEntered(me);
    h.getMouseListener().mouseExited(me);
    h.getMouseListener().mousePressed(me);
    h.getMouseListener().mouseReleased(me);
  }

  @Test
  public void test5() {
    h.setPacketFactory(pf);
    h.setButtonsEnabled(true);
    h.getMouseListener().mouseClicked(me_error);
  }

  @Test
  public void test6() {
    h.setPacketFactory(pf);
    h.getMouseListener().mouseClicked(me_error);
  }
}
Example #5
0
 @Test(expected = IllegalStateException.class)
 public void test() {
   t = new TablePanel();
   t.init(2);
   t.updateTable(TestDataProvider.getPlayingTestUIData());
 }