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(EjbDescriptor descriptor) {

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

        if (descriptor instanceof EjbSessionDescriptor) {
            try {
                Context context = getVerifierContext();
View Full Code Here


     * @return <code>Result</code> the results for this assertion
     */

    public Result check(WebBundleDescriptor descriptor) {
        Result result = getInitializedResult();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        //This test is not applicable for application based on Servlet Spec 2.3
        String prefix = XpathPrefixResolver.fakeXPrefix;
        String query = prefix + ":" + "web-app/" + prefix + ":" + "session-config";
        int count = getNonRuntimeCountNodeSet(query);
       
View Full Code Here

     *
     * @return <code>Result</code> the results for this assertion
     */
    public Result check(WebBundleDescriptor descriptor) {
        Result result = getInitializedResult();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        boolean oneWarning = false, onePassed = false;

        Enumeration filterEnum = descriptor.getServletFilterDescriptors().elements();
        if (filterEnum.hasMoreElements()) {
            // get the filters in this .war
            while (filterEnum.hasMoreElements()) {
                ServletFilterDescriptor filter = (ServletFilterDescriptor) filterEnum.nextElement();
                Vector epVector = filter.getInitializationParameters();

                if (epVector.size() != 0) {
                    for ( int i = 0; i < epVector.size(); i++) {
                        EnvironmentProperty ep = (EnvironmentProperty)epVector.elementAt(i);
                        String epValue = ep.getValue();
                        if (epValue.length() != 0) {
                            onePassed=true;
                            addGoodDetails(result, compName);
                            result.addGoodDetails(smh.getLocalString
                                              ("com.sun.enterprise.tools.verifier.tests.web.FilterInitParamValue" + ".passed",
                                               "Param value exists for the filter [ {0} ].",
                                               new Object[] {filter.getName()}));
                        } else {
                            oneWarning = true;
                            addWarningDetails(result, compName);
                            result.addWarningDetails(smh.getLocalString
                                    ("com.sun.enterprise.tools.verifier.tests.web.FilterInitParamValue" + ".warning",
                                            "WARNING: Param value entry for the filter [ {0} ] should be of finite length.",
                                            new Object[] {filter.getName()}));
                        }
                    }
                } else {
                    addNaDetails(result, compName);
                    result.notApplicable(smh.getLocalString
                            ("com.sun.enterprise.tools.verifier.tests.web.FilterInitParamValue" + ".notApplicable",
                                    "There are no initialization parameters for the filter [ {0} ] within the web archive [ {1} ]",
                                    new Object[] {filter.getName(), descriptor.getName()}));

                }
            }
            if (oneWarning) {
                result.setStatus(Result.WARNING);
            } else if (onePassed){
                result.setStatus(Result.PASSED);
            }
        } else {
            result.addNaDetails(smh.getLocalString
                    ("tests.componentNameConstructor",
                            "For [ {0} ]",
                            new Object[] {compName.toString()}));
            result.notApplicable(smh.getLocalString
                    ("com.sun.enterprise.tools.verifier.tests.web.FilterInitParamValue" + ".notApplicable1",
                            "There are no filters defined within the web archive [ {0} ]",
                            new Object[] {descriptor.getName()}));
        }
View Full Code Here

        return ((WebServiceEndpoint) descriptor).getBundleDescriptor();
    }

    protected ComponentNameConstructor getComponentNameConstructor(
            Descriptor descriptor) {
        return new ComponentNameConstructor((WebServiceEndpoint)descriptor);
    }
View Full Code Here

*/
public class RemoteExceptionNotThrown extends MessageBeanTest {

    public Result check(EjbMessageBeanDescriptor descriptor) {
        Result result = getInitializedResult();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        ClassLoader cl = getVerifierContext().getClassLoader();
        try {
            Method[] methods = descriptor.getMessageListenerInterfaceMethods(cl);
            for (int i = 0; i < methods.length; i++) {
                if(containsRemote(methods[i].getExceptionTypes())) {
View Full Code Here

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

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

    if (descriptor.getTransactionType().equals
        (EjbDescriptor.CONTAINER_TRANSACTION_TYPE)) {

View Full Code Here

     * @param descriptor the Application deployment descriptor
     *
     * @return <code>Result</code> the results for this assertion
     */
    public Result check(Application descriptor) {
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        Result result = getInitializedResult();
       
        for (Iterator itr = descriptor.getRarDescriptors().iterator(); itr.hasNext();) {
            ConnectorDescriptor cond = (ConnectorDescriptor) itr.next();
           
View Full Code Here

     *
     * @return <code>Result</code> the results for this assertion
     */
    public Result check(Application descriptor) {
       
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        Result result = getInitializedResult();
       
        // java element specifies the URI of a java application
        // client module, relative to the top level of the application package
        for (Iterator itr = descriptor.getApplicationClientDescriptors().iterator(); itr.hasNext();) {
View Full Code Here

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

  Result result = getInitializedResult();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        boolean pass = true;
        String portcomponentname = null;
        try {

           portcomponentname = descriptor.getEndpointName();
           if ( portcomponentname == null )
              pass = false;
           if ( portcomponentname.equals("") )
              pass = false;

           if (pass) {
              result.addGoodDetails(smh.getLocalString ("tests.componentNameConstructor",
                                   "For [ {0} ]", new Object[] {compName.toString()}));
              result.passed(smh.getLocalString (getClass().getName() + ".passed",
                          "The webservices.xml file for [ {0} ] has the port-component-name element specified.",
                           new Object[] {compName.toString()}));
            }
            else {
             result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
                                   "For [ {0} ]", new Object[] {compName.toString()}));
             result.failed(smh.getLocalString (getClass().getName() + ".failed",
               "The webservices.xml file for [ {0} ] does not have the port-component-name element specified.",
                new Object[] {compName.toString()}));
            }
        }catch (Exception e) {
            //result.fail
            result.addErrorDetails(smh.getLocalString
               ("com.sun.enterprise.tools.verifier.tests.webservices.Error",
View Full Code Here

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

        Result result = getInitializedResult();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        String[] reqSchemaLocationSub1 =
                    {"http://java.sun.com/xml/ns/j2ee", "http://java.sun.com/xml/ns/javaee"};
        String[] reqSchemaLocationSub2 =
                    {"http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd",
                     "http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd"};
        boolean rslt = false;
        String schemaVersion = getVerifierContext().getSchemaVersion();
        Document wsdoc=getVerifierContext().getWebServiceDocument();
        //with jax-ws it is not mandatory to define webservices.xml deployment descriptor
        if (wsdoc == null && schemaVersion.compareTo("1.1") > 0) {
            addGoodDetails(result, compName);
            result.passed(smh.getLocalString(getClass().getName() + ".passed1",
                    "Webservices deployment descriptor is not defined for this archive"));
            return result;
        }

        try {
           if (wsdoc.getDocumentElement().hasAttributes()) {
               getNode(wsdoc);
               if ( myValue != null) {
                   for(i=0; i<reqSchemaLocation.length; i++) {
                       rslt = verifySchema(myValue, reqSchemaLocation[i],
                               reqSchemaLocationSub1[i], reqSchemaLocationSub2[i]);
                       if(rslt) break;
                   }
               }
           }
           if (rslt) {
              result.addGoodDetails(smh.getLocalString ("tests.componentNameConstructor",
                                   "For [ {0} ]", new Object[] {compName.toString()}));
              result.passed(smh.getLocalString (getClass().getName() + ".passed",
                          "The schemaLocation in the webservices.xml file for [{0}] matches the schema file requirement",
                           new Object[] {compName.toString()}));
            }
            else {
             result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
                                   "For [ {0} ]", new Object[] {compName.toString()}));
             result.failed(smh.getLocalString (getClass().getName() + ".failed",
               "The schemaLocation in the webservices.xml file for [{0}] does not match the schema file requirement",
                new Object[] {compName.toString()}));
            }
        }catch (Exception e) {
            //result.fail
            result.failed(smh.getLocalString
                (getClass().getName() + ".failed",
               "The schemaLocation in the webservices.xml file for [{0}] does not match the schema file requirement",
                new Object[] {compName.toString()}));
            result.addErrorDetails(smh.getLocalString
               ("com.sun.enterprise.tools.verifier.tests.webservices.Error",
                "Error: Unexpected error occurred [ {0} ]",
                new Object[] {e.getMessage()}));
        }
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.