1 22 package org.jboss.test.jrmp.test; 23 24 import javax.naming.InitialContext ; 25 26 import junit.framework.Test; 27 import org.jboss.test.JBossTestCase; 28 import org.jboss.test.jrmp.interfaces.StatelessSession; 29 import org.jboss.test.jrmp.interfaces.StatelessSessionHome; 30 31 39 public class CustomSocketsUnitTestCase extends JBossTestCase 40 { 41 46 public CustomSocketsUnitTestCase(String name) 47 { 48 super(name); 49 } 50 51 52 57 public void testCustomAccess() throws Exception 58 { 59 log.info("+++ testCustomAccess"); 60 InitialContext jndiContext = new InitialContext (); 61 log.debug("Lookup StatelessSessionWithGZip"); 62 Object obj = jndiContext.lookup("StatelessSessionWithGZip"); 63 StatelessSessionHome home = (StatelessSessionHome)obj; 64 log.debug("Found StatelessSessionWithGZip Home"); 65 StatelessSession bean = home.create(); 66 log.debug("Created StatelessSessionWithGZip"); 67 String echo = bean.echo("jrmp-comp"); 69 log.debug("bean.echo(jrmp-comp) = " + echo); 70 bean.remove(); 71 } 72 73 78 public void testAccess() throws Exception 79 { 80 log.info("+++ testAccess"); 81 InitialContext jndiContext = new InitialContext (); 82 log.debug("Lookup StatelessSessionWithGZip"); 83 Object obj = jndiContext.lookup("StatelessSessionWithGZip"); 84 StatelessSessionHome home = (StatelessSessionHome)obj; 85 log.debug("Found StatelessSessionWithGZip Home"); 86 StatelessSession bean = home.create(); 87 log.debug("Created StatelessSessionWithGZip"); 88 String echo = bean.echo("jrmp"); 90 log.debug("bean.echo(jrmp) = " + echo); 91 bean.remove(); 92 } 93 94 public static Test suite() throws Exception 95 { 96 return getDeploySetup(CustomSocketsUnitTestCase.class, "jrmp-comp.jar"); 97 } 98 99 } 100 | Popular Tags |