FileDocCategorySizeDatePackage
ASConnectorMaxWait.javaAPI DocGlassfish v2 API4418Fri May 04 22:35:12 BST 2007com.sun.enterprise.tools.verifier.tests.connector.ias

ASConnectorMaxWait

public class ASConnectorMaxWait extends ConnectorTest implements ConnectorCheck

Fields Summary
Constructors Summary
Methods Summary
public Resultcheck(com.sun.enterprise.deployment.ConnectorDescriptor descriptor)

     Result result = getInitializedResult();
     ComponentNameConstructor compName = new ComponentNameConstructor(descriptor);   
	 boolean oneFailed = false;
     SunConnector sc = descriptor.getSunDescriptor();
     if(sc == null)
     {
            result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable1",
			    "NOT APPLICABLE [AS­CONNECTOR]: sun-ra.xml descriptor object could not be obtained"));
							  
     }
     else{
     ResourceAdapter ra = sc.getResourceAdapter();
     String maxWait = ra.getAttributeValue("max-wait-time-in-millis");
     if(maxWait.length()==0)
     {
         result.failed(smh.getLocalString(getClass().getName()+".failed1",
                    "FAILED [AS-CONNECTOR resource-adapter] : max-wait-time-in-millis cannot be empty"));
     }
     else
     {
        try
        {
            long value = Long.valueOf(maxWait).longValue();
            if(value < 0  || value > Long.MAX_VALUE)
            {
                result.failed(smh.getLocalString(getClass().getName()+".failed2",
                    "FAILED [AS-CONNECTOR resource-adapter] : max-wait-time-in-millis cannot be {0}. It should be between 0 and {1}",
                new Object[]{new Long(value),new Long(Long.MAX_VALUE)}));
            }
            else
            {
                result.passed(smh.getLocalString(getClass().getName()+".passed",
                   "PASSED [AS-CONNECTOR resource-adapter] : max-wait-time-in-millis is {0}",
                         new Object[]{new Long(value)}));
            }
        }
        catch(NumberFormatException nfex)
        {
            Verifier.debug(nfex);
            result.failed(smh.getLocalString(getClass().getName()+".failed3",
            "FAILED [AS-CONNECTOR resource-adapter] : The value {0} for max-wait-time-in-millis is not a valid Long number",new Object[]{maxWait}));
        }
     }
     }
        return result;