FileDocCategorySizeDatePackage
JmsServiceTest.javaAPI DocGlassfish v2 API7197Fri May 04 22:34:12 BST 2007com.sun.enterprise.admin.verifier.tests

JmsServiceTest

public class JmsServiceTest extends ServerXmlTest implements ServerCheck
PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms. Copyright 2001-2002 by iPlanet/Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All rights reserved.

Fields Summary
static Logger
_logger
Constructors Summary
public JmsServiceTest()

    
      
    
Methods Summary
public Resultcheck(com.sun.enterprise.config.ConfigContext context)

        Result result;
        result = super.getInitializedResult();
        //<addition author="irfan@sun.com" [bug/RFE]-id="" >
        // 8.0 XML Verifier
        /*try {
            Server server = (Server)context.getRootConfigBean();
            JmsService jms = server.getJmsService();
            String httpPort = jms.getPort();
            try {
                if(StaticTest.isPortValid(Integer.parseInt(httpPort))) 
                       result.passed("Valid Port");
                else
                       result.failed("Invalid JMSService Port - " + httpPort);
            }
            catch(NumberFormatException e) {
                result.failed("Invalid JMSService Port Number - " + httpPort);
            }
            // Bug : 4713369
            try {
                String timeout = jms.getInitTimeoutInSeconds();
                if(Integer.parseInt(timeout) < 0)
                    result.failed(smh.getLocalString(getClass().getName()+".initTimeoutNegative","Init Timeout cannot be negative number"));
                else
                    result.passed("** Passed ** ");
            } catch(NumberFormatException e) {
                result.failed(smh.getLocalString(getClass().getName()+".initTimeoutInvalid","Init Timeout : invalid number"));
            }
        }
        catch(Exception ex) {
            //<addition author="irfan@sun.com" [bug/rfe]-id="logging" >
            /*ex.printStackTrace();
            result.failed("Exception : " + ex.getMessage());
            // Logging
            _logger.log(Level.FINE, "serverxmlverifier.exception", ex);
            result.failed("Exception : " + ex.getMessage());
            //</addition>
        }*/
        //</addition>
        return result;
    
public Resultcheck(com.sun.enterprise.config.ConfigContextEvent ccce)

        Result result = new Result();
        Object value = ccce.getObject();
        String beanName = ccce.getBeanName();
        if(beanName!=null) {
               String name = ccce.getName();
               return testSave(name, (String) value);
        }
        
        //<addition author="irfan@sun.com" [bug/RFE]-id="" >
        // 8.0 XML Verifier
        //JmsService jms = (JmsService) value;                
        JmsHost jms = (JmsHost) value;
        //</addition>
        String httpPort = jms.getPort();
        try {
            if(StaticTest.isPortValid(Integer.parseInt(httpPort))) 
                   result.passed("Valid Port");
            else
                   result.failed("Invalid JMSService Port : " + httpPort);
        }
        catch(NumberFormatException e) {
            result.failed("Invalid JMSService Port Number : " + httpPort);
        }
        return result;
    
public ResulttestSave(java.lang.String name, java.lang.String value)

        Result result = new Result();
        result.passed("Passed");
        if(name.equals(ServerTags.PORT)) {
            try {
                if(StaticTest.isPortValid(Integer.parseInt(value)))
                    result.passed("Valid Port");
                else
                    result.failed("Invalid Port");
            } catch(NumberFormatException e) {
                result.failed("Bad Number");
            }
        }
        // check if init timeout is valid
        // Bug : 4713369
        if(name.equals(ServerTags.INIT_TIMEOUT_IN_SECONDS)) {
            try {
                if(Integer.parseInt(value) < 0)
                    result.failed(smh.getLocalString(getClass().getName()+".initTimeoutNegative","Init Timeout cannot be negative number"));
                else
                    result.passed("Passed **");
            } catch (NumberFormatException e) {
                 result.failed(smh.getLocalString(getClass().getName()+".initTimeoutInvalid","Init Timeout : invalid number"));
            }
        }
        return result;