1 22 package org.jboss.ejb3.test.pool.unit; 23 24 25 import javax.naming.InitialContext ; 26 import org.jboss.ejb3.test.pool.ExampleTimer; 27 import org.jboss.logging.Logger; 28 import org.jboss.test.JBossTestCase; 29 import junit.framework.Test; 30 31 37 public class PoolTestCase 38 extends JBossTestCase { 39 41 private static final Logger log = Logger 42 .getLogger(PoolTestCase.class); 43 44 public PoolTestCase(String name) 45 { 46 super(name); 47 } 48 49 public void test1() throws Exception 50 { 51 InitialContext jndiContext = getInitialContext(); 52 ExampleTimer timerBean = (ExampleTimer)jndiContext.lookup("ExampleTimer"); 53 timerBean.scheduleTimer(50); 54 Thread.sleep(50 * 1000); 55 } 56 57 public void test2() throws Exception 58 { 59 InitialContext jndiContext = getInitialContext(); 60 ExampleTimer timerBean = (ExampleTimer)jndiContext.lookup("ExampleTimer"); 61 timerBean.scheduleTimer(50); 62 Thread.sleep(50 * 1000); 63 } 64 65 protected void setUp() throws Exception 66 { 67 } 68 69 public static Test suite() throws Exception 70 { 71 return getDeploySetup(PoolTestCase.class, "pool.jar"); 72 } 73 74 } 75 | Popular Tags |