1 22 package org.jboss.test.cmp2.commerce; 23 24 import java.util.*; 25 import junit.framework.*; 26 import javax.ejb.*; 27 import javax.naming.*; 28 import javax.rmi.PortableRemoteObject ; 29 30 public class UserTest extends TestCase { 31 32 public UserTest(String name) { 33 super(name); 34 } 35 36 private UserHome getUserHome() { 37 try { 38 InitialContext jndiContext = new InitialContext(); 39 40 Object ref = jndiContext.lookup("commerce/User"); 41 return (UserHome)PortableRemoteObject.narrow (ref, UserHome.class); 42 } catch(Exception e) { 43 fail("Exception in getUserHome: " + e.getMessage()); 44 } 45 return null; 46 } 47 48 private CustomerHome getCustomerHome() { 49 try { 50 InitialContext jndiContext = new InitialContext(); 51 52 Object ref = jndiContext.lookup("commerce/Customer"); 53 54 return (CustomerHome)PortableRemoteObject.narrow( 56 ref, CustomerHome.class); 57 } catch(Exception e) { 58 fail("Exception in getCustomerHome: " + e.getMessage()); 59 } 60 return null; 61 } 62 63 public void testUserQueries() throws Exception { 64 UserHome home = getUserHome(); 65 home.findAllByUserName("Test User 1"); 66 } 67 68 public void testAddCd() { 69 135 } 136 public static Test suite() { 137 return new TestSuite(UserTest.class); 138 } 139 } 140 141 142 143 | Popular Tags |