~ubuntu-branches/debian/squeeze/latexdraw/squeeze

« back to all changes in this revision

Viewing changes to junit/test/TestCloseButton.java

  • Committer: Bazaar Package Importer
  • Author(s): Stuart Prescott
  • Date: 2009-05-03 23:49:35 UTC
  • Revision ID: james.westby@ubuntu.com-20090503234935-cls7n48x018g0vk2
Tags: upstream-2.0.2+1
ImportĀ upstreamĀ versionĀ 2.0.2+1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * TestCloseButton.java
 
3
 */
 
4
 
 
5
package junit.test;
 
6
 
 
7
 
 
8
import java.awt.event.ActionEvent;
 
9
 
 
10
import javax.swing.JPanel;
 
11
 
 
12
import junit.framework.TestCase;
 
13
import latexDraw.ui.components.CloseButton;
 
14
 
 
15
import org.junit.Before;
 
16
import org.junit.Test;
 
17
 
 
18
 
 
19
 
 
20
/** 
 
21
 * This class contains tests on the class CloseButton.<br>
 
22
 * <br>
 
23
 * This file is part of LaTeXDraw<br>
 
24
 * Copyright (c) 2005-2008 Arnaud BLOUIN<br>
 
25
 *<br>
 
26
 *  LaTeXDraw is free software; you can redistribute it and/or modify
 
27
 *  it under the terms of the GNU General Public License as published by
 
28
 *  the Free Software Foundation; either version 2 of the License, or
 
29
 *  any later version.<br>
 
30
 *<br>
 
31
 *  LaTeXDraw is distributed without any warranty; without even the 
 
32
 *  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
 
33
 *  PURPOSE. See the GNU General Public License for more details.<br>
 
34
 * 
 
35
 * <br>
 
36
 * 06/26/07<br>
 
37
 * @author Arnaud BLOUIN<br>
 
38
 * @version 2.0.0<br>
 
39
 */
 
40
@SuppressWarnings("nls")
 
41
public class TestCloseButton extends TestCase
 
42
{
 
43
 
 
44
        private CloseButton             cb;
 
45
 
 
46
        private final JPanel    panel   = new JPanel();
 
47
 
 
48
 
 
49
 
 
50
 
 
51
        @Override
 
52
        @Before
 
53
        public void setUp()
 
54
        {
 
55
                cb = new CloseButton(panel);
 
56
        }
 
57
        
 
58
 
 
59
        @Test
 
60
        public void testConstructor()
 
61
        {
 
62
                new CloseButton(null);
 
63
        }
 
64
 
 
65
 
 
66
 
 
67
 
 
68
 
 
69
        @Test
 
70
        public void testActionPerformed()
 
71
        {
 
72
                ActionEvent e = new ActionEvent(cb, 0, "");
 
73
                cb.actionPerformed(e);
 
74
                System.out.println(panel.isVisible());
 
75
                assertFalse(panel.isVisible());
 
76
        }
 
77
 
 
78
}