Package com.sun.enterprise.tools.verifier.tests

Examples of com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor


     * @return <code>Result</code> the results for this assertion
     */
    public Result check(WebBundleDescriptor descriptor) {

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

        result.setStatus(Result.NOT_APPLICABLE);
        result.addNaDetails(smh.getLocalString
                ("tests.componentNameConstructor",
                        "For [ {0} ]",
                        new Object[] {compName.toString()}));
        result.addNaDetails(smh.getLocalString
                (getClass().getName() + ".notApplicable",
                        "There is no url-pattern element within the web archive [ {0} ]",
                        new Object[] {descriptor.getName()}));
        checkWebResourceCollections(descriptor, result, compName);
View Full Code Here


     * @return <code>Result</code> the results for this assertion
     */
    public Result check(EjbDescriptor descriptor) {

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

  if(getHomeInterfaceName(descriptor) == null || "".equals(getHomeInterfaceName(descriptor))){
            addNaDetails(result, compName);
            result.notApplicable(smh.getLocalString
                       ("com.sun.enterprise.tools.verifier.tests.ejb.localinterfaceonly.notapp",
View Full Code Here

  
    public Result check(EjbDescriptor descriptor) {

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

  if(getHomeInterfaceName(descriptor) == null || "".equals(getHomeInterfaceName(descriptor))){
            result.addNaDetails(smh.getLocalString
                        ("tests.componentNameConstructor", "For [ {0} ]",
                         new Object[] {compName.toString()}));
            result.notApplicable(smh.getLocalString
                       ("com.sun.enterprise.tools.verifier.tests.ejb.localinterfaceonly.notapp",
                        "Not Applicable because, EJB [ {0} ] has Local Interfaces only.",
                                          new Object[] {descriptor.getEjbClassName()}));

      return result;
  }


  if ((descriptor instanceof EjbSessionDescriptor) ||
      (descriptor instanceof EjbEntityDescriptor)) {
      try {
    Context context = getVerifierContext();
    ClassLoader jcl = context.getClassLoader();
    Class c = Class.forName(getClassName(descriptor), false, jcl);

    // remote interface must be defined as public
    boolean isPublic = false;
    int modifiers = c.getModifiers();
    if (Modifier.isPublic(modifiers)) {
        isPublic = true;
    }
    // it extends the proper EJBHome, but is it's modifier public
    if (!isPublic){
        result.addErrorDetails(smh.getLocalString
             ("tests.componentNameConstructor",
              "For [ {0} ]",
              new Object[] {compName.toString()}));
        result.failed(smh.getLocalString
          (getClass().getName() + ".failed",
           "Error: [ {0} ] is not defined as public.  All enterprise beans home interfaces must be defined as public.  [ {1} ] is not a valid home interface.",
           new Object[] {getClassName(descriptor),getClassName(descriptor)}));
    } else {
        result.addGoodDetails(smh.getLocalString
            ("tests.componentNameConstructor",
             "For [ {0} ]",
             new Object[] {compName.toString()}));
     
    result.passed(smh.getLocalString
          (getClass().getName() + ".passed",
           "[ {0} ] properly declares the home interface as public.",
           new Object[] {getClassName(descriptor)}));
    }
      } catch (ClassNotFoundException e) {
    Verifier.debug(e);
    result.addErrorDetails(smh.getLocalString
               ("tests.componentNameConstructor",
          "For [ {0} ]",
          new Object[] {compName.toString()}));
    result.failed(smh.getLocalString
            (getClass().getName() + ".failedException",
             "Error: [ {0} ] class not found.",
             new Object[] {getClassName(descriptor)}));
     
      return result;
  } else {
      result.addNaDetails(smh.getLocalString
        ("tests.componentNameConstructor",
         "For [ {0} ]",
         new Object[] {compName.toString()}));
      result.notApplicable(smh.getLocalString
         (getClass().getName() + ".notApplicable",
          "[ {0} ] expected {1} bean or {2} bean, but called with {3}.",
          new Object[] {getClass(),"Session","Entity",descriptor.getName()}));
      return result;
View Full Code Here

     *
     * @param descriptor the deployment descriptor for the bean
     * @param method the method to run the test on
     */
    protected void runIndividualHomeMethodTest( Method method,EjbDescriptor descriptor, Result result) {
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        Class methodReturnType = method.getReturnType();
       
        // The methods arguments types must be legal types for
        // RMI-IIOP.  This means that their return values must
        // be of valid types for RMI-IIOP,
View Full Code Here

     */

    protected void runIndividualHomeMethodTest(Method method, EjbDescriptor descriptor, Result result) {
       
        Method m;
  ComponentNameConstructor compName = null;
  try {   
      compName = getVerifierContext().getComponentNameConstructor();
      // retrieve the remote interface methods
      ClassLoader jcl = getVerifierContext().getClassLoader();
      Class ejbClass = Class.forName(descriptor.getEjbClassName(), false, jcl);
View Full Code Here

     * @param method the method to run the test on
     */
protected void runIndividualHomeMethodTest(Method method,EjbDescriptor descriptor, Result result) {
    
     Class[] methodParameterTypes = method.getParameterTypes();
     ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
     // The methods arguments types must be legal types for
     // RMI-IIOP.  This means that their arguments
     // must be of valid types for RMI-IIOP,
     if (RmiIIOPUtils.isValidRmiIIOPParameters(methodParameterTypes)) {
         // these method parameters are valid, continue
View Full Code Here

public class TagLibPublicID extends WebTest implements WebCheck {

    public Result check(WebBundleDescriptor descriptor) {

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

        String acceptablePubidLiterals[] = {
            "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" ,
            "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" };
View Full Code Here

*/
public class MessageListenerMethodModifiers extends MessageBeanTest {

    public Result check(EjbMessageBeanDescriptor descriptor) {
        Result result = getInitializedResult();
        ComponentNameConstructor compName =
                            getVerifierContext().getComponentNameConstructor();

        ClassLoader cl = getVerifierContext().getClassLoader();
        try {
            Class intfCls = Class.forName(descriptor.getMessageListenerType(), false, cl);
View Full Code Here

*
*/
public class TagClassImplementsValidInterface extends WebTest implements WebCheck {
    public Result check(WebBundleDescriptor descriptor) {

        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        Context context = getVerifierContext();
        Result result = getInitializedResult();
        ClassLoader cl = context.getClassLoader();
        TagLibDescriptor tlds[] = context.getTagLibDescriptors();
        if (tlds == null) {
View Full Code Here

     * @return <code>Result</code> the results for this assertion
     */
    public Result check (WebServiceEndpoint wsdescriptor) {

  Result result = getInitializedResult();
  ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
  boolean foundFailure=false;
        if (wsdescriptor.implementedByEjbComponent()) {
            EjbDescriptor ejbdesc = wsdescriptor.getEjbComponentImpl();
            if (ejbdesc != null && (ejbdesc instanceof EjbSessionDescriptor)) {
                EjbSessionDescriptor descriptor = (EjbSessionDescriptor)ejbdesc;
                if (EjbSessionDescriptor.STATELESS.equals(descriptor.getSessionType())) {
                    try {
                        //Context context = getVerifierContext();
                        ClassLoader jcl = getVerifierContext().getClassLoader();
                        Class c = Class.forName(descriptor.getEjbClassName(), false, getVerifierContext().getClassLoader());
                        int foundAtLeastOne = 0;

                        do {
                            Method [] methods = c.getDeclaredMethods();
                            for (int i = 0; i < methods.length; i++) {
                                // The method name must be ejbRemove.
                                if (methods[i].getName().startsWith("ejbRemove")) {
                                    foundAtLeastOne++;
                                result.addGoodDetails(smh.getLocalString
                                            ("tests.componentNameConstructor",
                                                    "For [ {0} ]",
                                                    new Object[] {compName.toString()}));
                                    result.addGoodDetails(smh.getLocalString
                                            (getClass().getName() + ".passed",
                                                    "[ {0} ] declares [ {1} ] method.",
                                                    new Object[] {descriptor.getEjbClassName(),methods[i].getName()}));
                                }
                            }
                        } while (((c = c.getSuperclass()) != null) && (foundAtLeastOne == 0));
                        if (foundAtLeastOne == 0){
                            foundFailure = true;
                            result.addErrorDetails(smh.getLocalString
                                    ("tests.componentNameConstructor",
                                            "For [ {0} ]",
                                            new Object[] {compName.toString()}));
                            result.failed(smh.getLocalString
                                    (getClass().getName() + ".failed",
                                            "Error: [ {0} ] does not properly declare at least one ejbRemove() method.  [ {1} ] is not a valid bean.",
                                            new Object[] {descriptor.getEjbClassName(),descriptor.getEjbClassName()}));
                        }
                    } catch (ClassNotFoundException e) {
                        Verifier.debug(e);
                        result.addErrorDetails(smh.getLocalString
                                ("tests.componentNameConstructor",
                                        "For [ {0} ]",
                                        new Object[] {compName.toString()}));
                        result.failed(smh.getLocalString
                                (getClass().getName() + ".failedException",
                                        "Error: [ {0} ] class not found.",
                                        new Object[] {descriptor.getEjbClassName()}));
                        return result;
                    }
                } else {
                    result.addNaDetails(smh.getLocalString
                            ("tests.componentNameConstructor", "For [ {0} ]",
                                    new Object[] {compName.toString()}));
                    result.notApplicable(smh.getLocalString
                            (getClass().getName() + ".notApplicable",
                                    "NOT APPLICABLE :Service Implementation bean is not a stateless Session Bean"));
                    return result;
                }
            } else {
                result.addNaDetails(smh.getLocalString
                        ("tests.componentNameConstructor",
                                "For [ {0} ]",
                                new Object[] {compName.toString()}));
                result.notApplicable(smh.getLocalString
                        (getClass().getName() + ".notApplicable1",
                                "NOT APPLICABLE:Service Implementation bean is null or not a session bean descriptor "));
                return result;
            }

            if (foundFailure) {
                result.setStatus(result.FAILED);
            } else {
                result.setStatus(result.PASSED);
            }
            return result;

        } else {
            result.addNaDetails(smh.getLocalString
                    ("tests.componentNameConstructor",
                            "For [ {0} ]",
                            new Object[] {compName.toString()}));
            result.notApplicable(smh.getLocalString
                    (getClass().getName() + ".notApplicable2",
                            "Not Applicable: Service Implementation bean is not implemented by Ejb."));
            return result;
        }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor

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.