1 22 package org.jboss.ejb3.test.classloader.unit; 23 24 import junit.framework.Test; 25 26 import javax.naming.InitialContext ; 27 28 import org.jboss.test.JBossTestCase; 29 30 import org.jboss.ejb3.test.classloader.Session30; 31 32 36 public class ClassloaderUnitTestCase extends JBossTestCase 37 { 38 39 public ClassloaderUnitTestCase(String name) 40 { 41 super(name); 42 } 43 44 public void testEJBOverride() throws Exception 45 { 46 InitialContext jndiContext = new InitialContext (); 47 Session30 stateless = (Session30)jndiContext.lookup("Session30"); 48 assertNull(stateless.checkVersion()); 49 } 50 51 public void testSharedRepository() throws Exception 52 { 53 InitialContext jndiContext = new InitialContext (); 54 Session30 stateless = (Session30)jndiContext.lookup("Shared"); 55 assertNull(stateless.checkVersion()); 56 } 57 58 public void testUnharedRepository() throws Exception 59 { 60 InitialContext jndiContext = new InitialContext (); 61 Session30 stateless = (Session30)jndiContext.lookup("Unshared"); 62 Throwable t = stateless.checkVersion(); 63 assertNotNull(t); 64 assertTrue(t instanceof java.lang.NoSuchMethodException ); 65 } 66 67 70 public static Test suite() throws Exception 71 { 72 return getDeploySetup(ClassloaderUnitTestCase.class, "classloader.jar, classloader-shared.jar, classloader-unshared.jar"); 73 } 74 75 76 } 77 | Popular Tags |