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

RealmName

public class RealmName extends com.sun.enterprise.tools.verifier.tests.web.WebTest implements WebCheck
The Web realm name specifies the realm name to use in HTTP Basic authentication

Fields Summary
Constructors Summary
Methods Summary
public Resultcheck(WebBundleDescriptor descriptor)
The Web realm name specifies the realm name to use in HTTP Basic authentication

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


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

	if (descriptor.getLoginConfiguration() != null) {
	    String realmName = descriptor.getLoginConfiguration().getRealmName();
	    if (realmName.length() > 0) {
		result.addGoodDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));	
		result.passed(smh.getLocalString
				      (getClass().getName() + ".passed",
				       "The realm name [ {0} ] value specifies the realm name to use in HTTP Basic authentication within web application [ {1} ]",
				       new Object[] {realmName, descriptor.getName()}));
	    } else {
		result.addNaDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
		result.notApplicable(smh.getLocalString
				       (getClass().getName() + ".notApplicable1",
					"Not Applicable: The realm name [ {0} ] value does not specify the realm name to use in HTTP Basic authentication within web application [ {1} ]",
					new Object[] {realmName, descriptor.getName()}));
	    }
	} else {
	    result.addNaDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
	    result.notApplicable(smh.getLocalString
				 (getClass().getName() + ".notApplicable",
				  "There are no realm name elements within this web archive [ {0} ]",
				  new Object[] {descriptor.getName()}));
	}

	return result;