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

WebEnvEntryName

public class WebEnvEntryName extends com.sun.enterprise.tools.verifier.tests.web.WebTest implements WebCheck
The environment entry name must be of finite length.

Fields Summary
Constructors Summary
Methods Summary
public Resultcheck(WebBundleDescriptor descriptor)
The environment entry name must be of finite length.

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


	Result result = getInitializedResult();
	ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        boolean oneFailed = false;
        EnvironmentProperty nextEnvironmentProperty;
        String envName;
	if (!descriptor.getEnvironmentProperties().isEmpty()) {

	    for (Iterator itr = descriptor.getEnvironmentProperties().iterator(); 
		 itr.hasNext();) {
		nextEnvironmentProperty = (EnvironmentProperty) itr.next();
                envName = nextEnvironmentProperty.getName();
		if (envName.length() > 0) {
		    result.addGoodDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
		    result.addGoodDetails
			(smh.getLocalString
			 (getClass().getName() + ".passed",
			  "Environment entry value [ {0} ] has valid name within web archive [ {1} ]",
			  new Object[] {nextEnvironmentProperty.getName(),descriptor.getName()}));
		} else {
		    oneFailed = true;
		    result.addErrorDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
		    result.addErrorDetails
			(smh.getLocalString
			 (getClass().getName() + ".failed",
			  "Error: Environment entry name must be of finite length"));
		} 
	    }
	    if (!oneFailed){
		result.setStatus(Result.PASSED);
	    } else {
		result.setStatus(Result.FAILED);
	    }
	} else {
            result.setStatus(Result.NOT_APPLICABLE);
	    result.addNaDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
	    result.notApplicable(smh.getLocalString
				 (getClass().getName() + ".notApplicable",
				  "There are no environment entry elements defined within this web archive [ {0} ]",
				  new Object[] {descriptor.getName()}));
	}

	return result;