1 23 24 package com.sun.enterprise.tools.verifier.tests.ejb.ias.beanpool; 25 26 import com.sun.enterprise.tools.verifier.tests.ejb.EjbTest; 27 import java.util.*; 28 import com.sun.enterprise.deployment.EjbDescriptor; 29 import com.sun.enterprise.deployment.EjbSessionDescriptor; 30 import com.sun.enterprise.tools.verifier.*; 31 import com.sun.enterprise.tools.verifier.tests.*; 32 33 import com.sun.enterprise.tools.common.dd.ejb.*; 34 35 36 51 public class ASEjbBPMaxPoolSize extends ASEjbBeanPool 52 { 53 54 public Result check(EjbDescriptor descriptor) 55 { 56 57 Result result = getInitializedResult(); 58 ComponentNameConstructor compName = new ComponentNameConstructor(descriptor); 59 60 SunEjbJar ejbJar = descriptor.getEjbBundleDescriptor().getIasEjbObject(); 61 String ejbName = null; 62 Ejb testCase = null; 63 boolean oneFailed = false; 64 if(ejbJar!=null) 65 { 66 getBeanPool(descriptor,ejbJar); 67 if(beanPool!=null) 68 { 69 String maxPoolSize = beanPool.getMaxPoolSize(); 70 if(maxPoolSize!=null) 71 { 72 if(maxPoolSize.length()==0) 73 { 74 result.failed(smh.getLocalString(getClass().getName()+".failed1", 75 "FAILED [AS-EJB bean-pool] : max-pool-size cannot be empty")); 76 } 77 else 78 { 79 try 80 { 81 int value = Integer.valueOf(maxPoolSize).intValue(); 82 if(value < 0 || value > Integer.MAX_VALUE) 83 { 84 result.failed(smh.getLocalString(getClass().getName()+".failed2", 85 "FAILED [AS-EJB bean-pool] : max-pool-size cannot be {0}. It should be between 0 and {1}", 86 new Object []{new Integer (value),new Integer (Integer.MAX_VALUE)})); 87 } 88 else 89 { 90 result.passed(smh.getLocalString(getClass().getName()+".passed", 91 "PASSED [AS-EJB bean-pool] : max-pool-size is {0}", 92 new Object []{new Integer (value)})); 93 } 94 } 95 catch(NumberFormatException nfex) 96 { 97 Verifier.debug(nfex); 98 result.failed(smh.getLocalString(getClass().getName()+".failed3", 99 "FAILED [AS-EJB bean-pool] : The value {0} for max-pool-size is not a valid Integer number",new Object []{maxPoolSize})); 100 } 101 } 102 } 103 else 104 { 105 result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable", 106 "NOT APPLICABLE [AS-EJB bean-pool] : max-pool-size element not defined")); 107 } 108 } 109 else 110 { 111 result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable", 112 "NOT APPLICABLE [AS-EJB] : bean-pool element not defined")); 113 } 114 } 115 else 116 { 117 result.addErrorDetails(smh.getLocalString 118 ("tests.componentNameConstructor", 119 "For [ {0} ]", 120 new Object [] {compName.toString()})); 121 result.addErrorDetails(smh.getLocalString 122 (getClass().getName() + ".notRun", 123 "NOT RUN [AS-EJB] : Could not create an SunEjbJar object")); 124 } 125 return result; 126 } 127 } 128 | Popular Tags |