1 22 package org.jboss.test.cache.test.aop; 23 24 import junit.framework.TestCase; 25 import junit.framework.Test; 26 27 import javax.naming.Context ; 28 import javax.naming.InitialContext ; 29 import java.util.Hashtable ; 30 import org.jboss.test.cache.bean.*; 31 import org.jboss.test.JBossTestCase; 32 33 38 public class CacheObjectMBeanUnitTestCase extends JBossTestCase 39 { 40 41 public static void main(String [] args) throws Exception 42 { 43 junit.textui.TestRunner.run(suite()); 44 } 45 46 50 public CacheObjectMBeanUnitTestCase(String arg0) 51 { 52 super(arg0); 53 } 54 55 public void testBinding() throws Exception 56 { 57 Hashtable props = new Hashtable (); 58 props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); 59 props.put(Context.PROVIDER_URL, "localhost:1099"); 60 Context ctx = new InitialContext (props); 61 CacheObjectMeanTesterHome home = (CacheObjectMeanTesterHome)ctx.lookup( 62 CacheObjectMeanTesterHome.JNDI_NAME); 63 CacheObjectMeanTester cacheTest = home.create(); 64 cacheTest.bind("id12345"); 65 } 66 67 68 public static Test suite() throws Exception 69 { 70 return getDeploySetup(getDeploySetup(CacheObjectMBeanUnitTestCase.class, "cachetest.jar"), 71 "cacheAoptest.sar"); 72 } 73 74 } 75 | Popular Tags |