1 45 package org.openejb.test.stateful; 46 47 import javax.ejb.EJBMetaData ; 48 49 55 public class StatefulEjbHomeTests extends BasicStatefulTestClient{ 56 57 public StatefulEjbHomeTests(){ 58 super("EJBHome."); 59 } 60 61 protected void setUp() throws Exception { 62 super.setUp(); 63 Object obj = initialContext.lookup("client/tests/stateful/BasicStatefulHome"); 64 ejbHome = (BasicStatefulHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicStatefulHome.class); 65 } 66 67 public void test01_getEJBMetaData(){ 71 try{ 72 EJBMetaData ejbMetaData = ejbHome.getEJBMetaData(); 73 assertNotNull( "The 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 Exception "+e.getClass()+ " : "+e.getMessage()); 125 } 126 assertTrue("java.rmi.RemoteException should have been thrown", false ); 127 } 128 } 132 | Popular Tags |