1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.webphotos.gui.component;
17
18 import org.junit.AfterClass;
19 import static org.junit.Assert.assertTrue;
20 import org.junit.Before;
21 import org.junit.BeforeClass;
22 import org.junit.Test;
23 import org.uispec4j.Trigger;
24 import org.uispec4j.UISpec4J;
25 import org.uispec4j.Window;
26 import org.uispec4j.interception.WindowHandler;
27 import org.uispec4j.interception.WindowInterceptor;
28
29
30
31
32
33 public class PainelPesquisaFrameTest extends javax.swing.JFrame {
34
35
36
37 public static PainelPesquisaFrameTest PAINEL_PESQUISA_FRAME_TEST;
38
39 static {
40 UISpec4J.init();
41 UISpec4J.setWindowInterceptionTimeLimit(30000);
42 }
43
44
45
46
47
48 @BeforeClass
49 public static void setUpClass() throws Exception {
50 }
51
52
53
54
55
56 @AfterClass
57 public static void tearDownClass() throws Exception {
58 PAINEL_PESQUISA_FRAME_TEST.dispose();
59 }
60
61
62
63
64 @Before
65 public void setUp() {
66 }
67
68
69
70
71 public PainelPesquisaFrameTest() {
72 super("PainelPesquisaFrameTest");
73 initComponents();
74 }
75
76
77
78
79
80
81 @SuppressWarnings("unchecked")
82
83 private void initComponents() {
84
85 painelPesquisaTest = new net.sf.webphotos.gui.component.PainelPesquisa();
86
87 setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
88
89 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
90 getContentPane().setLayout(layout);
91 layout.setHorizontalGroup(
92 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
93 .addGroup(layout.createSequentialGroup()
94 .addContainerGap()
95 .addComponent(painelPesquisaTest, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
96 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
97 );
98 layout.setVerticalGroup(
99 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
100 .addGroup(layout.createSequentialGroup()
101 .addContainerGap()
102 .addComponent(painelPesquisaTest, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
103 .addContainerGap(229, Short.MAX_VALUE))
104 );
105
106 pack();
107 }
108
109
110
111
112 @Test
113 public void testMain() {
114
115
116
117
118
119
120
121
122
123 try {
124 for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
125 if ("Nimbus".equals(info.getName())) {
126 javax.swing.UIManager.setLookAndFeel(info.getClassName());
127 break;
128 }
129 }
130 } catch (ClassNotFoundException ex) {
131 java.util.logging.Logger.getLogger(PainelPesquisaFrameTest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
132 } catch (InstantiationException ex) {
133 java.util.logging.Logger.getLogger(PainelPesquisaFrameTest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
134 } catch (IllegalAccessException ex) {
135 java.util.logging.Logger.getLogger(PainelPesquisaFrameTest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
136 } catch (javax.swing.UnsupportedLookAndFeelException ex) {
137 java.util.logging.Logger.getLogger(PainelPesquisaFrameTest.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
138 }
139
140
141 WindowInterceptor.init(new Trigger() {
142 @Override
143 public void run() {
144 PAINEL_PESQUISA_FRAME_TEST = new PainelPesquisaFrameTest();
145 PAINEL_PESQUISA_FRAME_TEST.setVisible(true);
146 }
147 }).process(new WindowHandler("PainelPesquisaFrameTest") {
148 @Override
149 public Trigger process(Window window) throws Exception {
150 assertTrue(window.titleContains("PainelPesquisaFrameTest").isTrue());
151 System.out.println("Tittle: " + window.getTitle());
152 return Trigger.DO_NOTHING;
153 }
154 }).run();
155 }
156
157 private net.sf.webphotos.gui.component.PainelPesquisa painelPesquisaTest;
158
159 }