Methods Summary |
---|
public void | addDetailText(java.lang.String details)
detailText.append(details);
|
void | addError(java.util.logging.LogRecord r)
saveErrorResultsForDisplay(r);
details.add(r.getMessage() + "\n" + r.getThrown().getMessage()); // NOI18N
// create a table row for this result
Object[] row = {r.getLoggerName(), errStr, errStr1};
tableModel.addRow(row);
table.sizeColumnsToFit(0);
|
public void | allTestsFinished(java.util.EventObject e)
// do nothing for now
|
public void | clearOldResults()
passResults = new Vector<Result>();
failResults = new Vector<Result>();
errorResults = new Vector<LogRecord>();
warnResults = new Vector<Result>();
naResults = new Vector<Result>();
notImplementedResults = new Vector<Result>();
notRunResults = new Vector<Result>();
defaultResults = new Vector<Result>();
|
public void | clearResults()
//clear the table
tableModel = new DefaultTableModel(columnNames, 0);
table.setModel(tableModel);
sizeTableColumns();
//clear the detail text
setDetailText("");
//clear the details Vector
details = new Vector<String>();
|
private java.util.Vector | getDefaultResultsForDisplay()
return defaultResults;
|
private java.util.Vector | getErrorResultsForDisplay()
return errorResults;
|
private java.util.Vector | getFailResultsForDisplay()
return failResults;
|
private java.util.Vector | getNaResultsForDisplay()
return naResults;
|
private java.util.Vector | getNotImplementedResultsForDisplay()
return notImplementedResults;
|
private java.util.Vector | getNotRunResultsForDisplay()
return notRunResults;
|
private java.util.Vector | getPassResultsForDisplay()
return passResults;
|
private java.util.Vector | getWarnResultsForDisplay()
return warnResults;
|
private void | saveDefaultResultsForDisplay(com.sun.enterprise.tools.verifier.Result r)
defaultResults.addElement(r);
|
private void | saveErrorResultsForDisplay(java.util.logging.LogRecord r)
errorResults.addElement(r);
|
private void | saveFailResultsForDisplay(com.sun.enterprise.tools.verifier.Result r)
failResults.addElement(r);
|
private void | saveNaResultsForDisplay(com.sun.enterprise.tools.verifier.Result r)
naResults.addElement(r);
|
private void | saveNotImplementedResultsForDisplay(com.sun.enterprise.tools.verifier.Result r)
notImplementedResults.addElement(r);
|
private void | saveNotRunResultsForDisplay(com.sun.enterprise.tools.verifier.Result r)
notRunResults.addElement(r);
|
private void | savePassResultsForDisplay(com.sun.enterprise.tools.verifier.Result r)
passResults.addElement(r);
|
private void | saveWarnResultsForDisplay(com.sun.enterprise.tools.verifier.Result r)
warnResults.addElement(r);
|
public void | setDetailText(java.lang.String details)
detailText.setText(details);
JScrollBar scrollBar = textScrollPane.getVerticalScrollBar();
if (scrollBar != null) {
scrollBar.setValue(0);
}
|
void | sizeTableColumns()
table.getColumn(
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".columnName1", // NOI18N
"Item"))) // NOI18N
.setMinWidth(150);
table.getColumn(
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".columnName1", // NOI18N
"Item"))) // NOI18N
.setMaxWidth(200);
table.getColumn(
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".columnName1", // NOI18N
"Item"))) // NOI18N
.setPreferredWidth(180);
table.getColumn(
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".columnName2", // NOI18N
"Test Name"))) // NOI18N
.setMinWidth(150);
table.getColumn(
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".columnName2", // NOI18N
"Test Name"))) // NOI18N
.setPreferredWidth(180);
table.getColumn(
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".columnName3", // NOI18N
"Result"))) // NOI18N
.setMinWidth(120);
table.getColumn(
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".columnName3", // NOI18N
"Result"))) // NOI18N
.setMaxWidth(200);
table.getColumn(
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".columnName3", // NOI18N
"Result"))) // NOI18N
.setPreferredWidth(160);
table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
table.sizeColumnsToFit(0);
|
public void | testFinished(java.util.EventObject evt)
Result r = (Result) evt.getSource();
StringBuffer s = new StringBuffer("Assertion:" + r.getAssertion() + "\n"); // NOI18N
String status;
switch (r.getStatus()) {
case Result.PASSED:
{
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_Passed", // NOI18N
"Passed")); // NOI18N
savePassResultsForDisplay(r);
Enumeration e = r.getGoodDetails().elements();
while (e.hasMoreElements()) {
s.append((String) e.nextElement());
s.append("\n"); // NOI18N
}
break;
}
case Result.FAILED:
{
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_Failed", // NOI18N
"FAILED")); // NOI18N
saveFailResultsForDisplay(r);
Enumeration e = r.getErrorDetails().elements();
while (e.hasMoreElements()) {
s.append((String) e.nextElement());
s.append("\n"); // NOI18N
}
break;
}
case Result.WARNING:
{
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_Warning", // NOI18N
"WARNING")); // NOI18N
saveWarnResultsForDisplay(r);
Enumeration e = r.getWarningDetails().elements();
while (e.hasMoreElements()) {
s.append((String) e.nextElement());
s.append("\n"); // NOI18N
}
break;
}
case Result.NOT_APPLICABLE:
{
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_NotApplicable", // NOI18N
"Not Applicable")); // NOI18N
saveNaResultsForDisplay(r);
Enumeration e = r.getNaDetails().elements();
while (e.hasMoreElements()) {
s.append((String) e.nextElement());
s.append("\n"); // NOI18N
}
break;
}
case Result.NOT_IMPLEMENTED:
{
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_NotImplemented", // NOI18N
"Not Implemented")); // NOI18N
saveNotImplementedResultsForDisplay(r);
break;
}
case Result.NOT_RUN:
{
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_NotRun", // NOI18N
"Not Run")); // NOI18N
saveNotRunResultsForDisplay(r);
break;
}
default:
{
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_Unknown", // NOI18N
"Unknown")); // NOI18N
saveDefaultResultsForDisplay(r);
break;
}
}
// create a table row for this result
Object[] row = {r.getComponentName(), r.getTestName(), status};
if (ControlPanel.getReportLevel() == VerifierConstants.FAIL &&
r.getStatus() == Result.FAILED) {
details.add(s.toString());
tableModel.addRow(row);
}
if (ControlPanel.getReportLevel() == VerifierConstants.WARN &&
(r.getStatus() == Result.FAILED ||
r.getStatus() == Result.WARNING)) {
details.add(s.toString());
tableModel.addRow(row);
}
if (ControlPanel.getReportLevel() == VerifierConstants.ALL) {
details.add(s.toString());
tableModel.addRow(row);
}
|
public void | upDateDisplay(int status)
// update display approriately
clearResults();
if (status == VerifierConstants.ALL) {
upDateDisplayAll();
}
if (status == VerifierConstants.FAIL) {
upDateDisplayError();
upDateDisplayFail();
}
if (status == VerifierConstants.WARN) {
upDateDisplayError();
upDateDisplayFail();
upDateDisplayWarn();
}
|
private void | upDateDisplayAll()
upDateDisplayFail();
upDateDisplayWarn();
upDateDisplayPass();
upDateDisplayNa();
upDateDisplayNotImplemented();
upDateDisplayNotRun();
upDateDisplayDefault();
upDateDisplayError();
|
private void | upDateDisplayDefault()
updateTableRows(getDefaultResultsForDisplay());
|
private void | upDateDisplayError()
Vector errors = getErrorResultsForDisplay();
for (int i = 0; i < errors.size(); i++) {
LogRecord r = (LogRecord) errors.elementAt(i);
details.add(r.getMessage() + "\n" + r.getThrown().getMessage()); // NOI18N
Object[] row = {r.getLoggerName(), errStr, errStr1};
tableModel.addRow(row);
}
table.sizeColumnsToFit(0);
|
private void | upDateDisplayFail()
updateTableRows(getFailResultsForDisplay());
|
private void | upDateDisplayNa()
updateTableRows(getNaResultsForDisplay());
|
private void | upDateDisplayNotImplemented()
updateTableRows(getNotImplementedResultsForDisplay());
|
private void | upDateDisplayNotRun()
updateTableRows(getNotRunResultsForDisplay());
|
private void | upDateDisplayPass()
updateTableRows(getPassResultsForDisplay());
|
private void | upDateDisplayWarn()
updateTableRows(getWarnResultsForDisplay());
|
private void | updateTableRows(java.util.Vector results)
String status;
// update display approriately
for (int i = 0; i < results.size(); i++) {
Result r = ((Result) results.elementAt(i));
StringBuffer s = new StringBuffer(
"Assertion:" + r.getAssertion() + "\n"); // NOI18N
switch (r.getStatus()) {
case Result.PASSED:
{
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_Passed", // NOI18N
"Passed")); // NOI18N
Enumeration e = r.getGoodDetails().elements();
while (e.hasMoreElements()) {
s.append((String) e.nextElement());
s.append("\n"); // NOI18N
}
break;
}
case Result.FAILED:
{
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_Failed", // NOI18N
"FAILED")); // NOI18N
Enumeration e = r.getErrorDetails().elements();
while (e.hasMoreElements()) {
s.append((String) e.nextElement());
s.append("\n"); // NOI18N
}
break;
}
case Result.WARNING:
{
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_Warning", // NOI18N
"WARNING")); // NOI18N
Enumeration e = r.getWarningDetails().elements();
while (e.hasMoreElements()) {
s.append((String) e.nextElement());
s.append("\n"); // NOI18N
}
break;
}
case Result.NOT_APPLICABLE:
{
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_NotApplicable", // NOI18N
"Not Applicable")); // NOI18N
Enumeration e = r.getNaDetails().elements();
while (e.hasMoreElements()) {
s.append((String) e.nextElement());
s.append("\n"); // NOI18N
}
break;
}
case Result.NOT_IMPLEMENTED:
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_NotImplemented", // NOI18N
"Not Implemented")); // NOI18N
break;
case Result.NOT_RUN:
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_NotRun", // NOI18N
"Not Run")); // NOI18N
break;
default:
status =
(smh.getLocalString(
"com.sun.enterprise.tools.verifier.gui.ResultsPanel" + // NOI18N
".Status_Unknown", // NOI18N
"Unknown")); // NOI18N
break;
}
details.add(s.toString());
Object[] row = {r.getComponentName(), r.getTestName(), status};
tableModel.addRow(row);
}//for
table.sizeColumnsToFit(0);
|