1 22 package org.jboss.ejb3.test.invoker.unit; 23 24 import java.util.Properties ; 25 import javax.naming.InitialContext ; 26 27 import org.jboss.ejb3.test.invoker.StatelessRemote; 28 import org.jboss.logging.Logger; 29 import org.jboss.test.JBossTestCase; 30 import junit.framework.Test; 31 32 36 public class InvokerTestCase extends JBossTestCase 37 { 38 private static final Logger log = Logger.getLogger(InvokerTestCase.class); 39 40 public InvokerTestCase(String name) 41 { 42 super(name); 43 } 44 45 public void testHttp() throws Exception 46 { 47 Properties props = new Properties (); 48 props.put("java.naming.factory.initial", "org.jboss.naming.HttpNamingContextFactory"); 49 props.put("java.naming.provider.url", "http://localhost:8080/invoker/JNDIFactory"); 50 props.put("java.naming.factory.url.pkgs", "org.jboss.naming"); 51 InitialContext jndiContext = new InitialContext (props); 52 54 StatelessRemote stateless = (StatelessRemote)jndiContext.lookup("StatelessHttp"); 55 assertNotNull(stateless); 56 57 try 58 { 59 assertEquals("echo", stateless.echo("echo")); 60 } catch (Exception e){ 61 e.printStackTrace(); 62 } 63 } 64 65 public static Test suite() throws Exception 66 { 67 return getDeploySetup(InvokerTestCase.class, "invoker-test.jar"); 68 } 69 } | Popular Tags |