KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > verifier > tests > web > ias > ASJSPConfig


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24
25
26 package com.sun.enterprise.tools.verifier.tests.web.ias;
27
28 import java.util.*;
29 import com.sun.enterprise.deployment.*;
30 import com.sun.enterprise.tools.verifier.*;
31 import com.sun.enterprise.tools.verifier.tests.*;
32 import com.sun.enterprise.deployment.ResourceReferenceDescriptor;
33 import com.sun.enterprise.deployment.WebBundleDescriptor;
34 import com.sun.enterprise.tools.verifier.tests.web.*;
35 import com.sun.enterprise.tools.common.dd.webapp.*;
36
37 //<addition author="irfan@sun.com" [bug/rfe]-id="4711198" >
38
/* Changed the result messages to reflect consistency between the result messages generated
39  * for the EJB test cases for SunONE specific deployment descriptors*/

40 //</addition>
41

42 public class ASJSPConfig extends WebTest implements WebCheck{
43
44
45 public Result check(WebBundleDescriptor descriptor) {
46
47
48     Result result = getInitializedResult();
49     WebComponentNameConstructor compName = new WebComponentNameConstructor(descriptor);
50         boolean oneFailed = false;
51         boolean notApp = false;
52         JspConfig jspConfig = descriptor.getIasWebApp().getJspConfig();
53
54         WebProperty[] webProps=null;
55
56         if(jspConfig !=null)
57             webProps = jspConfig.getWebProperty();
58
59     if (jspConfig!=null && webProps!=null && webProps.length > 0) {
60
61             if(ASWebProperty.checkWebProperties(webProps,result ,descriptor, this )){
62                   oneFailed=true;
63                   result.failed(smh.getLocalString
64                                 (getClass().getName() + ".failed",
65                                 "FAILED [AS-WEB sun-web-app] jsp-config - Atleast one name/value pair is not valid in [ {0} ].",
66                                 new Object JavaDoc[] {descriptor.getName()}));
67             }
68
69         } else {
70             notApp=true;
71         result.notApplicable(smh.getLocalString
72                  (getClass().getName() + ".notApplicable",
73                   "NOT APPLICABLE [AS-WEB sun-web-app] jsp-config element not defined in the web archive [ {0} ].",
74                   new Object JavaDoc[] {descriptor.getName()}));
75         }
76         if (oneFailed) {
77             result.setStatus(Result.FAILED);
78         } else if(notApp) {
79             result.setStatus(Result.NOT_APPLICABLE);
80         }else {
81             result.setStatus(Result.PASSED);
82             result.passed
83             (smh.getLocalString
84                     (getClass().getName() + ".passed",
85                     "PASSED [AS-WEB sun-web-app] jsp-config elements are valid within the web archive [ {0} ].",
86                     new Object JavaDoc[] {descriptor.getName()} ));
87         }
88     return result;
89     }
90
91 }
92
93
Popular Tags