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 52 public class ASEjbBPPoolIdleTime extends ASEjbBeanPool 53 { 54 55 public Result check(EjbDescriptor descriptor) 56 { 57 58 Result result = getInitializedResult(); 59 ComponentNameConstructor compName = new ComponentNameConstructor(descriptor); 60 61 SunEjbJar ejbJar = descriptor.getEjbBundleDescriptor().getIasEjbObject(); 62 String ejbName = null; 63 Ejb testCase = null; 64 boolean oneFailed = false; 65 if(ejbJar!=null) 66 { 67 getBeanPool(descriptor,ejbJar); 68 if(beanPool!=null) 69 { 70 String poolIdleTimeout = beanPool.getPoolIdleTimeoutInSeconds(); 71 if(poolIdleTimeout!=null) 72 { 73 if(poolIdleTimeout.length()==0) 74 { 75 result.failed(smh.getLocalString(getClass().getName()+".failed1", 76 "FAILED [AS-EJB bean-pool] : pool-idle-timeout-in-seconds cannot be empty")); 77 } 78 else 79 { 80 try 81 { 82 long value = Long.valueOf(poolIdleTimeout).longValue(); 83 if(value < 0 || value > Long.MAX_VALUE) 84 { 85 result.failed(smh.getLocalString(getClass().getName()+".failed2", 86 "FAILED [AS-EJB bean-pool] : pool-idle-timeout-in-seconds cannot be {0}. It should be between 0 and {1}", 87 new Object []{new Long (value),new Long (Long.MAX_VALUE)})); 88 } 89 else 90 { 91 result.passed(smh.getLocalString(getClass().getName()+".passed", 92 "PASSED [AS-EJB bean-pool] : pool-idle-timeout-in-seconds is {0}", 93 new Object []{new Long (value)})); 94 } 95 } 96 catch(NumberFormatException nfex) 97 { 98 Verifier.debug(nfex); 99 result.failed(smh.getLocalString(getClass().getName()+".failed3", 100 "FAILED [AS-EJB bean-pool] : {0} is not a valid Long number",new Object []{poolIdleTimeout})); 101 } 102 } 103 } 104 else 105 { 106 result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable", 107 "NOT APPLICABLE [AS-EJB bean-pool] : pool-idle-timeout-in-seconds element not defined")); 108 } 109 } 110 else 111 { 112 result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable", 113 "NOT APPLICABLE [AS-EJB] : bean-pool element not defined")); 114 } 115 } 116 else 117 { 118 result.addErrorDetails(smh.getLocalString 119 ("tests.componentNameConstructor", 120 "For [ {0} ]", 121 new Object [] {compName.toString()})); 122 result.addErrorDetails(smh.getLocalString 123 (getClass().getName() + ".notRun", 124 "NOT RUN [AS-EJB] : Could not create an SunEjbJar object")); 125 } 126 return result; 127 } 128 } 129 130 131 | Popular Tags |