FileDocCategorySizeDatePackage
CmrFieldAccessor.javaAPI DocGlassfish v2 API4260Fri May 04 22:33:40 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2

CmrFieldAccessor

public class CmrFieldAccessor extends CmrFieldTest
Container-managed fields declaration test. CMR fields accessor methods names must the field name with the first letter uppercased and prefixed with get and set
author
Jerome Dochez
author
Sheetal Vartak
version

Fields Summary
Constructors Summary
Methods Summary
protected booleanrunIndividualCmrTest(Descriptor entity, com.sun.enterprise.deployment.RelationRoleDescriptor rrd, java.lang.Class c, com.sun.enterprise.tools.verifier.Result result)
run an individual verifier test of a declated cmr field of the class

param
entity the descriptor for the entity bean containing the cmp-field
param
rrd the descriptor for the declared cmr field
param
c the class owning the cmp field
param
result the result object to use to put the test results in
return
true if the test passed

	boolean oneFailed = false;
	ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
	    CMRFieldInfo info = rrd.getCMRFieldInfo();
	    if (info == null) {
		 addErrorDetails(result, compName);
		result.addErrorDetails(smh.getLocalString
		            ("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.CMPTest.isAccessorDeclared.failed1",
                            "Error : no CMR Field  declared ",
		            new Object[] {}));  
		return false;
	    }
	    oneFailed = isAccessorDeclared(info.name, info.type, c, result);
	    if (oneFailed == false) {
            // do nothing, appropriate message has been added in
            // isAccessorDeclared().
	    }else {
		 result.addGoodDetails(smh.getLocalString
				       ("tests.componentNameConstructor",
					"For [ {0} ]",
					new Object[] {compName.toString()}));
		result.addGoodDetails(smh.getLocalString
		            ("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.CMPTest.isAccessorDeclared.passed",
                            "CMR Field is properly declared ",
		            new Object[] {}));     
	    }
	    return oneFailed;