FileDocCategorySizeDatePackage
WebName.javaAPI DocGlassfish v2 API3700Fri May 04 22:34:10 BST 2007com.sun.enterprise.tools.verifier.tests.web

WebName

public class WebName extends com.sun.enterprise.tools.verifier.tests.web.WebTest implements WebCheck
Web name test. The Web provider must assign a display-name to each web application

Fields Summary
Constructors Summary
Methods Summary
public Resultcheck(WebBundleDescriptor descriptor)
Web name test. The Web provider must assign a display-name to each web application

param
descriptor the Web deployment descriptor
return
Result the results for this assertion


	Result result = getInitializedResult();
	ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
	String webName = descriptor.getName();

	if (webName.length() > 0) {
	    // as long as it's not blank, test should pass
	    result.addGoodDetails(smh.getLocalString
				  ("tests.componentNameConstructor",
				   "For [ {0} ]",
				   new Object[] {compName.toString()}));	
	    result.passed
	        (smh.getLocalString
	         (getClass().getName() + ".passed", 
	          "Web-App display name is : [ {0} ]", 
	          new Object [] {webName}));
	} else {
	    // it's blank, test should be N/A since <display-name> is optional
	    result.addNaDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
	    result.notApplicable
	        (smh.getLocalString
	         (getClass().getName() + ".failed", 
	          "Not Applicable: Web-App display name is not defined."));
	} 
	return result;