1 23 28 29 package com.sun.enterprise.tools.verifier.tests.connector; 30 31 import java.util.*; 32 import com.sun.enterprise.deployment.ConnectorDescriptor; 33 import com.sun.enterprise.tools.verifier.tests.*; 34 import com.sun.enterprise.deployment.EnvironmentProperty; 35 import com.sun.enterprise.tools.verifier.Result; 36 37 42 public class CheckConfigPropertyName extends ConnectorTest implements ConnectorCheck { 43 44 45 54 public Result check(ConnectorDescriptor descriptor) { 55 56 Result result = getInitializedResult(); 57 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 58 Set properties = descriptor.getConfigProperties(); 59 Iterator iterator = properties.iterator(); 60 HashSet<String > hs = new HashSet<String >(); 62 while (iterator.hasNext()) { 63 EnvironmentProperty ep = (EnvironmentProperty) iterator.next(); 64 if (hs.add(ep.getName())==false) { 65 result.addErrorDetails(smh.getLocalString 67 ("tests.componentNameConstructor", 68 "For [ {0} ]", 69 new Object [] {compName.toString()})); 70 result.failed(smh.getLocalString(getClass().getName() + ".failed", 71 "Error: More than one propery has a duplicate name [ {0} ] in the deployment descriptors", 72 new Object [] {ep.getName()})); 73 return result; 74 } 75 } 76 result.addGoodDetails(smh.getLocalString 78 ("tests.componentNameConstructor", 79 "For [ {0} ]", 80 new Object [] {compName.toString()})); 81 result.passed(smh.getLocalString(getClass().getName() + ".passed", 82 "There are no config properties with a duplicate name")); 83 return result; 84 85 } 86 } 87 | Popular Tags |