1 20 package org.apache.cactus.sample.ejb; 21 22 import javax.naming.Context ; 23 import javax.naming.InitialContext ; 24 import javax.rmi.PortableRemoteObject ; 25 26 import org.apache.cactus.ServletTestCase; 27 28 33 public class TestConverterEJB extends ServletTestCase 34 { 35 38 private Converter converter; 39 40 43 public void setUp() throws Exception 44 { 45 Context ctx = new InitialContext (); 46 ConverterHome home = (ConverterHome) PortableRemoteObject.narrow( 47 ctx.lookup("Converter"), ConverterHome.class); 48 this.converter = home.create(); 49 } 50 51 55 public void testConvert() throws Exception 56 { 57 double dollar = this.converter.convertYenToDollar(100.0); 58 assertEquals("dollar", 1.0, dollar, 0.01); 59 } 60 } 61 | Popular Tags |