1 45 package org.openejb.test.stateless; 46 47 import javax.ejb.EJBMetaData ; 48 49 55 public class StatelessEjbHomeTests extends BasicStatelessTestClient{ 56 57 public StatelessEjbHomeTests(){ 58 super("EJBHome."); 59 } 60 61 protected void setUp() throws Exception { 62 super.setUp(); 63 Object obj = initialContext.lookup("client/tests/stateless/BasicStatelessHome"); 64 ejbHome = (BasicStatelessHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicStatelessHome.class); 65 } 66 67 public void test01_getEJBMetaData(){ 71 try{ 72 EJBMetaData ejbMetaData = ejbHome.getEJBMetaData(); 73 assertNotNull( "EJBMetaData is null", ejbMetaData ); 74 } catch (Exception e){ 75 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 76 } 77 } 78 79 public void test02_getHomeHandle(){ 80 try{ 81 ejbHomeHandle = ejbHome.getHomeHandle(); 82 assertNotNull("The HomeHandle is null", ejbHomeHandle ); 83 } catch (Exception e){ 84 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 85 } 86 } 87 88 117 public void test03_removeByPrimaryKey(){ 118 try{ 119 ejbHome.remove("primaryKey"); 120 } catch (java.rmi.RemoteException e){ 121 assertTrue( true ); 122 return; 123 } catch (Exception e){ 124 fail("Received "+e.getClass()+" instead of java.rmi.RemoteException"); 125 } 126 assertTrue("java.rmi.RemoteException should have been thrown", false ); 127 } 128 } 132 | Popular Tags |