KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > verifier > tests > wsclients > MappingFileOnlyIfWSDLFileCheck


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 package com.sun.enterprise.tools.verifier.tests.wsclients;
24
25 import com.sun.enterprise.deployment.*;
26 import com.sun.enterprise.tools.verifier.*;
27 import com.sun.enterprise.tools.verifier.tests.*;
28 import java.io.IOException JavaDoc;
29 import java.lang.reflect.*;
30 import java.util.*;
31
32 /*
33  * @class.setup_props: ;
34  */

35
36 /*
37  * @testName: check
38  * @assertion_ids: JSR109_WS_48;
39  * @test_Strategy:
40  * @class.testArgs: Additional arguments (if any) to be passed when execing the client
41  * @testDescription: If the wsdl-file is not specified in the deployment descriptor, the
42  * jaxrpc-mapping-file must not be specified.
43  */

44
45 public class MappingFileOnlyIfWSDLFileCheck extends WSClientTest implements WSClientCheck {
46
47     /**
48      * @param descriptor the WebServices descriptor
49      * @return <code>Result</code> the results for this assertion
50      */

51     public Result check (ServiceReferenceDescriptor descriptor) {
52
53     Result result = getInitializedResult();
54         ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
55
56         if (!descriptor.hasWsdlFile()) {
57             if (descriptor.hasMappingFile()) {
58                // result.fail, mapping file specified without WSDL
59
result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
60                      "For [ {0} ]", new Object JavaDoc[] {compName.toString()}));
61                 result.failed(smh.getLocalString (getClass().getName() + ".failed",
62                 "Mapping file specified for this webservice [{0}] without a corresponding WSDL file.",
63                       new Object JavaDoc[] {compName.toString()}));
64             }
65             else {
66               // result.pass
67
result.addGoodDetails(smh.getLocalString ("tests.componentNameConstructor",
68                                    "For [ {0} ]", new Object JavaDoc[] {compName.toString()}));
69               result.passed(smh.getLocalString (getClass().getName() + ".passed",
70              "No Mapping file specified since there is no WSDL file."));
71
72             }
73         }
74         else {
75          // not applicable
76
// NOTE: the other way around things are being checked in another test
77
result.addNaDetails(smh.getLocalString
78                      ("tests.componentNameConstructor", "For [ {0} ]",
79                       new Object JavaDoc[] {compName.toString()}));
80          result.notApplicable(smh.getLocalString
81                  ( getClass().getName() + ".notapp",
82                  "Not Applicable since there is a WSDL file specified."));
83  
84         }
85
86         return result;
87     }
88  }
89
90
Popular Tags