Package com.sun.enterprise.tools.verifier

Examples of com.sun.enterprise.tools.verifier.Result


     * @return result object containing the result of the individual test
     * performed
     */
    public Result check(ConnectorDescriptor descriptor) {

        Result result = getInitializedResult();
  ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        // test NA for inboundRA
        if(!descriptor.getOutBoundDefined())
        {
          result.addNaDetails(smh.getLocalString
              ("tests.componentNameConstructor",
               "For [ {0} ]",
               new Object[] {compName.toString()}));
          result.notApplicable(smh.getLocalString
              ("com.sun.enterprise.tools.verifier.tests.connector.managed.notApplicableForInboundRA",
               "Resource Adapter does not provide outbound communication"));
          return result;
        }
        boolean oneFailed=false;
  OutboundResourceAdapter outboundRA =
      descriptor.getOutboundResourceAdapter();

  Set connDefs = outboundRA.getConnectionDefs();
  Iterator iter = connDefs.iterator();
  while(iter.hasNext()) {
     
      ConnectionDefDescriptor connDefDesc = (ConnectionDefDescriptor)
    iter.next();
      Set configProperties = connDefDesc.getConfigProperties();
      if (!configProperties.isEmpty()) {
    Iterator propIterator = configProperties.iterator();
    Class mcf = testManagedConnectionFactoryImpl(descriptor, result);
    if (mcf == null) {
        // not much we can do without the class, the superclass should have
        // set the error code now, just abandon
        return result;
    }
    while (propIterator.hasNext()) {
        EnvironmentProperty ep = (EnvironmentProperty) propIterator.next();
       
        // Set method first
        String propertyName = Character.toUpperCase(ep.getName().charAt(0)) + ep.getName().substring(1);
        String setMethodName = "set" + propertyName;
        Class[] parmTypes = new Class[] { ep.getValueType() };
        Method m = getMethod(mcf, setMethodName, parmTypes);
        if (m!=null) {
      result.addGoodDetails(smh.getLocalString
                ("tests.componentNameConstructor",
                 "For [ {0} ]",
                 new Object[] {compName.toString()}));
      result.addGoodDetails(smh.getLocalString(getClass().getName() + ".passed",
                 "Found a JavaBeans compliant accessor method [ {0} ] for the config-property [ {1} ]",
                 new Object[] {  m, ep.getName()}));              
        } else {
      oneFailed=true;
      result.addErrorDetails(smh.getLocalString
                 ("tests.componentNameConstructor",
            "For [ {0} ]",
            new Object[] {compName.toString()}));
      result.addErrorDetails(smh.getLocalString
                 (getClass().getName() + ".failed",
            "Error: There is no JavaBeans compliant accessor method [ {0} ] implemented in [ {1} ] for the config-property [ {2} ]",
            new Object[] {  "public void "+ setMethodName+"("+ep.getValueType().getName()+")",
                    mcf.getName(),
                    ep.getName()}));                     
        }
        String getMethodName = "get" + propertyName;
        m = getMethod(mcf, getMethodName, null);
        if (m!=null) {     
      result.addGoodDetails(smh.getLocalString
                ("tests.componentNameConstructor",
                 "For [ {0} ]",
                 new Object[] {compName.toString()}));
      result.addGoodDetails(smh.getLocalString(getClass().getName() + ".passed",
                 "Found a JavaBeans compliant accessor method [ {0} ] for the config-property [ {1} ]",
                 new Object[] {  m, ep.getName()}));  
        } else {
      oneFailed=true;
      result.addErrorDetails(smh.getLocalString
                 ("tests.componentNameConstructor",
            "For [ {0} ]",
            new Object[] {compName.toString()}));
      result.addErrorDetails(smh.getLocalString
                 (getClass().getName() + ".failed",
            "Error: There is no JavaBeans compliant accessor method [ {0} ] implemented in [ {1} ] for the config-property [ {2} ]",
            new Object[] {  "public " + ep.getValueType().getName() + " " + getMethodName,
                    mcf.getName(),
                    ep.getName()}));                    
        }                               
    }           
      }
  }
        if (oneFailed) {
            result.setStatus(Result.FAILED);
        } else {
            result.setStatus(Result.PASSED);
        }
        return result;
    }
View Full Code Here


     * @return result object containing the result of the individual test
     * performed
     */
    public Result check(ConnectorDescriptor descriptor) {
       
        Result result = getInitializedResult();
  ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
       
        // let's get first the the default implementation of the ConnectionManager
        //File jarFile = Verifier.getJarFile(descriptor.getModuleDescriptor().getArchiveUri());           
//        File f=Verifier.getArchiveFile(descriptor.getModuleDescriptor().getArchiveUri());
        Class c = findImplementorOf(descriptor, "javax.resource.spi.ConnectionRequestInfo");
       
        if (c == null) {
      result.addNaDetails(smh.getLocalString
          ("tests.componentNameConstructor",
           "For [ {0} ]",
           new Object[] {compName.toString()}))
            result.notApplicable(smh.getLocalString
      ("com.sun.enterprise.tools.verifier.tests.connector.ConnectorTest.optionalInterfaceMissing",
            "Warning: There is no implementation of the optional [ {0} ] interface",
            new Object[] {"javax.resource.spi.ConnectionRequestInfo"}))
        } else {
            // An implementation of the interface is provided, let's check the equals method
View Full Code Here

     * @return result object containing the result of the individual test
     * performed
     */
    public Result check(ConnectorDescriptor descriptor) {
        boolean oneFailed = false;
        Result result = getInitializedResult();
  ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        if(!descriptor.getOutBoundDefined())
        {
          result.addNaDetails(smh.getLocalString
              ("tests.componentNameConstructor",
               "For [ {0} ]",
               new Object[] {compName.toString()}));
          result.notApplicable(smh.getLocalString
              ("com.sun.enterprise.tools.verifier.tests.connector.managed.notApplicableForInboundRA",
               "Resource Adapter does not provide outbound communication"));
          return result;
        }
        Set mechanisms =
        descriptor.getOutboundResourceAdapter().getAuthMechanisms();
        if (mechanisms.isEmpty()) {
            // passed
      result.addGoodDetails(smh.getLocalString
          ("tests.componentNameConstructor",
           "For [ {0} ]",
           new Object[] {compName.toString()}))
      result.passed(smh.getLocalString
              ("com.sun.enterprise.tools.verifier.tests.connector.AuthMechType.nonexist",
                 "No authentication mechanism defined for this resource adapater"));           
            return result;
        }
        Iterator mechIterator = mechanisms.iterator();
        while (mechIterator.hasNext()) {
            AuthMechanism am = (AuthMechanism) mechIterator.next();
            String authMechType = am.getAuthMechType();
            boolean allowedMech = false;           
            if (authMechType!=null) {
                for (int i=0;i<allowedMechs.length;i++) {
                    if (authMechType.equals(allowedMechs[i])) {
                        allowedMech = true;
                        break;
                    }
                }
            }
            if (!allowedMech || authMechType == null) {
                // failed
                oneFailed = true;
          result.addErrorDetails(smh.getLocalString
               ("tests.componentNameConstructor",
          "For [ {0} ]",
          new Object[] {compName.toString()}));
    result.failed(smh.getLocalString
                  ("com.sun.enterprise.tools.verifier.tests.connector.AuthMechType.failed",
                    "Authentication mechanism type [ {0} ] is not allowed"));
            }
        }
        if (!oneFailed) {
      result.addGoodDetails(smh.getLocalString
               ("tests.componentNameConstructor",
          "For [ {0} ]",
          new Object[] {compName.toString()}))
    result.passed(smh.getLocalString
              ("com.sun.enterprise.tools.verifier.tests.connector.AuthMechType.passed",
                 "All defined authentication mechanism types are allowed"));
        }
        return result;       
    }
View Full Code Here

public class ASEjbBPSteadyPoolSize extends ASEjbBeanPool
{
   
    public Result check(EjbDescriptor descriptor)
    {
        Result result = getInitializedResult();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        String pool = null;
        String steadyPoolSize=null;
        String maxPoolSize = null;

        try{
            pool = getXPathValue("/sun-ejb-jar/enterprise-beans/ejb[ejb-name=\""+descriptor.getName()+"\"]/bean-pool");
            if (pool!=null)
            {
                steadyPoolSize = getXPathValue("/sun-ejb-jar/enterprise-beans/ejb[ejb-name=\""+descriptor.getName()+"\"]/bean-pool/steady-pool-size");
                if (steadyPoolSize!=null){
                    steadyPoolSize = steadyPoolSize.trim();
                    if (steadyPoolSize.length()==0)
                    {
                        addErrorDetails(result, compName);
                        result.failed(smh.getLocalString(getClass().getName()+".failed",
                            "FAILED [AS-EJB bean-pool] : steady-pool-size cannot be empty"));
                    }else
                    {
                        try
                        {
                            int value = Integer.valueOf(steadyPoolSize).intValue();
                            if(value < || value > Integer.MAX_VALUE)
                            {
                                addErrorDetails(result, compName);
                                result.failed(smh.getLocalString(getClass().getName()+".failed1",
                                    "FAILED [AS-EJB bean-pool] : steady-pool-size cannot be {0}. It should be between 0 and {1}",
                                     new Object[]{new Integer(value),new Integer(Integer.MAX_VALUE)}));
                            }else
                            {
                                maxPoolSize = getXPathValue("/sun-ejb-jar/enterprise-beans/ejb[ejb-name=\""+descriptor.getName()+"\"]/bean-pool/max-pool-size");
                                int maxPool = 0;
                                if(maxPoolSize != null)
                                {
                                    try{
                                        maxPool = Integer.parseInt(maxPoolSize);
                                    }catch(NumberFormatException nfe){
                                        addErrorDetails(result, compName);
                                        result.failed(smh.getLocalString(getClass().getName()+".failed2",
                                            "FAILED [AS-EJB bean-pool] : The value {0} for max-pool-size is not a valid Integer number",new Object[]{maxPoolSize}));
                                            return result;
                                    }
                                    if(value <= maxPool)
                                    {
                                        addGoodDetails(result, compName);
                                        result.passed(smh.getLocalString(getClass().getName()+".passed",
                                            "PASSED [AS-EJB bean-pool] : steady-pool-size is {0} and is less-than/equal-to max-pool-size [{1}]",
                                             new Object[]{new Integer(value), new Integer(maxPool)}));
                                    }else
                                    {
                                        addWarningDetails(result, compName);
                                        result.warning(smh.getLocalString(getClass().getName()+".warning","WARNING [AS-EJB bean-pool] : steady-pool-size [{0}]  is greater than max-pool-size[{1}]", new Object[]{new Integer(value), new Integer(maxPool)}));
                                    }
                                }else
                                {
                                    addGoodDetails(result, compName);
                                    result.passed(smh.getLocalString(getClass().getName()+".passed1",
                                        "PASSED [AS-EJB bean-pool] : steady-pool-size is {0}",new Object[] { new Integer(value)}));
                                }
                            }
                        }catch(NumberFormatException nfex)
                        {
                            Verifier.debug(nfex);
                            addErrorDetails(result, compName);
                            result.failed(smh.getLocalString(getClass().getName()+".failed3",
                                    "FAILED [AS-EJB bean-pool] : The value {0} for steady-pool-size is not a valid Integer number",
                                    new Object[]{steadyPoolSize}));
                        }
                    }
                }else  // steady-pool-size not defined
                {
                    addNaDetails(result, compName);
                    result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
                        "NOT APPLICABLE [AS-EJB bean-pool] : steady-pool-size element not defined"));
                }
            }else   // bean-pool not defined
            {
                addNaDetails(result, compName);
                result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable1",
                        "NOT APPLICABLE [AS-EJB] : bean-pool element not defined"));
            }
        }catch(Exception ex){
            addErrorDetails(result, compName);
            result.addErrorDetails(smh.getLocalString
                 (getClass().getName() + ".notRun",
                  "NOT RUN [AS-EJB] : Could not create an descriptor object"));
        }
        return result;
    }
View Full Code Here

     * @return result object containing the result of the individual test
     * performed
     */
    public Result check(ConnectorDescriptor descriptor) {
               
        Result result = getInitializedResult();
        ComponentNameConstructor compName =
          getVerifierContext().getComponentNameConstructor();
        // test NA for inboundRA
        if(!descriptor.getOutBoundDefined())
        {
          result.addNaDetails(smh.getLocalString
              ("tests.componentNameConstructor",
               "For [ {0} ]",
               new Object[] {compName.toString()}));
          result.notApplicable(smh.getLocalString
              ("com.sun.enterprise.tools.verifier.tests.connector.managed.notApplicableForInboundRA",
               "Resource Adapter does not provide outbound communication"));
          return result;
        }
  //File jarFile = Verifier.getJarFile(descriptor.getModuleDescriptor().getArchiveUri());
View Full Code Here

     */
    public Result check(ConnectorDescriptor descriptor) {

        boolean oneFailed = false;

        Result result = getInitializedResult();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        //Set properties = descriptor.getConfigProperties();
        ConnectionDefDescriptor desc = descriptor.getConnectionDefinitionByCFType(null, true);
        Set properties = desc.getConfigProperties();
        if (properties.size()!=0) {
            Iterator iterator = properties.iterator();
            // let's add the propery name
            // HashSet hs = new HashSet();
            while (iterator.hasNext()) {
                EnvironmentProperty ep = (EnvironmentProperty) iterator.next();
                String type = ep.getType();
                if (type == null) {
                    result.addErrorDetails(smh.getLocalString
                            ("tests.componentNameConstructor",
                                    "For [ {0} ]",
                                    new Object[] {compName.toString()}));
                    result.failed(smh.getLocalString(getClass().getName() + ".notdefined",
                            "Error: The configuration property named [ {0} ] has no type ",
                            new Object[] {ep.getName()}));
                    return result;
                }
                Class typeClass = null;
                // is it loadable ?
                try {
                    typeClass = Class.forName(type);
                } catch (Throwable t) {
                    result.addErrorDetails(smh.getLocalString
                            ("tests.componentNameConstructor",
                                    "For [ {0} ]",
                                    new Object[] {compName.toString()}));
                    result.failed(smh.getLocalString(getClass().getName() + ".nonexist",
                            "Error: The type [ {0} ] of the configuration property named [ {1} ] cannot be loaded",
                            new Object[] {ep.getType(), ep.getName()}));
                    return result;
                }
                boolean allowedType = false;
                for (int i = 0; i < allowedTypes.length; i++) {
                    if (allowedTypes[i].equals(typeClass)) {
                        allowedType = true;
                        break;
                    }
                }
                if (!allowedType) {
                    oneFailed = true;
                    result.addErrorDetails(smh.getLocalString
                            ("tests.componentNameConstructor",
                                    "For [ {0} ]",
                                    new Object[] {compName.toString()}));
                    result.failed(smh.getLocalString(getClass().getName() + ".failed",
                            "Error: The type [ {0} ] for the configuration property named [ {1} ] is not allowed",
                            new Object[] {ep.getType(), ep.getName()}));
                    return result;
                }
            }
            // for failure, result has been set before
            if (!oneFailed) {
                result.addGoodDetails(smh.getLocalString
                        ("tests.componentNameConstructor",
                                "For [ {0} ]",
                                new Object[] {compName.toString()}));
                result.passed(smh.getLocalString(getClass().getName() + ".passed",
                        "Success: all properties have an allowed type"));

            }
        } else {
            result.addNaDetails(smh.getLocalString
                    ("tests.componentNameConstructor",
                            "For [ {0} ]",
                            new Object[] {compName.toString()}));
            result.notApplicable(smh.getLocalString(getClass().getName() + ".notApplicable",
                    "Not Applicable: There are no config-property element defined" ));

        }
        return result;
    }
View Full Code Here

   * @return result object containing the result of the individual test
   * performed
   */
  public Result check(ConnectorDescriptor descriptor) {

    Result result = getInitializedResult();
    ComponentNameConstructor compName =
      getVerifierContext().getComponentNameConstructor();
    // test NA for inboundRA
    if(!descriptor.getOutBoundDefined())
    {
      result.addNaDetails(smh.getLocalString
          ("tests.componentNameConstructor",
           "For [ {0} ]",
           new Object[] {compName.toString()}));
      result.notApplicable(smh.getLocalString
          ("com.sun.enterprise.tools.verifier.tests.connector.managed.notApplicableForInboundRA",
           "Resource Adapter does not provide outbound communication"));
      return result;
    }
    OutboundResourceAdapter outboundRA =
      descriptor.getOutboundResourceAdapter();
    if(outboundRA == null)
    {
      return null;
    }
    boolean oneFailed = false;
    Set connDefs = outboundRA.getConnectionDefs();
    Iterator iter = connDefs.iterator();
    while(iter.hasNext())
    {
      ConnectionDefDescriptor connDefDesc = (ConnectionDefDescriptor)
        iter.next();
      String connectionInterface = connDefDesc.getConnectionFactoryIntf();
      String connectionImpl = connDefDesc.getConnectionFactoryImpl();
      Class implClass = null;
      try
      {
      implClass = Class.forName(connectionImpl, false, getVerifierContext().getClassLoader());
      }
      catch(ClassNotFoundException e)
      {
        result.addErrorDetails(smh.getLocalString
            ("tests.componentNameConstructor",
             "For [ {0} ]",
             new Object[] {compName.toString()}));
        result.failed(smh.getLocalString
            (getClass().getName() + ".nonexist",
             "Error: The class [ {0} ] as defined under connectionfactory-impl-class in the deployment descriptor does not exist",
             new Object[] {connectionImpl}));
        return result;
      }
      if(!isImplementorOf(implClass, connectionInterface))
      {
        oneFailed = true;
        result.addErrorDetails(smh.getLocalString
            ("tests.componentNameConstructor",
             "For [ {0} ]",
             new Object[] {compName.toString()}));
        result.failed(smh.getLocalString(getClass().getName() + ".failed",
              "Error: connectionfactory-impl-class [ {0} ] does not implement connectionfactory-interface [ {1} ].",
              new Object[] {implClass.getName(), connectionInterface}));
        return result;               
      }
    }
    if(!oneFailed)
    {
      result.addGoodDetails(smh.getLocalString
          ("tests.componentNameConstructor",
           "For [ {0} ]",
           new Object[] {compName.toString()}))
      result.passed(smh.getLocalString(getClass().getName() + ".passed",
            "Success: all connectionfactory-impl-class implement their corresponding connectionfactory-interface"));                    
    }
    return result;
  }
View Full Code Here

   * @return result object containing the result of the individual test
   * performed
   */
  public Result check(ConnectorDescriptor descriptor) {

    Result result = getInitializedResult();
    ComponentNameConstructor compName =
      getVerifierContext().getComponentNameConstructor();

    String impl = descriptor.getResourceAdapterClass();
    if(impl.equals(""))
    {
      if(descriptor.getInBoundDefined())
      {
        // resourceadapter-class cannot be null
        result.addErrorDetails(smh.getLocalString
            ("tests.componentNameConstructor",
             "For [ {0} ]",
             new Object[] {compName.toString()}));
        result.failed(smh.getLocalString
            (getClass().getName() + ".failed1",
             "resourceadapter-class cannot be empty if the resource" +
             " adapter provides inbound communication"));
      }
      else
      {
          result.addNaDetails(smh.getLocalString
              ("tests.componentNameConstructor",
               "For [ {0} ]",
               new Object[] {compName.toString()}));
          result.notApplicable(smh.getLocalString
              ("com.sun.enterprise.tools.verifier.tests.connector.resourceadapter.notApp",
               "resourceadapter-class is not specified."));
      }
      return result;
    }
    Context context = getVerifierContext();
    Class implClass = null;
    try
    {
      implClass = Class.forName(impl, false, getVerifierContext().getClassLoader());
    }
    catch(ClassNotFoundException e)
    {
      result.addErrorDetails(smh.getLocalString
          ("tests.componentNameConstructor",
           "For [ {0} ]",
           new Object[] {compName.toString()}));
      result.failed(smh.getLocalString
          ("com.sun.enterprise.tools.verifier.tests.connector.CheckResourceAdapter.nonexist",
           "Error: The class [ {0} ] as defined under resourceadapter-class in the deployment descriptor does not exist",
           new Object[] {impl}));
      return result;
    }
    Set configProps = descriptor.getConfigProperties();
    boolean oneFailed = false;
    Iterator propIter = configProps.iterator();
    BeanInfo bi = null;
    try
    {
      bi = Introspector.getBeanInfo(implClass, Object.class);
    }
    catch (IntrospectionException ie) {
      oneFailed = true;
      result.addErrorDetails(smh.getLocalString
          ("tests.componentNameConstructor",
           "For [ {0} ]",
           new Object[] {compName.toString()}));
      result.failed(smh.getLocalString
          (getClass().getName() + ".failed",
           "Error: The resourceadapter-class [ {0} ] is not JavaBeans compliant",
           new Object[] {impl} ));
      return result;
    }

    PropertyDescriptor[] properties = bi.getPropertyDescriptors();
    Hashtable<String, PropertyDescriptor> props = new Hashtable<String, PropertyDescriptor>();
    for(int i=0;i<properties.length;i++)
    {
      props.put(properties[i].getName(), properties[i]);
    }
    while(propIter.hasNext())
    {
      EnvironmentProperty envProp = (EnvironmentProperty) propIter.next();
      String name = Introspector.decapitalize(envProp.getName());
      String type = envProp.getType();
      PropertyDescriptor propDesc = props.get(name);
      if(propDesc != null)
      {
        if (propDesc.getReadMethod()==null || propDesc.getWriteMethod()==null)
        {
          oneFailed = true;
          result.addErrorDetails(smh.getLocalString
              ("tests.componentNameConstructor",
               "For [ {0} ]",
               new Object[] {compName.toString()}));
          result.failed(smh.getLocalString
              (getClass().getName() + ".failed1",
               "Error: The resourceadapter-class [ {0} ] does not provide accessor methods for [ {1} ].",
               new Object[] {impl, name} ));
          return result;
        }
      }
      else
      {
        oneFailed = true;
        result.addErrorDetails(smh.getLocalString
            ("tests.componentNameConstructor",
             "For [ {0} ]",
             new Object[] {compName.toString()}));
        result.failed(smh.getLocalString
            (getClass().getName() + ".failed1",
             "Error: The resourceadapter-class [ {0} ] does not provide accessor methods for [ {1} ].",
             new Object[] {impl, name} ));
        return result;
      }
    }
    if(!oneFailed)
    {
      result.addGoodDetails(smh.getLocalString
          ("tests.componentNameConstructor",
           "For [ {0} ]",
           new Object[] {compName.toString()}))
      result.passed(smh.getLocalString(getClass().getName() + ".passed",
            "Success: resourceadapter-class is a Java Bean"));                    
    }
    return result;
  }
View Full Code Here

     * @paramm descriptor deployment descriptor for the rar file
     * @return result object containing the result of the individual test
     * performed
     */
    public Result check(ConnectorDescriptor descriptor) {
        Result result = getInitializedResult();
        ComponentNameConstructor compName =
          getVerifierContext().getComponentNameConstructor();
        // test NA for inboundRA
        if(!descriptor.getOutBoundDefined())
        {
          result.addNaDetails(smh.getLocalString
              ("tests.componentNameConstructor",
               "For [ {0} ]",
               new Object[] {compName.toString()}));
          result.notApplicable(smh.getLocalString
              ("com.sun.enterprise.tools.verifier.tests.connector.managed.notApplicableForInboundRA",
               "Resource Adapter does not provide outbound communication"));
          return result;
        }
        Class mcf = testManagedConnectionFactoryImpl(descriptor, result);
View Full Code Here

   * @return result object containing the result of the individual test
   * performed
   */
  public Result check(ConnectorDescriptor descriptor) {

    Result result = getInitializedResult();
    ComponentNameConstructor compName =
      getVerifierContext().getComponentNameConstructor();
    // test NA for inboundRA
    if(!descriptor.getOutBoundDefined())
    {
      result.addNaDetails(smh.getLocalString
          ("tests.componentNameConstructor",
           "For [ {0} ]",
           new Object[] {compName.toString()}));
      result.notApplicable(smh.getLocalString
          ("com.sun.enterprise.tools.verifier.tests.connector.managed.notApplicableForInboundRA",
           "Resource Adapter does not provide outbound communication"));
      return result;
    }
    OutboundResourceAdapter outboundRA =
      descriptor.getOutboundResourceAdapter();
    if(outboundRA == null)
    {
      return null;
    }
    boolean oneFailed = false;
    Set connDefs = outboundRA.getConnectionDefs();
    Iterator iter = connDefs.iterator();
    while(iter.hasNext())
    {
      ConnectionDefDescriptor connDefDesc = (ConnectionDefDescriptor)
        iter.next();
      String connectionImpl = connDefDesc.getConnectionFactoryImpl();
      Class implClass = null;
      try
      {
        implClass = Class.forName(connectionImpl, false, getVerifierContext().getClassLoader());
      }
      catch(ClassNotFoundException e)
      {
        result.addErrorDetails(smh.getLocalString
            ("tests.componentNameConstructor",
             "For [ {0} ]",
             new Object[] {compName.toString()}));
        result.failed(smh.getLocalString
            (getClass().getName() + ".nonexist",
             "Error: The class [ {0} ] as defined under connectionfactory-impl-class in the deployment descriptor does not exist",
             new Object[] {connectionImpl}));
        return result;
      }
      if(!isImplementorOf(implClass, "javax.resource.Referenceable"))
      {
        oneFailed = true;
        result.addErrorDetails(smh.getLocalString
            ("tests.componentNameConstructor",
             "For [ {0} ]",
             new Object[] {compName.toString()}));
        result.failed(smh.getLocalString(getClass().getName() + ".failed",
              "Error: connectionfactory-impl-class [ {0} ] does not implement javax.resource.Referenceable",
              new Object[] {implClass.getName()}));
        return result;               
      }
    }
    if(!oneFailed)
    {
      result.addGoodDetails(smh.getLocalString
          ("tests.componentNameConstructor",
           "For [ {0} ]",
           new Object[] {compName.toString()}))
      result.passed(smh.getLocalString(getClass().getName() + ".passed",
            "Success: all connectionfactory-impl-class implement javax.resource.Referenceable"));                    
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.tools.verifier.Result

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.