FileDocCategorySizeDatePackage
Result.javaAPI DocGlassfish v2 API10631Fri May 04 22:33:24 BST 2007com.sun.enterprise.tools.verifier

Result

public class Result extends Object

Fields Summary
public static final int
PASSED
public static final int
FAILED
public static final int
WARNING
public static final int
NOT_APPLICABLE
public static final int
NOT_RUN
public static final int
NOT_IMPLEMENTED
private int
status
public static final String
APP
public static final String
EJB
public static final String
WEB
public static final String
APPCLIENT
public static final String
CONNECTOR
public static final String
WEBSERVICE
public static final String
WEBSERVICE_CLIENT
private String
moduleName
private String
componentName
private String
assertion
private String
testName
private Vector
errorDetails
private Vector
goodDetails
private Vector
warningDetails
private Vector
naDetails
boolean
debug
private Logger
logger
private FaultLocation
faultLocation
Constructors Summary
public Result()
Result Constructor


           
      
        faultLocation = new FaultLocation();
    
Methods Summary
public voidaddErrorDetails(java.lang.String s)
Fill in Error details

param
s error detail string

        errorDetails.addElement(s);
        logger.log(Level.FINE, s);
    
public voidaddGoodDetails(java.lang.String s)
Fill in Good details

param
s good detail string

        goodDetails.addElement(s);
        logger.log(Level.FINE, s);
    
public voidaddNaDetails(java.lang.String s)
Retrieve Not Applicable details

param
s not applicable details

        naDetails.addElement(s);
        logger.log(Level.FINE, s);
    
public voidaddWarningDetails(java.lang.String s)
Fill in Warning details

param
s warning detail string

        warningDetails.addElement(s);
        logger.log(Level.FINE, s);
    
public voidfailed(java.lang.String detail)
Store Failed info

param
detail Details of failed test

        setStatus(FAILED);
        addErrorDetails(detail);
    
public java.lang.StringgetAssertion()
Retrieve assertion

return
String assertion string

        return assertion;
    
public java.lang.StringgetComponentName()
Retrieve component/module name

return
String component/module name

        return componentName;
    
public java.util.VectorgetErrorDetails()
Retrieve Error details

return
Vector error details

        return errorDetails;
    
public FaultLocationgetFaultLocation()

        return faultLocation;
    
public java.util.VectorgetGoodDetails()
Retrieve Good details

return
Vector good details

        if(goodDetails.isEmpty()){
            Vector<String> result = new Vector<String>();
            result.add(StringManagerHelper.getLocalStringsManager()
                    .getLocalString("tests.componentNameConstructor", // NOI18N
                            "For [ {0} ]", // NOI18N
                            new Object[]{getComponentName()}));
            result.add(StringManagerHelper.getLocalStringsManager()
                    .getLocalString(getClass().getName() + ".defaultGoodDetails", //NOI18N
                            "There were no errors reported.")); // NOI18N
            logger.fine("Returning default GoodDetails."); // NOI18N
            return result;
        }
        return goodDetails;
    
public java.lang.StringgetModuleName()

        return moduleName;
    
public java.util.VectorgetNaDetails()
Retrieve Not Applicable details

return
Vector not applicable details

        if(naDetails.isEmpty()){
            Vector<String> result = new Vector<String>();
            result.add(StringManagerHelper.getLocalStringsManager()
                    .getLocalString("tests.componentNameConstructor", // NOI18N
                            "For [ {0} ]", // NOI18N
                            new Object[]{getComponentName()}));
            result.add(StringManagerHelper.getLocalStringsManager()
                    .getLocalString(getClass().getName() + ".defaultNADetails", //NOI18N
                            "Test is not applicable.")); // NOI18N
            logger.fine("Returning default NADetails."); // NOI18N
            return result;
        }
        return naDetails;
    
public intgetStatus()
Retrieve test result status

return
int test result status

        return status;
    
public java.lang.StringgetTestName()
Retrieve test name

return
String test name

        return testName;
    
public java.util.VectorgetWarningDetails()
Retrieve Warning details

return
Vector warning details

        return warningDetails;
    
public voidinit(java.lang.Class c, java.lang.String version, java.lang.String compName)
Initialize the Result object

param
c Class of the current test/assertion
param
compName

        setComponentName(compName);
        StringBuffer assertion = new StringBuffer(
                StringManagerHelper.getLocalStringsManager().getLocalString(
                        (c.getName() + ".assertion"), "")); // NOI18N
        String key = ".specMappingInfo_"+version; // NOI18N
        StringBuffer specMappingInfo = new StringBuffer(
                StringManagerHelper.getLocalStringsManager().getLocalString(
                        (c.getName() + key), ""));
        // if specMappingInfo_<version> is unavailable then try just specMappingInfo
        if(specMappingInfo == null || specMappingInfo.length() == 0) {
            key = c.getName() + ".specMappingInfo";
            specMappingInfo = new StringBuffer(StringManagerHelper.getLocalStringsManager().getLocalString(key, ""));
        }
        String  prefix = StringManagerHelper.getLocalStringsManager().getLocalString(
                (getClass().getName() + ".prefix"), ""); // NOI18N
        String  suffix = StringManagerHelper.getLocalStringsManager().getLocalString(
                (getClass().getName() + ".suffix"), ""); // NOI18N

        if (specMappingInfo.length()!=0 && specMappingInfo!=null)
            setAssertion(assertion.append(" ").append(prefix+" ").append(specMappingInfo).append(" "+suffix).toString()); // NOI18N
        else
            setAssertion(assertion.toString());
        String this_package = "com.sun.enterprise.tools.verifier."; // NOI18N
        setTestName(c.getName().substring(this_package.length()));
    
public voidnotApplicable(java.lang.String detail)
Store Not Applicable info

param
detail Details of not applicable test

        setStatus(NOT_APPLICABLE);
        addNaDetails(detail);
    
public voidpassed(java.lang.String detail)
Store passed info

param
detail Details of passed test

        setStatus(PASSED);
        addGoodDetails(detail);
    
public voidsetAssertion(java.lang.String s)
Set assertion

param
s assertion string

        assertion = s;
    
public voidsetComponentName(java.lang.String s)
Set component/module name

param
s component/module name

        componentName = s;
    
public voidsetModuleName(java.lang.String name)

        moduleName = name;
    
public voidsetStatus(int s)
Set test result status

param
s test result status

        status = s;
    
public voidsetTestName(java.lang.String s)
Set test name

param
s test name

        testName = s;
    
public voidwarning(java.lang.String detail)
Store warning info

param
detail Details of warning test

        setStatus(WARNING);
        addWarningDetails(detail);