1 17 18 package org.apache.geronimo.connector; 19 20 import java.util.Timer ; 21 import javax.resource.spi.XATerminator ; 22 import javax.resource.spi.work.WorkManager ; 23 24 import junit.framework.TestCase; 25 import org.apache.geronimo.connector.work.GeronimoWorkManager; 26 import org.apache.geronimo.pool.ThreadPool; 27 import org.apache.geronimo.transaction.manager.GeronimoTransactionManager; 28 29 33 public class BootstrapContextTest extends TestCase { 34 ThreadPool pool; 35 protected void setUp() throws Exception { 36 super.setUp(); 37 pool = new ThreadPool(1, "Connector Test", 30000, ThreadPool.class.getClassLoader(), "foo:test=bar"); 38 } 39 40 43 public void testGetSetWorkManager() throws Exception { 44 GeronimoTransactionManager transactionManager = new GeronimoTransactionManager(); 45 GeronimoWorkManager manager = new GeronimoWorkManager(pool, pool, pool, transactionManager); 46 GeronimoBootstrapContext context = new GeronimoBootstrapContext(manager, transactionManager); 47 WorkManager wm = context.getWorkManager(); 48 49 assertSame("Make sure it is the same object", manager, wm); 50 } 51 52 55 public void testGetSetXATerminator() throws Exception { 56 GeronimoTransactionManager transactionManager = new GeronimoTransactionManager(); 57 GeronimoWorkManager manager = new GeronimoWorkManager(pool, pool, pool, transactionManager); 58 GeronimoBootstrapContext context = new GeronimoBootstrapContext(manager, transactionManager); 59 XATerminator xat = context.getXATerminator(); 60 61 assertSame("Make sure it is the same object", transactionManager, xat); 62 } 63 64 67 public void testGetTimer() throws Exception { 68 GeronimoBootstrapContext context = new GeronimoBootstrapContext(null, null); 69 Timer t = context.createTimer(); 70 assertNotNull("Object is not null", t); 71 } 72 73 } 74 | Popular Tags |