FileDocCategorySizeDatePackage
MappingFileOnlyIfWSDLFileCheck.javaAPI DocGlassfish v2 API4520Fri May 04 22:34:18 BST 2007com.sun.enterprise.tools.verifier.tests.wsclients

MappingFileOnlyIfWSDLFileCheck

public class MappingFileOnlyIfWSDLFileCheck extends WSClientTest implements WSClientCheck

Fields Summary
Constructors Summary
Methods Summary
public Resultcheck(ServiceReferenceDescriptor descriptor)

param
descriptor the WebServices descriptor
return
Result the results for this assertion


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

        if (!descriptor.hasWsdlFile()) {
            if (descriptor.hasMappingFile()) {
               // result.fail, mapping file specified without WSDL
                result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
                     "For [ {0} ]", new Object[] {compName.toString()}));
                result.failed(smh.getLocalString (getClass().getName() + ".failed",
                "Mapping file specified for this webservice [{0}] without a corresponding WSDL file.",
                      new Object[] {compName.toString()}));
            }
            else {
              // result.pass
              result.addGoodDetails(smh.getLocalString ("tests.componentNameConstructor",
                                   "For [ {0} ]", new Object[] {compName.toString()}));
              result.passed(smh.getLocalString (getClass().getName() + ".passed",
             "No Mapping file specified since there is no WSDL file."));

            }
        }
        else {
         // not applicable
         // NOTE: the other way around things are being checked in another test
         result.addNaDetails(smh.getLocalString
                     ("tests.componentNameConstructor", "For [ {0} ]",
                      new Object[] {compName.toString()}));
         result.notApplicable(smh.getLocalString
                 ( getClass().getName() + ".notapp",
                 "Not Applicable since there is a WSDL file specified."));
 
        }

        return result;