1 23 package com.sun.enterprise.tools.verifier.tests.web; 24 25 import com.sun.enterprise.tools.verifier.tests.web.WebTest; 26 import java.util.*; 27 import java.io.*; 28 import com.sun.enterprise.deployment.*; 29 import com.sun.enterprise.tools.verifier.*; 30 import com.sun.enterprise.tools.verifier.tests.*; 31 32 33 37 public class RealmName extends WebTest implements WebCheck { 38 39 40 48 public Result check(WebBundleDescriptor descriptor) { 49 50 Result result = getInitializedResult(); 51 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 52 53 if (descriptor.getLoginConfiguration() != null) { 54 String realmName = descriptor.getLoginConfiguration().getRealmName(); 55 if (realmName.length() > 0) { 56 result.addGoodDetails(smh.getLocalString 57 ("tests.componentNameConstructor", 58 "For [ {0} ]", 59 new Object [] {compName.toString()})); 60 result.passed(smh.getLocalString 61 (getClass().getName() + ".passed", 62 "The realm name [ {0} ] value specifies the realm name to use in HTTP Basic authentication within web application [ {1} ]", 63 new Object [] {realmName, descriptor.getName()})); 64 } else { 65 result.addNaDetails(smh.getLocalString 66 ("tests.componentNameConstructor", 67 "For [ {0} ]", 68 new Object [] {compName.toString()})); 69 result.notApplicable(smh.getLocalString 70 (getClass().getName() + ".notApplicable1", 71 "Not Applicable: The realm name [ {0} ] value does not specify the realm name to use in HTTP Basic authentication within web application [ {1} ]", 72 new Object [] {realmName, descriptor.getName()})); 73 } 74 } else { 75 result.addNaDetails(smh.getLocalString 76 ("tests.componentNameConstructor", 77 "For [ {0} ]", 78 new Object [] {compName.toString()})); 79 result.notApplicable(smh.getLocalString 80 (getClass().getName() + ".notApplicable", 81 "There are no realm name elements within this web archive [ {0} ]", 82 new Object [] {descriptor.getName()})); 83 } 84 85 return result; 86 } 87 } 88 | Popular Tags |