1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 package wjhk.jupload2.testhelpers;
27
28 import java.awt.event.ActionListener;
29 import java.awt.event.MouseEvent;
30 import java.awt.event.MouseListener;
31
32 import javax.swing.JButton;
33 import javax.swing.JComponent;
34 import javax.swing.JLabel;
35 import javax.swing.JPanel;
36 import javax.swing.JProgressBar;
37 import javax.swing.JScrollPane;
38 import javax.swing.TransferHandler;
39
40 import org.apache.log4j.Logger;
41
42 import wjhk.jupload2.gui.DnDListener;
43 import wjhk.jupload2.gui.JUploadPanel;
44 import wjhk.jupload2.gui.filepanel.FilePanel;
45 import wjhk.jupload2.upload.FileUploadManagerThread;
46
47
48
49
50 public class JUploadPanelTestHelper implements JUploadPanel, MouseListener {
51
52 protected final Logger logger = Logger.getLogger(getClass());
53
54
55 public FilePanel filePanel = null;
56
57
58 public FileUploadManagerThread fileUploadManagerThread = null;
59
60
61 public JProgressBar preparationProgressBar = new JProgressBar();
62
63
64 public JProgressBar uploadProgressBar = new JProgressBar();
65
66
67 public JLabel statusLabel = new JLabel("JUpload applet (in JUnit tests)");
68
69
70
71
72 public JUploadPanelTestHelper(FilePanel filePanel) {
73 this.filePanel = filePanel;
74 }
75
76
77
78
79 public void clearLogWindow() {
80 throw new UnsupportedOperationException(this.getClass() + ".clearLogWindow() is not implemented in tests cases");
81 }
82
83
84
85
86 public void copyLogWindow() {
87 throw new UnsupportedOperationException(this.getClass() + ".copyLogWindow() is not implemented in tests cases");
88 }
89
90
91
92
93 public void doBrowse() {
94 throw new UnsupportedOperationException(this.getClass() + ".doBrowse() is not implemented in tests cases");
95 }
96
97
98
99
100 public void doRemove() {
101 throw new UnsupportedOperationException(this.getClass() + ".doRemove() is not implemented in tests cases");
102 }
103
104
105
106
107 public void doRemoveAll() {
108 throw new UnsupportedOperationException(this.getClass() + ".doRemoveAll() is not implemented in tests cases");
109 }
110
111
112
113
114 public void doStartUpload() {
115 throw new UnsupportedOperationException(this.getClass() + ".doStartUpload() is not implemented in tests cases");
116 }
117
118
119
120
121 public void doStopUpload() {
122 throw new UnsupportedOperationException(this.getClass() + ".doStopUpload() is not implemented in tests cases");
123 }
124
125
126
127
128 public ActionListener getActionListener() {
129 throw new UnsupportedOperationException(this.getClass()
130 + ".getActionListener() is not implemented in tests cases");
131 }
132
133
134
135
136 public JButton getBrowseButton() {
137 throw new UnsupportedOperationException(this.getClass()
138 + ".getBrowseButton() is not implemented in tests cases");
139 }
140
141
142
143
144 public DnDListener getDndListener() {
145 throw new UnsupportedOperationException(this.getClass() + ".getDndListener() is not implemented in tests cases");
146 }
147
148
149
150
151 public FilePanel getFilePanel() {
152 return this.filePanel;
153 }
154
155
156
157
158 public FileUploadManagerThread getFileUploadManagerThread() {
159 return this.fileUploadManagerThread;
160 }
161
162
163
164
165 public JComponent getJComponent() {
166 throw new UnsupportedOperationException(this.getClass() + ".getJComponent() is not implemented in tests cases");
167 }
168
169
170
171
172 public JScrollPane getJLogWindowPane() {
173 throw new UnsupportedOperationException(this.getClass()
174 + ".getJLogWindowPane() is not implemented in tests cases");
175 }
176
177
178
179
180 public MouseListener getMouseListener() {
181 return this;
182 }
183
184
185
186
187 public JProgressBar getPreparationProgressBar() {
188 return this.preparationProgressBar;
189 }
190
191
192
193
194 public JButton getRemoveAllButton() {
195 throw new UnsupportedOperationException(this.getClass()
196 + ".getRemoveAllButton() is not implemented in tests cases");
197 }
198
199
200
201
202 public JButton getRemoveButton() {
203 throw new UnsupportedOperationException(this.getClass()
204 + ".getRemoveButton() is not implemented in tests cases");
205 }
206
207
208
209
210 public JLabel getStatusLabel() {
211 return this.statusLabel;
212 }
213
214
215
216
217 public JButton getStopButton() {
218 throw new UnsupportedOperationException(this.getClass() + ".getStopButton() is not implemented in tests cases");
219 }
220
221
222
223
224 public TransferHandler getTransferHandler() {
225 JPanel jp = new JPanel();
226 return jp.getTransferHandler();
227 }
228
229
230
231
232 public JButton getUploadButton() {
233 throw new UnsupportedOperationException(this.getClass()
234 + ".getUploadButton() is not implemented in tests cases");
235 }
236
237
238
239
240 public JProgressBar getUploadProgressBar() {
241 return this.uploadProgressBar;
242 }
243
244
245
246
247 public boolean maybeOpenPopupMenu(MouseEvent mouseEvent) {
248 throw new UnsupportedOperationException(this.getClass()
249 + ".maybeOpenPopupMenu() is not implemented in tests cases");
250 }
251
252
253
254
255 public void setFilePanel(FilePanel filePanel) {
256 throw new UnsupportedOperationException(this.getClass() + ".setFilePanel() is not implemented in tests cases");
257 }
258
259
260
261
262 public void showOrHideLogWindow() {
263 this.logger.warn(this.getClass() + ".showOrHideLogWindow() is not implemented in tests cases");
264 }
265
266
267
268
269 public void updateButtonState() {
270 this.logger.warn(this.getClass() + ".updateButtonState() is not implemented in tests cases");
271 }
272
273 public void mouseClicked(MouseEvent e) {
274
275
276 }
277
278 public void mousePressed(MouseEvent e) {
279
280
281 }
282
283 public void mouseReleased(MouseEvent e) {
284
285
286 }
287
288 public void mouseEntered(MouseEvent e) {
289
290
291 }
292
293 public void mouseExited(MouseEvent e) {
294
295
296 }
297
298 }