KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > verifier > gui > ResultsPanel


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.tools.verifier.gui;
24
25
26 import javax.swing.BorderFactory JavaDoc;
27 import javax.swing.DefaultCellEditor JavaDoc;
28 import javax.swing.JPanel JavaDoc;
29 import javax.swing.JScrollBar JavaDoc;
30 import javax.swing.JScrollPane JavaDoc;
31 import javax.swing.JTable JavaDoc;
32 import javax.swing.JTextArea JavaDoc;
33 import javax.swing.JTextField JavaDoc;
34 import javax.swing.ListSelectionModel JavaDoc;
35 import javax.swing.event.ListSelectionEvent JavaDoc;
36 import javax.swing.event.ListSelectionListener JavaDoc;
37 import javax.swing.table.DefaultTableModel JavaDoc;
38
39 import java.awt.BorderLayout JavaDoc;
40 import java.awt.Color JavaDoc;
41 import java.awt.event.ActionEvent JavaDoc;
42 import java.awt.event.ActionListener JavaDoc;
43 import java.util.Enumeration JavaDoc;
44 import java.util.EventObject JavaDoc;
45 import java.util.Vector JavaDoc;
46 import java.util.logging.LogRecord JavaDoc;
47
48 import com.sun.enterprise.tools.verifier.CheckMgr;
49 import com.sun.enterprise.tools.verifier.Result;
50 import com.sun.enterprise.tools.verifier.StringManagerHelper;
51 import com.sun.enterprise.tools.verifier.VerifierEventsListener;
52 import com.sun.enterprise.tools.verifier.util.VerifierConstants;
53
54 public class ResultsPanel extends JPanel JavaDoc implements VerifierEventsListener {
55
56     JTable JavaDoc table;
57     DefaultTableModel JavaDoc tableModel;
58     JScrollPane JavaDoc tableScrollPane;
59     JScrollPane JavaDoc textScrollPane;
60     JTextArea JavaDoc detailText;
61     Vector JavaDoc<String JavaDoc> details = new Vector JavaDoc<String JavaDoc>();
62     private static Vector JavaDoc<Result> passResults = new Vector JavaDoc<Result>();
63     private static Vector JavaDoc<Result> failResults = new Vector JavaDoc<Result>();
64     private static Vector JavaDoc<LogRecord JavaDoc> errorResults = new Vector JavaDoc<LogRecord JavaDoc>();
65     private static Vector JavaDoc<Result> warnResults = new Vector JavaDoc<Result>();
66     private static Vector JavaDoc<Result> naResults = new Vector JavaDoc<Result>();
67     private static Vector JavaDoc<Result> notImplementedResults = new Vector JavaDoc<Result>();
68     private static Vector JavaDoc<Result> notRunResults = new Vector JavaDoc<Result>();
69     private static Vector JavaDoc<Result> defaultResults = new Vector JavaDoc<Result>();
70     static com.sun.enterprise.util.LocalStringManagerImpl smh =
71             StringManagerHelper.getLocalStringsManager();
72
73     //final String[] columnNames = {"Item", "Test Name", "Result"};
74
final String JavaDoc[] columnNames = {
75         (smh.getLocalString(
76                 "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
77
".columnName1", // NOI18N
78
"Item")), // NOI18N
79
(smh.getLocalString(
80                 "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
81
".columnName2", // NOI18N
82
"Test Name")), // NOI18N
83
(smh.getLocalString(
84                 "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
85
".columnName3", // NOI18N
86
"Result"))}; // NOI18N
87
final String JavaDoc errStr = smh.getLocalString(getClass().getName()+".errStr", // NOI18N
88
"Error during verification"); // NOI18N
89
final String JavaDoc errStr1 = smh.getLocalString(getClass().getName()+".errStr1", // NOI18N
90
"ERROR"); // NOI18N
91

92
93     public ResultsPanel() {
94
95         setLayout(new BorderLayout JavaDoc());
96         setBorder(
97                 BorderFactory.createTitledBorder(
98                         BorderFactory.createLineBorder(Color.black),
99                         (smh.getLocalString(
100                                 "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
101
".ResultsPanelLabel", // NOI18N
102
"Results: (Click on Item to show test Details below)")))); // NOI18N
103

104         // 508 compliance
105
this.getAccessibleContext().setAccessibleName(
106                 smh.getLocalString(
107                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
108
".panelName", // NOI18N
109
"Panel")); // NOI18N
110
this.getAccessibleContext().setAccessibleDescription(
111                 smh.getLocalString(
112                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
113
".PanelDesc", // NOI18N
114
"This is a panel")); // NOI18N
115

116         CheckMgr.addVerifierEventsListener(this);
117
118         // set up result table
119
tableModel = new DefaultTableModel JavaDoc(columnNames, 0);
120         table = new JTable JavaDoc(tableModel);
121         // 508 for JTable
122
table.getAccessibleContext().setAccessibleName(
123                 smh.getLocalString(
124                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
125
".tableName", // NOI18N
126
"Table")); // NOI18N
127
table.getAccessibleContext().setAccessibleDescription(
128                 smh.getLocalString(
129                         "com.sun.enterprise.tools.verifier.gui.ControlPanel" + // NOI18N
130
".tableDesc", // NOI18N
131
"This is a table of items")); // NOI18N
132
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
133         tableScrollPane = new JScrollPane JavaDoc(table);
134         // 508 for JScrollPane
135
tableScrollPane.getAccessibleContext().setAccessibleName(
136                 smh.getLocalString(
137                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
138
".scrName1", // NOI18N
139
"Scroll Pane")); // NOI18N
140
tableScrollPane.getAccessibleContext().setAccessibleDescription(
141                 smh.getLocalString(
142                         "com.sun.enterprise.tools.verifier.gui.ControlPanel" + // NOI18N
143
".scrDesc1", // NOI18N
144
"This is a scroll pane that helps to scroll the list")); // NOI18N
145
sizeTableColumns();
146         // make the cells uneditable
147
JTextField JavaDoc field = new JTextField JavaDoc();
148         // 508 for JTextField
149
field.getAccessibleContext().setAccessibleName(
150                 smh.getLocalString(
151                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
152
".fielsName", // NOI18N
153
"Text Field")); // NOI18N
154
field.getAccessibleContext().setAccessibleDescription(
155                 smh.getLocalString(
156                         "com.sun.enterprise.tools.verifier.gui.ControlPanel" + // NOI18N
157
".fieldDesc", // NOI18N
158
"This is a text field")); // NOI18N
159
table.setDefaultEditor(Object JavaDoc.class, new DefaultCellEditor JavaDoc(field) {
160             public boolean isCellEditable(EventObject JavaDoc anEvent) {
161                 return false;
162             }
163         });
164         // add action listener to table to show details
165
table.getSelectionModel().addListSelectionListener(new ListSelectionListener JavaDoc() {
166             public void valueChanged(ListSelectionEvent JavaDoc e) {
167                 if (!e.getValueIsAdjusting()) {
168                     if (table.getSelectionModel().isSelectedIndex(
169                             e.getLastIndex())) {
170                         setDetailText(
171                                 (String JavaDoc) details.elementAt(e.getLastIndex()));
172                     } else if (table.getSelectionModel().isSelectedIndex(
173                             e.getFirstIndex())) {
174                         setDetailText(
175                                 (String JavaDoc) details.elementAt(e.getFirstIndex()));
176                     }
177                 }
178             }
179         });
180
181         // create detail text area
182
detailText = new JTextArea JavaDoc(4, 50);
183         // 508 for JTextArea
184
detailText.getAccessibleContext().setAccessibleName(
185                 smh.getLocalString(
186                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
187
".areaName", // NOI18N
188
"Text Area")); // NOI18N
189
detailText.getAccessibleContext().setAccessibleDescription(
190                 smh.getLocalString(
191                         "com.sun.enterprise.tools.verifier.gui.ControlPanel" + // NOI18N
192
".areaDesc", // NOI18N
193
"This is a text area")); // NOI18N
194
detailText.setEditable(false);
195         textScrollPane = new JScrollPane JavaDoc(detailText);
196         // 508 for JScrollPane
197
textScrollPane.getAccessibleContext().setAccessibleName(
198                 smh.getLocalString(
199                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
200
".scrName2", // NOI18N
201
"Scroll Pane")); // NOI18N
202
textScrollPane.getAccessibleContext().setAccessibleDescription(
203                 smh.getLocalString(
204                         "com.sun.enterprise.tools.verifier.gui.ControlPanel" + // NOI18N
205
".scrDesc2", // NOI18N
206
"This is a scroll pane that helps to scroll the list")); // NOI18N
207
textScrollPane.setBorder(
208                 BorderFactory.createTitledBorder(
209                         BorderFactory.createEmptyBorder(),
210                         (smh.getLocalString(
211                                 "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
212
".DetailsPanelLabel", // NOI18N
213
"Details:")))); // NOI18N
214

215         //add the components to the panel
216
add("Center", tableScrollPane); // NOI18N
217
add("South", textScrollPane); // NOI18N
218

219         // Register a listener for the report level radio buttons.
220
// to allow post-processing filtering
221
RadioListener myListener = new RadioListener();
222         ControlPanel.addRadioButtonListener((ActionListener JavaDoc) myListener);
223     }
224
225     class RadioListener implements ActionListener JavaDoc {
226         public void actionPerformed(ActionEvent JavaDoc e) {
227             if (e.getSource() == ControlPanel.allButton) {
228                 if ((getPassResultsForDisplay().size() > 0) ||
229                         (getFailResultsForDisplay().size() > 0) ||
230                         (getErrorResultsForDisplay().size() > 0) ||
231                         (getWarnResultsForDisplay().size() > 0) ||
232                         (getNaResultsForDisplay().size() > 0) ||
233                         (getNotImplementedResultsForDisplay().size() > 0) ||
234                         (getNotRunResultsForDisplay().size() > 0) ||
235                         (getDefaultResultsForDisplay().size() > 0)) {
236                     upDateDisplay(VerifierConstants.ALL);
237                 } else {
238                     clearResults();
239                 }
240             }
241             if (e.getSource() == ControlPanel.failButton) {
242                 if (getFailResultsForDisplay().size() > 0 ||
243                         getErrorResultsForDisplay().size() > 0) {
244                     upDateDisplay(VerifierConstants.FAIL);
245                 } else {
246                     clearResults();
247                 }
248             }
249             if (e.getSource() == ControlPanel.warnButton) {
250                 if ((getFailResultsForDisplay().size() > 0) ||
251                         (getErrorResultsForDisplay().size() > 0) ||
252                         (getWarnResultsForDisplay().size() > 0)) {
253                     upDateDisplay(VerifierConstants.WARN);
254                 } else {
255                     clearResults();
256                 }
257             }
258         }
259     }
260
261     public void setDetailText(String JavaDoc details) {
262         detailText.setText(details);
263         JScrollBar JavaDoc scrollBar = textScrollPane.getVerticalScrollBar();
264         if (scrollBar != null) {
265             scrollBar.setValue(0);
266         }
267     }
268
269     public void addDetailText(String JavaDoc details) {
270         detailText.append(details);
271     }
272
273     public void clearResults() {
274         //clear the table
275
tableModel = new DefaultTableModel JavaDoc(columnNames, 0);
276         table.setModel(tableModel);
277         sizeTableColumns();
278         //clear the detail text
279
setDetailText("");
280         //clear the details Vector
281
details = new Vector JavaDoc<String JavaDoc>();
282     }
283
284     void sizeTableColumns() {
285         table.getColumn(
286                 (smh.getLocalString(
287                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
288
".columnName1", // NOI18N
289
"Item"))) // NOI18N
290
.setMinWidth(150);
291         table.getColumn(
292                 (smh.getLocalString(
293                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
294
".columnName1", // NOI18N
295
"Item"))) // NOI18N
296
.setMaxWidth(200);
297         table.getColumn(
298                 (smh.getLocalString(
299                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
300
".columnName1", // NOI18N
301
"Item"))) // NOI18N
302
.setPreferredWidth(180);
303         table.getColumn(
304                 (smh.getLocalString(
305                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
306
".columnName2", // NOI18N
307
"Test Name"))) // NOI18N
308
.setMinWidth(150);
309         table.getColumn(
310                 (smh.getLocalString(
311                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
312
".columnName2", // NOI18N
313
"Test Name"))) // NOI18N
314
.setPreferredWidth(180);
315         table.getColumn(
316                 (smh.getLocalString(
317                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
318
".columnName3", // NOI18N
319
"Result"))) // NOI18N
320
.setMinWidth(120);
321         table.getColumn(
322                 (smh.getLocalString(
323                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
324
".columnName3", // NOI18N
325
"Result"))) // NOI18N
326
.setMaxWidth(200);
327         table.getColumn(
328                 (smh.getLocalString(
329                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
330
".columnName3", // NOI18N
331
"Result"))) // NOI18N
332
.setPreferredWidth(160);
333         table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
334         table.sizeColumnsToFit(0);
335     }
336
337     private void upDateDisplayAll() {
338         upDateDisplayFail();
339         upDateDisplayWarn();
340         upDateDisplayPass();
341         upDateDisplayNa();
342         upDateDisplayNotImplemented();
343         upDateDisplayNotRun();
344         upDateDisplayDefault();
345         upDateDisplayError();
346     }
347
348
349     private void updateTableRows(Vector JavaDoc results) {
350         String JavaDoc status;
351         // update display approriately
352
for (int i = 0; i < results.size(); i++) {
353             Result r = ((Result) results.elementAt(i));
354             StringBuffer JavaDoc s = new StringBuffer JavaDoc(
355                     "Assertion:" + r.getAssertion() + "\n"); // NOI18N
356
switch (r.getStatus()) {
357                 case Result.PASSED:
358                     {
359                         status =
360                                 (smh.getLocalString(
361                                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
362
".Status_Passed", // NOI18N
363
"Passed")); // NOI18N
364
Enumeration JavaDoc e = r.getGoodDetails().elements();
365                         while (e.hasMoreElements()) {
366                             s.append((String JavaDoc) e.nextElement());
367                             s.append("\n"); // NOI18N
368
}
369                         break;
370                     }
371                 case Result.FAILED:
372                     {
373                         status =
374                                 (smh.getLocalString(
375                                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
376
".Status_Failed", // NOI18N
377
"FAILED")); // NOI18N
378
Enumeration JavaDoc e = r.getErrorDetails().elements();
379                         while (e.hasMoreElements()) {
380                             s.append((String JavaDoc) e.nextElement());
381                             s.append("\n"); // NOI18N
382
}
383                         break;
384                     }
385                 case Result.WARNING:
386                     {
387                         status =
388                                 (smh.getLocalString(
389                                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
390
".Status_Warning", // NOI18N
391
"WARNING")); // NOI18N
392
Enumeration JavaDoc e = r.getWarningDetails().elements();
393                         while (e.hasMoreElements()) {
394                             s.append((String JavaDoc) e.nextElement());
395                             s.append("\n"); // NOI18N
396
}
397                         break;
398                     }
399                 case Result.NOT_APPLICABLE:
400                     {
401                         status =
402                                 (smh.getLocalString(
403                                         "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
404
".Status_NotApplicable", // NOI18N
405
"Not Applicable")); // NOI18N
406
Enumeration JavaDoc e = r.getNaDetails().elements();
407                         while (e.hasMoreElements()) {
408                             s.append((String JavaDoc) e.nextElement());
409                             s.append("\n"); // NOI18N
410
}
411                         break;
412                     }
413                 case Result.NOT_IMPLEMENTED:
414                     status =
415                             (smh.getLocalString(
416                                     "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
417
".Status_NotImplemented", // NOI18N
418
"Not Implemented")); // NOI18N
419
break;
420                 case Result.NOT_RUN:
421                     status =
422                             (smh.getLocalString(
423                                     "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
424
".Status_NotRun", // NOI18N
425
"Not Run")); // NOI18N
426
break;
427                 default:
428                     status =
429                             (smh.getLocalString(
430                                     "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
431
".Status_Unknown", // NOI18N
432
"Unknown")); // NOI18N
433
break;
434             }
435             details.add(s.toString());
436             Object JavaDoc[] row = {r.getComponentName(), r.getTestName(), status};
437             tableModel.addRow(row);
438         }//for
439
table.sizeColumnsToFit(0);
440     }
441
442     private void upDateDisplayPass() {
443         updateTableRows(getPassResultsForDisplay());
444     }
445
446     private void upDateDisplayFail() {
447         updateTableRows(getFailResultsForDisplay());
448     }
449
450     private void upDateDisplayError() {
451         Vector JavaDoc errors = getErrorResultsForDisplay();
452         for (int i = 0; i < errors.size(); i++) {
453             LogRecord JavaDoc r = (LogRecord JavaDoc) errors.elementAt(i);
454             details.add(r.getMessage() + "\n" + r.getThrown().getMessage()); // NOI18N
455
Object JavaDoc[] row = {r.getLoggerName(), errStr, errStr1};
456             tableModel.addRow(row);
457         }
458         table.sizeColumnsToFit(0);
459     }
460
461     private void upDateDisplayWarn() {
462         updateTableRows(getWarnResultsForDisplay());
463     }
464
465     private void upDateDisplayNa() {
466         updateTableRows(getNaResultsForDisplay());
467     }
468
469     private void upDateDisplayNotImplemented() {
470         updateTableRows(getNotImplementedResultsForDisplay());
471     }
472
473     private void upDateDisplayNotRun() {
474         updateTableRows(getNotRunResultsForDisplay());
475     }
476
477     private void upDateDisplayDefault() {
478         updateTableRows(getDefaultResultsForDisplay());
479     }
480
481     void addError(LogRecord JavaDoc r) {
482         saveErrorResultsForDisplay(r);
483         details.add(r.getMessage() + "\n" + r.getThrown().getMessage()); // NOI18N
484
// create a table row for this result
485
Object JavaDoc[] row = {r.getLoggerName(), errStr, errStr1};
486         tableModel.addRow(row);
487         table.sizeColumnsToFit(0);
488     }
489
490     public void upDateDisplay(int status) {
491         // update display approriately
492
clearResults();
493         if (status == VerifierConstants.ALL) {
494             upDateDisplayAll();
495         }
496         if (status == VerifierConstants.FAIL) {
497             upDateDisplayError();
498             upDateDisplayFail();
499         }
500         if (status == VerifierConstants.WARN) {
501             upDateDisplayError();
502             upDateDisplayFail();
503             upDateDisplayWarn();
504         }
505     }
506
507     private void savePassResultsForDisplay(Result r) {
508         passResults.addElement(r);
509     }
510
511     private void saveWarnResultsForDisplay(Result r) {
512         warnResults.addElement(r);
513     }
514
515     private void saveFailResultsForDisplay(Result r) {
516         failResults.addElement(r);
517     }
518
519     private void saveErrorResultsForDisplay(LogRecord JavaDoc r) {
520         errorResults.addElement(r);
521     }
522
523     private void saveNaResultsForDisplay(Result r) {
524         naResults.addElement(r);
525     }
526
527     private void saveNotRunResultsForDisplay(Result r) {
528         notRunResults.addElement(r);
529     }
530
531     private void saveNotImplementedResultsForDisplay(Result r) {
532         notImplementedResults.addElement(r);
533     }
534
535     private void saveDefaultResultsForDisplay(Result r) {
536         defaultResults.addElement(r);
537     }
538
539     private Vector JavaDoc getPassResultsForDisplay() {
540         return passResults;
541     }
542
543     private Vector JavaDoc getWarnResultsForDisplay() {
544         return warnResults;
545     }
546
547     private Vector JavaDoc getFailResultsForDisplay() {
548         return failResults;
549     }
550
551     private Vector JavaDoc getErrorResultsForDisplay() {
552         return errorResults;
553     }
554
555     private Vector JavaDoc getNaResultsForDisplay() {
556         return naResults;
557     }
558
559     private Vector JavaDoc getNotImplementedResultsForDisplay() {
560         return notImplementedResults;
561     }
562
563     private Vector JavaDoc getNotRunResultsForDisplay() {
564         return notRunResults;
565     }
566
567     private Vector JavaDoc getDefaultResultsForDisplay() {
568         return defaultResults;
569     }
570
571     public void clearOldResults() {
572         passResults = new Vector JavaDoc<Result>();
573         failResults = new Vector JavaDoc<Result>();
574         errorResults = new Vector JavaDoc<LogRecord JavaDoc>();
575         warnResults = new Vector JavaDoc<Result>();
576         naResults = new Vector JavaDoc<Result>();
577         notImplementedResults = new Vector JavaDoc<Result>();
578         notRunResults = new Vector JavaDoc<Result>();
579         defaultResults = new Vector JavaDoc<Result>();
580     }
581
582
583     // We are a ChangeListener of the test harness CheckMgrs
584
public void testFinished(EventObject JavaDoc evt) {
585         Result r = (Result) evt.getSource();
586         StringBuffer JavaDoc s = new StringBuffer JavaDoc("Assertion:" + r.getAssertion() + "\n"); // NOI18N
587
String JavaDoc status;
588         switch (r.getStatus()) {
589             case Result.PASSED:
590                 {
591                     status =
592                             (smh.getLocalString(
593                                     "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
594
".Status_Passed", // NOI18N
595
"Passed")); // NOI18N
596
savePassResultsForDisplay(r);
597                     Enumeration JavaDoc e = r.getGoodDetails().elements();
598                     while (e.hasMoreElements()) {
599                         s.append((String JavaDoc) e.nextElement());
600                         s.append("\n"); // NOI18N
601
}
602                     break;
603                 }
604             case Result.FAILED:
605                 {
606                     status =
607                             (smh.getLocalString(
608                                     "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
609
".Status_Failed", // NOI18N
610
"FAILED")); // NOI18N
611
saveFailResultsForDisplay(r);
612                     Enumeration JavaDoc e = r.getErrorDetails().elements();
613                     while (e.hasMoreElements()) {
614                         s.append((String JavaDoc) e.nextElement());
615                         s.append("\n"); // NOI18N
616
}
617                     break;
618                 }
619             case Result.WARNING:
620                 {
621                     status =
622                             (smh.getLocalString(
623                                     "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
624
".Status_Warning", // NOI18N
625
"WARNING")); // NOI18N
626
saveWarnResultsForDisplay(r);
627                     Enumeration JavaDoc e = r.getWarningDetails().elements();
628                     while (e.hasMoreElements()) {
629                         s.append((String JavaDoc) e.nextElement());
630                         s.append("\n"); // NOI18N
631
}
632                     break;
633                 }
634             case Result.NOT_APPLICABLE:
635                 {
636                     status =
637                             (smh.getLocalString(
638                                     "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
639
".Status_NotApplicable", // NOI18N
640
"Not Applicable")); // NOI18N
641
saveNaResultsForDisplay(r);
642                     Enumeration JavaDoc e = r.getNaDetails().elements();
643                     while (e.hasMoreElements()) {
644                         s.append((String JavaDoc) e.nextElement());
645                         s.append("\n"); // NOI18N
646
}
647                     break;
648                 }
649             case Result.NOT_IMPLEMENTED:
650                 {
651                     status =
652                             (smh.getLocalString(
653                                     "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
654
".Status_NotImplemented", // NOI18N
655
"Not Implemented")); // NOI18N
656
saveNotImplementedResultsForDisplay(r);
657                     break;
658                 }
659             case Result.NOT_RUN:
660                 {
661                     status =
662                             (smh.getLocalString(
663                                     "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
664
".Status_NotRun", // NOI18N
665
"Not Run")); // NOI18N
666
saveNotRunResultsForDisplay(r);
667                     break;
668                 }
669             default:
670                 {
671                     status =
672                             (smh.getLocalString(
673                                     "com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
674
".Status_Unknown", // NOI18N
675
"Unknown")); // NOI18N
676
saveDefaultResultsForDisplay(r);
677                     break;
678                 }
679         }
680         // create a table row for this result
681
Object JavaDoc[] row = {r.getComponentName(), r.getTestName(), status};
682         if (ControlPanel.getReportLevel() == VerifierConstants.FAIL &&
683                 r.getStatus() == Result.FAILED) {
684             details.add(s.toString());
685             tableModel.addRow(row);
686         }
687
688         if (ControlPanel.getReportLevel() == VerifierConstants.WARN &&
689                 (r.getStatus() == Result.FAILED ||
690                 r.getStatus() == Result.WARNING)) {
691             details.add(s.toString());
692             tableModel.addRow(row);
693         }
694
695         if (ControlPanel.getReportLevel() == VerifierConstants.ALL) {
696             details.add(s.toString());
697             tableModel.addRow(row);
698         }
699     }
700
701     public void allTestsFinished(EventObject JavaDoc e) {
702         // do nothing for now
703
}
704 }
705
Popular Tags