8
import java.awt.event.ActionEvent;
10
import javax.swing.JPanel;
12
import junit.framework.TestCase;
13
import latexDraw.ui.components.CloseButton;
15
import org.junit.Before;
16
import org.junit.Test;
21
* This class contains tests on the class CloseButton.<br>
23
* This file is part of LaTeXDraw<br>
24
* Copyright (c) 2005-2008 Arnaud BLOUIN<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>
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>
37
* @author Arnaud BLOUIN<br>
40
@SuppressWarnings("nls")
41
public class TestCloseButton extends TestCase
44
private CloseButton cb;
46
private final JPanel panel = new JPanel();
55
cb = new CloseButton(panel);
60
public void testConstructor()
62
new CloseButton(null);
70
public void testActionPerformed()
72
ActionEvent e = new ActionEvent(cb, 0, "");
73
cb.actionPerformed(e);
74
System.out.println(panel.isVisible());
75
assertFalse(panel.isVisible());