1 45 package org.openejb.test; 46 47 import java.util.Properties ; 48 49 import javax.naming.InitialContext ; 50 51 56 public class IvmTestServer implements TestServer { 57 58 private Properties properties; 59 60 public void init(Properties props){ 61 62 properties = props; 63 64 try{ 65 props.put("java.naming.factory.initial", "org.openejb.client.LocalInitialContextFactory"); 66 Properties p = new Properties (props); 67 p.put("openejb.loader", "embed"); 68 new InitialContext ( p ); 69 70 }catch(Exception oe){ 72 System.out.println("========================="); 73 System.out.println(""+oe.getMessage()); 74 System.out.println("========================="); 75 oe.printStackTrace(); 76 throw new RuntimeException ("OpenEJB could not be initiated"); 77 } 78 } 79 80 public void destroy(){ 81 } 82 83 public void start(){ 84 } 85 86 public void stop(){ 87 88 } 89 90 public Properties getContextEnvironment(){ 91 return (Properties )properties.clone(); 92 } 93 94 } 95 | Popular Tags |