tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlaskow...@apache.org
Subject svn commit: r653281 - in /openejb/trunk/openejb3: ./ container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ container/openejb-core/src/main/java/org/apache/openejb/config/ container/openejb-core/src/main/resources/org/apache/openejb...
Date Sun, 04 May 2008 22:26:00 GMT
Author: jlaskowski
Date: Sun May  4 15:25:59 2008
New Revision: 653281

URL: http://svn.apache.org/viewvc?rev=653281&view=rev
Log:
New junit test - ConfigurationFactoryTest - and its implications:
- Upgrade to maven-surefire-plugin 2.4.2
- Introduce forkMode always of maven-surefire-plugin (it's because some tests might rely on SystemInstance.get() being static)
- Externalize messages to their message bundles


Added:
    openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigurationFactoryTest.java   (with props)
    openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/config/
    openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/config/configurationfactory-openejb.xml   (with props)
Removed:
    openejb/trunk/openejb3/server/openejb-ejbd/src/test/java/org/apache/openejb/SomeoneBrokeSurefireAndThisIsADirtyHackForItTest.java
Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AppModule.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigUtils.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/Messages.properties
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/config/Messages.properties
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/util/resources/Messages.properties
    openejb/trunk/openejb3/pom.xml
    openejb/trunk/openejb3/server/openejb-ejbd/pom.xml
    openejb/trunk/openejb3/server/openejb-ejbd/src/test/java/org/apache/openejb/RemoteiTest.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java?rev=653281&r1=653280&r2=653281&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java Sun May  4 15:25:59 2008
@@ -23,7 +23,6 @@
 import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.net.URLClassLoader;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -32,7 +31,6 @@
 import java.util.Map;
 import java.util.Properties;
 import java.util.TreeMap;
-import java.util.Collections;
 import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ThreadFactory;
@@ -82,6 +80,7 @@
 import org.apache.openejb.spi.SecurityService;
 import org.apache.openejb.util.LogCategory;
 import org.apache.openejb.util.Logger;
+import org.apache.openejb.util.Messages;
 import org.apache.openejb.util.OpenEJBErrorHandler;
 import org.apache.openejb.util.SafeToolkit;
 import org.apache.openejb.util.proxy.ProxyFactory;
@@ -93,7 +92,20 @@
 
 public class Assembler extends AssemblerTool implements org.apache.openejb.spi.Assembler {
 
+    public static final String JAVA_OPENEJB_NAMING_CONTEXT = "java:openejb/";
+
+    public static final String PERSISTENCE_UNIT_NAMING_CONTEXT = "java:openejb/PersistenceUnit/";
+
+    public static final String DEFAULT_CONFIGURATOR = "org.apache.openejb.config.ConfigurationFactory";
+
+    public static final String CONFIGURATOR_PROPERTY = "openejb.configurator";
+
+    private static final String OPENEJB_URL_PKG_PREFIX = "org.apache.openejb.core.ivm.naming";
+
+    public static final String DUCT_TAPE_PROPERTY = "duct tape";
+
     public static final Logger logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP, Assembler.class);
+    Messages messages = new Messages(Assembler.class.getPackage().getName());
 
     private final CoreContainerSystem containerSystem;
     private final PersistenceClassLoaderHandler persistenceClassLoaderHandler;
@@ -199,26 +211,23 @@
 
     public void init(Properties props) throws OpenEJBException {
         this.props = props;
-        /* Get Configuration ////////////////////////////*/
         String className = props.getProperty(EnvProps.CONFIGURATION_FACTORY);
         if (className == null) {
-            className = props.getProperty("openejb.configurator", "org.apache.openejb.config.ConfigurationFactory");
+            className = props.getProperty(CONFIGURATOR_PROPERTY, DEFAULT_CONFIGURATOR);
         }
 
         configFactory = (OpenEjbConfigurationFactory) toolkit.newInstance(className);
         configFactory.init(props);
-
-        /*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
     }
 
     public static void installNaming() {
-        if (System.getProperty("duct tape") != null) return;
+        if (System.getProperty(DUCT_TAPE_PROPERTY) != null) return;
         
         /* Add IntraVM JNDI service /////////////////////*/
         Properties systemProperties = System.getProperties();
         synchronized (systemProperties) {
             String str = systemProperties.getProperty(Context.URL_PKG_PREFIXES);
-            String naming = "org.apache.openejb.core.ivm.naming";
+            String naming = OPENEJB_URL_PKG_PREFIX;
             if (str == null) {
                 str = naming;
             } else if (str.indexOf(naming) == -1) {
@@ -452,7 +461,7 @@
             for (PersistenceUnitInfo info : appInfo.persistenceUnits) {
                 try {
                     EntityManagerFactory factory = persistenceBuilder.createEntityManagerFactory(info, classLoader);
-                    containerSystem.getJNDIContext().bind("java:openejb/PersistenceUnit/" + info.id, factory);
+                    containerSystem.getJNDIContext().bind(PERSISTENCE_UNIT_NAMING_CONTEXT + info.id, factory);
                 } catch (NameAlreadyBoundException e) {
                     throw new OpenEJBException("PersistenceUnit already deployed: " + info.persistenceUnitRootUrl);
                 } catch (Exception e) {
@@ -490,7 +499,7 @@
 
                 JaccPermissionsBuilder jaccPermissionsBuilder = new JaccPermissionsBuilder();
                 PolicyContext policyContext = jaccPermissionsBuilder.build(ejbJar, deployments);
-                if (System.getProperty("duct tape") == null) {
+                if (System.getProperty(DUCT_TAPE_PROPERTY) == null) {
                     jaccPermissionsBuilder.install(policyContext);
                 }
 
@@ -784,9 +793,9 @@
         checkImplementation(interfce, service.getClass(), serviceInfo.service, serviceInfo.id);
 
         try {
-            this.containerSystem.getJNDIContext().bind("java:openejb/" + serviceInfo.service + "/" + serviceInfo.id, service);
+            this.containerSystem.getJNDIContext().bind(JAVA_OPENEJB_NAMING_CONTEXT + serviceInfo.service + "/" + serviceInfo.id, service);
         } catch (NamingException e) {
-            throw new OpenEJBException("Cannot bind " + serviceInfo.service + " with id " + serviceInfo.id, e);
+            throw new OpenEJBException(messages.format("assembler.cannotBindServiceWithId", serviceInfo.service, serviceInfo.id), e);
         }
 
         setSystemInstanceComponent(interfce, service);
@@ -812,7 +821,7 @@
             if (containerInfo.id.equals(containerId)) {
                 iterator.remove();
                 try {
-                    this.containerSystem.getJNDIContext().unbind("java:openejb/" + containerInfo.service + "/" + containerInfo.id);
+                    this.containerSystem.getJNDIContext().unbind(JAVA_OPENEJB_NAMING_CONTEXT + containerInfo.service + "/" + containerInfo.id);
                 } catch (Exception e) {
                     logger.error("removeContainer.unbindFailed", containerId);
                 }
@@ -835,7 +844,7 @@
         ProxyManager.setDefaultFactory(serviceInfo.id);
 
         try {
-            this.containerSystem.getJNDIContext().bind("java:openejb/" + serviceInfo.service + "/" + serviceInfo.id, service);
+            this.containerSystem.getJNDIContext().bind(JAVA_OPENEJB_NAMING_CONTEXT + serviceInfo.service + "/" + serviceInfo.id, service);
         } catch (NamingException e) {
             throw new OpenEJBException("Cannot bind " + serviceInfo.service + " with id " + serviceInfo.id, e);
         }
@@ -871,8 +880,7 @@
                 throw new OpenEJBException("No existing resource adapter defined with id '" + id + "'.");
             }
             if (!(resourceAdapter instanceof ResourceAdapter)) {
-                throw new OpenEJBException("Resource adapter defined with id '" + id + "' is not an instance of ResourceAdapter, " +
-                        "but is an instance of " + resourceAdapter.getClass());
+                throw new OpenEJBException(messages.format("assembler.resourceAdapterNotResourceAdapter", id, resourceAdapter.getClass()));
             }
             serviceRecipe.setProperty("ResourceAdapter", resourceAdapter);
         }
@@ -894,7 +902,7 @@
 
             // resource adapters only work with a geronimo transaction manager
             if (!(transactionManager instanceof GeronimoTransactionManager)) {
-                throw new OpenEJBException("The use of a resource adapter requires a Geronimo transaction manager");
+                throw new OpenEJBException(messages.format("assembler.requiresGeronimoTX"));
             }
             GeronimoTransactionManager geronimoTransactionManager = (GeronimoTransactionManager) transactionManager;
 
@@ -943,7 +951,7 @@
             // create the connection manager
             ConnectionManager connectionManager = (ConnectionManager) connectionManagerRecipe.create();
             if (connectionManager == null) {
-                throw new RuntimeException("Invalid connection manager specified for connector identity = " + serviceInfo.id);
+                throw new RuntimeException(messages.format("assembler.invalidConnectionManager", serviceInfo.id));
             }
 
             Map<String, Object> unsetA = serviceRecipe.getUnsetProperties();
@@ -999,7 +1007,7 @@
         checkImplementation(interfce, service.getClass(), serviceInfo.service, serviceInfo.id);
 
         try {
-            this.containerSystem.getJNDIContext().bind("java:openejb/" + serviceInfo.service + "/" + serviceInfo.id, service);
+            this.containerSystem.getJNDIContext().bind(JAVA_OPENEJB_NAMING_CONTEXT + serviceInfo.service + "/" + serviceInfo.id, service);
         } catch (NamingException e) {
             throw new OpenEJBException("Cannot bind " + serviceInfo.service + " with id " + serviceInfo.id, e);
         }
@@ -1030,7 +1038,7 @@
         checkImplementation(interfce, service.getClass(), serviceInfo.service, serviceInfo.id);
 
         try {
-            this.containerSystem.getJNDIContext().bind("java:openejb/" + serviceInfo.service, service);
+            this.containerSystem.getJNDIContext().bind(JAVA_OPENEJB_NAMING_CONTEXT + serviceInfo.service, service);
         } catch (NamingException e) {
             throw new OpenEJBException("Cannot bind " + serviceInfo.service + " with id " + serviceInfo.id, e);
         }
@@ -1063,7 +1071,7 @@
         checkImplementation(interfce, service.getClass(), serviceInfo.service, serviceInfo.id);
 
         try {
-            this.containerSystem.getJNDIContext().bind("java:openejb/" + serviceInfo.service, service);
+            this.containerSystem.getJNDIContext().bind(JAVA_OPENEJB_NAMING_CONTEXT + serviceInfo.service, service);
         } catch (NamingException e) {
             throw new OpenEJBException("Cannot bind " + serviceInfo.service + " with id " + serviceInfo.id, e);
         }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java?rev=653281&r1=653280&r2=653281&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java Sun May  4 15:25:59 2008
@@ -91,14 +91,12 @@
         //
         //  Persistence Units
         //
-
         buildPersistenceModules(appModule, appInfo);
 
 
         //
         //  EJB Jars
         //
-
         Map<String,EjbJarInfo> ejbJarInfos = new TreeMap<String,EjbJarInfo>();
         for (EjbModule ejbModule : appModule.getEjbModules()) {
             try {
@@ -156,26 +154,22 @@
         //
         //  Application Clients
         //
-
         buildClientModules(appModule, appInfo, jndiEncInfoBuilder);
 
         //
         //  J2EE Connectors
         //
-
         buildConnectorModules(appModule, appInfo);
 
         //
         //  Webapps
         //
-
         buildWebModules(appModule, jndiEncInfoBuilder, appInfo);
 
 
         //
         //  Final AppInfo creation
         //
-
         appInfo.jarPath = appModule.getJarLocation();
         appInfo.watchedResources.addAll(appModule.getWatchedResources());
         List<URL> additionalLibraries = appModule.getAdditionalLibraries();
@@ -200,7 +194,7 @@
         ReportValidationResults reportValidationResults = new ReportValidationResults();
         reportValidationResults.deploy(appModule);
 
-        logger.info("Loaded Module: " + appInfo.jarPath);
+        logger.info("config.appLoaded", appInfo.jarPath);
         return appInfo;
 
     }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AppModule.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AppModule.java?rev=653281&r1=653280&r2=653281&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AppModule.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AppModule.java Sun May  4 15:25:59 2008
@@ -51,8 +51,8 @@
         this.classLoader = classLoader;
         this.jarLocation = jarLocation;
         File file = new File(jarLocation);
-        moduleId = file.getName();
-        validation = new ValidationContext(AppModule.class, jarLocation);
+        this.moduleId = file.getName();
+        this.validation = new ValidationContext(AppModule.class, jarLocation);
     }
 
     public ValidationContext getValidation() {

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigUtils.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigUtils.java?rev=653281&r1=653280&r2=653281&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigUtils.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigUtils.java Sun May  4 15:25:59 2008
@@ -32,6 +32,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Properties;
 
@@ -48,6 +49,14 @@
         return ConfigUtils.searchForConfiguration(path, SystemInstance.get().getProperties());
     }
 
+    /**
+     * TODO: It should always be assumed that the path input param is a URL or URL-convertible
+     * 
+     * @param path
+     * @param props
+     * @return
+     * @throws OpenEJBException
+     */
     public static String searchForConfiguration(String path, Properties props) throws OpenEJBException {
         File file = null;
         if (path != null) {
@@ -84,6 +93,17 @@
             } catch (IOException ignored) {
             }
 
+            /*
+             * [4] Consider path as a URL resource - file: and jar: accepted by JaxbOpenejb.readConfig(String configFile)
+             */
+            try {
+                // verify if it's parseable according to URL rules
+                new URL(path);
+                // it's so return it unchanged
+                return path;
+            } catch (MalformedURLException ignored) {
+            }
+            
             logger.warning("Cannot find the configuration file [" + path + "], Trying conf/openejb.xml instead.");
         }
 

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java?rev=653281&r1=653280&r2=653281&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java Sun May  4 15:25:59 2008
@@ -19,6 +19,8 @@
 import java.io.File;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLClassLoader;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -81,14 +83,18 @@
 
 public class ConfigurationFactory implements OpenEjbConfigurationFactory {
 
+    static final String CONFIGURATION_PROPERTY = "openejb.configuration";
+    static final String CONF_FILE_PROPERTY = "openejb.conf.file";
+    private static final String DEBUGGABLE_VM_HACKERY_PROPERTY = "openejb.debuggable-vm-hackery";
+    private static final String DUCT_TAPE_PROPERTY = "duct tape";
+    protected static final String VALIDATION_SKIP_PROPERTY = "openejb.validation.skip";
     private static final Logger logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP_CONFIG, ConfigurationFactory.class);
     private static final Messages messages = new Messages(ConfigurationFactory.class);
 
-    private String configLocation = "";
+    private String configLocation;
 
     private OpenEjbConfiguration sys;
 
-
     private Openejb openejb;
 
     private DynamicDeployer deployer;
@@ -99,58 +105,6 @@
         this(false);
     }
 
-    public ConfigurationFactory(boolean offline, OpenEjbConfiguration configuration) {
-        this(offline, (DynamicDeployer) null);
-        sys = configuration;
-    }
-
-    public ConfigurationFactory(boolean offline,
-        DynamicDeployer preAutoConfigDeployer,
-        OpenEjbConfiguration configuration) {
-        this(offline, preAutoConfigDeployer);
-        sys = configuration;
-    }
-    
-    public static List<HandlerChainInfo> toHandlerChainInfo(HandlerChains chains) {
-        List<HandlerChainInfo> handlerChains = new ArrayList<HandlerChainInfo>();
-        if (chains == null) return handlerChains;
-
-        for (HandlerChain handlerChain : chains.getHandlerChain()) {
-            HandlerChainInfo handlerChainInfo = new HandlerChainInfo();
-            handlerChainInfo.serviceNamePattern = handlerChain.getServiceNamePattern();
-            handlerChainInfo.portNamePattern = handlerChain.getPortNamePattern();
-            handlerChainInfo.protocolBindings.addAll(handlerChain.getProtocolBindings());
-            for (Handler handler : handlerChain.getHandler()) {
-                HandlerInfo handlerInfo = new HandlerInfo();
-                handlerInfo.handlerName = handler.getHandlerName();
-                handlerInfo.handlerClass = handler.getHandlerClass();
-                handlerInfo.soapHeaders.addAll(handler.getSoapHeader());
-                handlerInfo.soapRoles.addAll(handler.getSoapRole());
-                for (ParamValue param : handler.getInitParam()) {
-                    handlerInfo.initParams.setProperty(param.getParamName(), param.getParamValue());
-                }
-                handlerChainInfo.handlers.add(handlerInfo);
-            }
-            handlerChains.add(handlerChainInfo);
-        }
-        return handlerChains;
-    }
-
-    public static class Chain implements DynamicDeployer{
-        private final List<DynamicDeployer> chain = new ArrayList<DynamicDeployer>();
-
-        public boolean add(DynamicDeployer o) {
-            return chain.add(o);
-        }
-
-        public AppModule deploy(AppModule appModule) throws OpenEJBException {
-            for (DynamicDeployer deployer : chain) {
-                appModule = deployer.deploy(appModule);
-            }
-            return appModule;
-        }
-    }
-
     public ConfigurationFactory(boolean offline) {
         this(offline, (DynamicDeployer) null);
     }
@@ -167,17 +121,17 @@
 
         chain.add(new ClearEmptyMappedName());
 
-        boolean shouldValidate = !SystemInstance.get().getProperty("openejb.validation.skip", "false").equalsIgnoreCase("true");
+        boolean shouldValidate = !Boolean.parseBoolean(SystemInstance.get().getProperty(VALIDATION_SKIP_PROPERTY, "false"));
         if (shouldValidate) {
             chain.add(new ValidateModules());
         } else {
-            DeploymentLoader.logger.info("Validation is disabled.");
+            DeploymentLoader.logger.info("validationDisabled", VALIDATION_SKIP_PROPERTY);
         }
 
         chain.add(new InitEjbDeployments());
 
-        String debuggableVmHackery = SystemInstance.get().getProperty("openejb.debuggable-vm-hackery", "false");
-        if (debuggableVmHackery.equalsIgnoreCase("true")){
+        String debuggableVmHackery = SystemInstance.get().getProperty(DEBUGGABLE_VM_HACKERY_PROPERTY, "false");
+        if (Boolean.parseBoolean(debuggableVmHackery)){
             chain.add(new DebuggableVmHackery());
         }
 
@@ -188,7 +142,7 @@
         chain.add(new SunConversion());
         chain.add(new WlsConversion());
 
-        if (System.getProperty("duct tape") != null){
+        if (System.getProperty(DUCT_TAPE_PROPERTY) != null){
             // must be after CmpJpaConversion since it adds new persistence-context-refs
             chain.add(new GeronimoMappedName());
         }
@@ -214,17 +168,67 @@
         this.deployer = chain;
     }
 
-    public void init(Properties props) throws OpenEJBException {
+    public ConfigurationFactory(boolean offline, OpenEjbConfiguration configuration) {
+        this(offline, (DynamicDeployer) null, configuration);
+    }
+
+    public ConfigurationFactory(boolean offline,
+        DynamicDeployer preAutoConfigDeployer,
+        OpenEjbConfiguration configuration) {
+        this(offline, preAutoConfigDeployer);
+        sys = configuration;
+    }
+    
+    public static List<HandlerChainInfo> toHandlerChainInfo(HandlerChains chains) {
+        List<HandlerChainInfo> handlerChains = new ArrayList<HandlerChainInfo>();
+        if (chains == null) return handlerChains;
 
-        configLocation = props.getProperty("openejb.conf.file");
+        for (HandlerChain handlerChain : chains.getHandlerChain()) {
+            HandlerChainInfo handlerChainInfo = new HandlerChainInfo();
+            handlerChainInfo.serviceNamePattern = handlerChain.getServiceNamePattern();
+            handlerChainInfo.portNamePattern = handlerChain.getPortNamePattern();
+            handlerChainInfo.protocolBindings.addAll(handlerChain.getProtocolBindings());
+            for (Handler handler : handlerChain.getHandler()) {
+                HandlerInfo handlerInfo = new HandlerInfo();
+                handlerInfo.handlerName = handler.getHandlerName();
+                handlerInfo.handlerClass = handler.getHandlerClass();
+                handlerInfo.soapHeaders.addAll(handler.getSoapHeader());
+                handlerInfo.soapRoles.addAll(handler.getSoapRole());
+                for (ParamValue param : handler.getInitParam()) {
+                    handlerInfo.initParams.setProperty(param.getParamName(), param.getParamValue());
+                }
+                handlerChainInfo.handlers.add(handlerInfo);
+            }
+            handlerChains.add(handlerChainInfo);
+        }
+        return handlerChains;
+    }
+
+    public static class Chain implements DynamicDeployer{
+        private final List<DynamicDeployer> chain = new ArrayList<DynamicDeployer>();
+
+        public boolean add(DynamicDeployer o) {
+            return chain.add(o);
+        }
+
+        public AppModule deploy(AppModule appModule) throws OpenEJBException {
+            for (DynamicDeployer deployer : chain) {
+                appModule = deployer.deploy(appModule);
+            }
+            return appModule;
+        }
+    }
+
+    public void init(Properties props) throws OpenEJBException {
 
+        configLocation = props.getProperty(CONF_FILE_PROPERTY);
         if (configLocation == null) {
-            configLocation = props.getProperty("openejb.configuration");
+            configLocation = props.getProperty(CONFIGURATION_PROPERTY);
         }
 
         configLocation = ConfigUtils.searchForConfiguration(configLocation, props);
         if (configLocation != null) {
-            props.setProperty("openejb.configuration", configLocation);
+            props.setProperty(CONFIGURATION_PROPERTY, configLocation);
         }
 
     }
@@ -289,9 +293,8 @@
 
         for (Container declaration : openejb.getContainer()) {
             Class<? extends ContainerInfo> infoClass = getContainerInfoType(declaration.getType());
-
             if (infoClass == null) {
-                throw new OpenEJBException("Unrecognized container type " + declaration.getType());
+                throw new OpenEJBException(messages.format("unrecognizedContainerType", declaration.getType()));
             }
 
             ContainerInfo info = configureService(declaration, infoClass);
@@ -360,13 +363,9 @@
             } catch (URISyntaxException e) {
                 throw new OpenEJBException("Unable to parse URI parameters '" + uri + "'. URISyntaxException: " + e.getMessage());
             }
-
             if (object instanceof AbstractService) {
                 AbstractService service = (AbstractService) object;
-
                 service.setId(id);
-
-
                 service.setType(map.remove("type"));
                 service.setProvider(map.remove("provider"));
                 service.getProperties().putAll(map);
@@ -374,6 +373,15 @@
                 Deployments deployments = (Deployments) object;
                 deployments.setDir(map.remove("dir"));
                 deployments.setJar(map.remove("jar"));
+                String cp = map.remove("classpath");
+                if (cp != null) {
+                    String[] paths = cp.split(File.pathSeparator);
+                    List<URL> urls = new ArrayList<URL>();
+                    for (String path : paths) {
+                        urls.add(new File(path).toURI().normalize().toURL());
+                    }
+                    deployments.setClasspath(new URLClassLoader(urls.toArray(new URL[0])));
+                }
             }
 
             return object;
@@ -552,11 +560,10 @@
             }
 
             T info;
-
             try {
                 info = infoType.newInstance();
             } catch (Exception e) {
-                throw new OpenEJBException("Cannot instantiate class " + infoType.getName(), e);
+                throw new OpenEJBException(messages.format("configureService.cannotInstantiateClass", infoType.getName()), e);
             }
 
             info.service = provider.getService();
@@ -635,7 +642,7 @@
         try {
             service = serviceClass.newInstance();
         } catch (Exception e) {
-            throw new OpenEJBException("Cannot instantiate service class '" + serviceClass.getName() + "'", e);
+            throw new OpenEJBException(messages.format("configureService.cannotInstantiateClass", serviceClass.getName()), e);
         }
         service.setId(serviceId);
         service.setProvider(providerId);
@@ -768,18 +775,10 @@
         return null;
     }
 
-    @SuppressWarnings({"UnusedDeclaration", "EmptyFinallyBlock"})
     private boolean isResourceType(String service, List<String> types, String type) {
-        boolean b = false;
-        try {
-            if (type == null) return b = true;
-            if (service == null) return b = false;
-            return b = types.contains(type);
-        } finally {
-//            System.out.println("isResourceType: "+b+" ["+service +"] ["+type+"] ["+ Join.join(",", types)+"]");
-//            Throwable throwable = new Exception().fillInStackTrace();
-//            throwable.printStackTrace(System.out);
-        }
+        if (type == null) return true;
+        if (service == null) return false;
+        return types.contains(type);
     }
 
     protected List<String> getContainerIds() {

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java?rev=653281&r1=653280&r2=653281&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java Sun May  4 15:25:59 2008
@@ -18,8 +18,6 @@
 
 import static org.apache.openejb.util.URLs.toFile;
 
-import static java.net.URLDecoder.decode;
-
 import org.apache.openejb.config.sys.Deployments;
 import org.apache.openejb.config.sys.JaxbOpenejb;
 import org.apache.openejb.loader.FileUtils;
@@ -30,7 +28,6 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
-import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -41,6 +38,8 @@
  */
 public class DeploymentsResolver {
 
+    static final String DEPLOYMENTS_CLASSPATH_PROPERTY = "openejb.deployments.classpath";
+    static final String SEARCH_CLASSPATH_FOR_DEPLOYMENTS_PROPERTY = DEPLOYMENTS_CLASSPATH_PROPERTY;
     private static final String CLASSPATH_INCLUDE = "openejb.deployments.classpath.include";
     private static final String CLASSPATH_EXCLUDE = "openejb.deployments.classpath.exclude";
     private static final String CLASSPATH_REQUIRE_DESCRIPTOR = "openejb.deployments.classpath.require.descriptor";
@@ -139,8 +138,8 @@
         deployments = new ArrayList<Deployments>(deployments);
 
         //// getOption /////////////////////////////////  BEGIN  ////////////////////
-        String flag = SystemInstance.get().getProperty("openejb.deployments.classpath", "true").toLowerCase();
-        boolean searchClassPath = flag.equals("true");
+        String flag = SystemInstance.get().getProperty(DEPLOYMENTS_CLASSPATH_PROPERTY, "true");
+        boolean searchClassPath = Boolean.parseBoolean(flag);
         //// getOption /////////////////////////////////  END  ////////////////////
 
         if (searchClassPath) {
@@ -316,7 +315,7 @@
         String path;
         for (URL url : urls) {
             try {
-                Class moduleType = DeploymentLoader.discoverModuleType(url, classLoader, searchForDescriptorlessApplications);
+                Class<? extends DeploymentModule> moduleType = DeploymentLoader.discoverModuleType(url, classLoader, searchForDescriptorlessApplications);
                 if (AppModule.class.isAssignableFrom(moduleType) || EjbModule.class.isAssignableFrom(moduleType)) {
                     deployment = JaxbOpenejb.createDeployments();
                     if (url.getProtocol().equals("jar")) {

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/Messages.properties
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/Messages.properties?rev=653281&r1=653280&r2=653281&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/Messages.properties (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/Messages.properties Sun May  4 15:25:59 2008
@@ -22,6 +22,18 @@
 # error("assembler.noAgent");
 assembler.noAgent = JAVA AGENT NOT INSTALLED. The JPA Persistence Provider requested installation of a ClassFileTransformer which requires a JavaAgent.  See http://openejb.apache.org/3.0/javaagent.html
 
+#throw new OpenEJBException(messages.format("assembler.cannotBindServiceWithId", serviceInfo.service, serviceInfo.id), e);
+assembler.cannotBindServiceWithId=Cannot bind {0} with id {1} 
+
+#throw new OpenEJBException(messages.format("assembler.resourceAdapterNotResourceAdapter", id, resourceAdapter.getClass()));
+assembler.resourceAdapterNotResourceAdapter="Resource adapter defined with id '{0}' is not an instance of ResourceAdapter, but is an instance of {1}
+
+#throw new OpenEJBException(messages.format("assembler.requiresGeronimoTX"));
+assembler.requiresGeronimoTX=The use of a resource adapter requires a Apache Geronimo transaction manager
+
+#throw new RuntimeException(messages.format("assembler.invalidConnectionManager", serviceInfo.id));
+assembler.invalidConnectionManager=Invalid connection manager specified for connector identity = {0}
+
 # PersistenceBuilder.java
 # logger.info("assembler.buildingPersistenceUnit", unitInfo.getPersistenceUnitName(), unitInfo.getPersistenceProviderClassName(), unitInfo.getPersistenceUnitRootUrl(), unitInfo.getTransactionType());
 assembler.buildingPersistenceUnit = PersistenceUnit(name={0}, provider={1})

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/config/Messages.properties
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/config/Messages.properties?rev=653281&r1=653280&r2=653281&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/config/Messages.properties (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/config/Messages.properties Sun May  4 15:25:59 2008
@@ -124,7 +124,7 @@
 
 
 # info("config.configApp", appModule.getJarLocation());
-config.configApp=Configuring app: {0}
+config.configApp=Configuring enterprise application: {0}
 
 # warning("configureApplication.loadFailed", jarFile.getAbsolutePath(), e.getMessage());
 configureApplication.loadFailed=Jar not loaded. {0}.  {1}
@@ -134,3 +134,13 @@
 
 # format("configureService.noProviderForService", service.getClass().getName(), service.getId(), service.getType(), service.getProvider(), sb.toString());
 configureService.noProviderForService = Cannot determine a provider for {0}(id={1}, type={2}, provider={3}).\n\nPossible valid configurations might be: {4}
+
+# ConfigurationFactory
+# throw new OpenEJBException(messages.format("unrecognizedContainerType", declaration.getType()));
+unrecognizedContainerType = Unrecognized container type {0}
+
+# throw new OpenEJBException(messages.format("cannotInstantiateClass", infoType.getName()), e);
+configureService.cannotInstantiateClass = Cannot instantiate class {0}
+
+# throw new OpenEJBException(messages.format("configureService.cannotInstantiateClass", serviceClass.getName()), e);
+configureService.cannotInstantiateServiceClass = Cannot instantiate service class {0}
\ No newline at end of file

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/util/resources/Messages.properties
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/util/resources/Messages.properties?rev=653281&r1=653280&r2=653281&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/util/resources/Messages.properties (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/util/resources/Messages.properties Sun May  4 15:25:59 2008
@@ -231,6 +231,7 @@
 config.usingDefault=OpenEJB configuration not found, using default configuration.
 config.noContainerFound=Cannot find container "{0}" for bean "{1}".
 config.noBeanFound=Cannot find bean "{0}" referenced by bean "{1}".
+config.appLoaded = Enterprise application "{0}" loaded.
 
 init.0100=Invalid {0} provider {1}.  The factory class specified, {2}, does not implement the {3} interface.  Please check the configuration of {1}."
 
@@ -250,4 +251,8 @@
 deploy.c.060=Deploy option -c.  Could not copy jar {0} to {1}. Received exception: {2}: {3}
 deploy.c.061=Deploy option -c.  Could not copy jar {0} to {1}. Jar already exists.  Use -f option to force an overwrite.
 
-entityEjbHomeHandler.containerInvocationFailure=Failure at container invocation: {0}
\ No newline at end of file
+entityEjbHomeHandler.containerInvocationFailure=Failure at container invocation: {0}
+
+# ConfigurationFactory
+# DeploymentLoader.logger.info("validationDisabled");
+validationDisabled = Validation is disabled (enable it with the \"{0}\" boolean property)

Added: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigurationFactoryTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigurationFactoryTest.java?rev=653281&view=auto
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigurationFactoryTest.java (added)
+++ openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigurationFactoryTest.java Sun May  4 15:25:59 2008
@@ -0,0 +1,108 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.config;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Properties;
+
+import org.apache.openejb.OpenEJBException;
+import org.apache.openejb.assembler.classic.EjbJarInfo;
+import org.apache.openejb.assembler.classic.OpenEjbConfiguration;
+import org.apache.openejb.config.sys.Deployments;
+import org.apache.openejb.jee.EjbJar;
+import org.apache.openejb.loader.SystemInstance;
+import org.junit.Test;
+
+/**
+ * $Rev$ $Date$
+ */
+public class ConfigurationFactoryTest {
+
+    @Test
+    public void testConfigureApplicationEjbJar() throws OpenEJBException {
+        // Just to find out whether the validationDisabled message shows up
+        SystemInstance.get().setProperty(ConfigurationFactory.VALIDATION_SKIP_PROPERTY, "true");
+        final boolean offline = true;
+        ConfigurationFactory factory = new ConfigurationFactory(offline);
+        final String id = "testConfigureApplicationEjbJar";
+        EjbJar ejbJar = new EjbJar(id);
+        // no real classes engaged so disable metadata (annotation) processing
+        ejbJar.setMetadataComplete(true);
+        EjbJarInfo info = factory.configureApplication(ejbJar);
+        // not much to assert
+        assertEquals(id, info.jarPath);
+    }
+
+    @Test
+    public void testGetOpenEjbConfiguration() throws OpenEJBException {
+        SystemInstance.get().setProperty(ConfigurationFactory.VALIDATION_SKIP_PROPERTY, "false");
+        SystemInstance.get().setProperty(DeploymentsResolver.SEARCH_CLASSPATH_FOR_DEPLOYMENTS_PROPERTY, "false");
+        final boolean offline = false;
+        ConfigurationFactory factory = new ConfigurationFactory(offline);
+        OpenEjbConfiguration openEjbConfig = factory.getOpenEjbConfiguration();
+        // again, not much to assert
+        assertEquals(0, openEjbConfig.containerSystem.applications.size());
+    }
+
+    @Test
+    public void testGetOpenEJBConfigurationInitedAndNewResource() throws Exception {
+        SystemInstance.get().setProperty(ConfigurationFactory.VALIDATION_SKIP_PROPERTY, "true");
+        SystemInstance.get().setProperty(DeploymentsResolver.SEARCH_CLASSPATH_FOR_DEPLOYMENTS_PROPERTY, "false");
+        SystemInstance.get().setProperty("newDeployment", "new://Deployments?dir=irrelevant");
+        ConfigurationFactory factory = new ConfigurationFactory();
+        Properties props = new Properties();
+        URL configUrl = this.getClass().getClassLoader().getResource(
+                "org/apache/openejb/config/configurationfactory-openejb.xml");
+        props.setProperty(ConfigurationFactory.CONF_FILE_PROPERTY, configUrl.toExternalForm());
+        factory.init(props);
+        OpenEjbConfiguration openEjbConfig = factory.getOpenEjbConfiguration();
+        assertEquals(0, openEjbConfig.containerSystem.applications.size());
+    }
+
+//    @Test
+//    public void testConfigurationFactoryBooleanOpenEjbConfiguration() throws OpenEJBException {
+//        final boolean offline = false;
+//        final OpenEjbConfiguration openEjbConfiguration = new OpenEjbConfiguration();
+//        ConfigurationFactory factory = new ConfigurationFactory(offline, openEjbConfiguration);
+//        assertEquals(openEjbConfiguration, factory.getOpenEjbConfiguration());
+//    }
+
+//    @Test
+//    public void testConfigurationFactoryBooleanDynamicDeployerOpenEjbConfiguration() throws OpenEJBException {
+//        final boolean offline = false;
+//        final DynamicDeployer dynamicDeployer = null;
+//        final OpenEjbConfiguration openEjbConfiguration = new OpenEjbConfiguration();
+//        ConfigurationFactory factory = new ConfigurationFactory(offline, dynamicDeployer, openEjbConfiguration);
+//        assertEquals(openEjbConfiguration, factory.getOpenEjbConfiguration());
+//    }
+
+    @Test
+    public void testToConfigDeclaration() throws Exception {
+        final String path = ".";
+        ConfigurationFactory factory = new ConfigurationFactory();
+        Deployments deployments = (Deployments) factory.toConfigDeclaration("", new URI("new://Deployments?classpath="
+                + path));
+        URLClassLoader cl = (URLClassLoader) deployments.getClasspath();
+        URL[] urls = cl.getURLs();
+        assertEquals(urls[0], new File(path).toURI().normalize().toURL());
+    }
+}

Propchange: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigurationFactoryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigurationFactoryTest.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigurationFactoryTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/ConfigurationFactoryTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/config/configurationfactory-openejb.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/config/configurationfactory-openejb.xml?rev=653281&view=auto
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/config/configurationfactory-openejb.xml (added)
+++ openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/config/configurationfactory-openejb.xml Sun May  4 15:25:59 2008
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<openejb></openejb>
\ No newline at end of file

Propchange: openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/config/configurationfactory-openejb.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/config/configurationfactory-openejb.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/config/configurationfactory-openejb.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/config/configurationfactory-openejb.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: openejb/trunk/openejb3/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/pom.xml?rev=653281&r1=653280&r2=653281&view=diff
==============================================================================
--- openejb/trunk/openejb3/pom.xml (original)
+++ openejb/trunk/openejb3/pom.xml Sun May  4 15:25:59 2008
@@ -114,7 +114,7 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
-          <version>2.4</version>
+          <version>2.4.2</version>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
@@ -132,6 +132,13 @@
           <target>1.5</target>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <forkMode>always</forkMode>
+        </configuration>
+      </plugin>
       <plugin>
         <groupId>org.codehaus.swizzle</groupId>
         <artifactId>dependency-report-plugin</artifactId>

Modified: openejb/trunk/openejb3/server/openejb-ejbd/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-ejbd/pom.xml?rev=653281&r1=653280&r2=653281&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-ejbd/pom.xml (original)
+++ openejb/trunk/openejb3/server/openejb-ejbd/pom.xml Sun May  4 15:25:59 2008
@@ -61,14 +61,16 @@
           <forkMode>pertest</forkMode>
           <!-- DEBUG: Uncomment this line and comment out the next -->
           <!--<argLine>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -javaagent:${project.build.directory}/openejb-javaagent-${version}.jar=foo=bar</argLine>-->
-          <argLine>"-javaagent:${project.build.directory}/openejb-javaagent-${version}.jar=foo=bar"</argLine>
+          <argLine>"-javaagent:${project.build.directory}/openejb-javaagent-${version}.jar=foo=bar"</argLine>
+          <!-- 
           <systemProperties>
             <property>
               <name>openejb.home</name>
               <value>${project.build.directory}/test-classes</value>
             </property>
           </systemProperties>
-          <basedir>${project.build.directory}</basedir>
+          <basedir>${project.build.directory}</basedir>
+           -->
         </configuration>
       </plugin>
     </plugins>
@@ -110,6 +112,12 @@
       <version>${version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>openejb-itests-beans</artifactId>
+      <version>${version}</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>

Modified: openejb/trunk/openejb3/server/openejb-ejbd/src/test/java/org/apache/openejb/RemoteiTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-ejbd/src/test/java/org/apache/openejb/RemoteiTest.java?rev=653281&r1=653280&r2=653281&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-ejbd/src/test/java/org/apache/openejb/RemoteiTest.java (original)
+++ openejb/trunk/openejb3/server/openejb-ejbd/src/test/java/org/apache/openejb/RemoteiTest.java Sun May  4 15:25:59 2008
@@ -72,11 +72,16 @@
         public void init(Properties props) {
             try {
                 EjbServer ejbServer = new EjbServer();
+                // classpath should be scanned...
                 props.put("openejb.deployments.classpath", "true");
+                // ...and only the openejb-itests-beans should be considered as a deployment
+                props.put("openejb.deployments.classpath.include", ".*openejb-itests-beans.*");
+                // ...and have the openejb-itests-beans included in the deployments (it's a system app)
+                props.put("openejb.deployments.classpath.filter.systemapps", "false");
                 OpenEJB.init(props, new ServerFederation());
                 ejbServer.init(props);
 
-                serviceDaemon = new ServiceDaemon(ejbServer, 0, "127.0.0.1");
+                serviceDaemon = new ServiceDaemon(ejbServer, 0, "localhost");
 
             } catch (Exception e) {
                 throw new RuntimeException("Unable to initialize Test Server.", e);
@@ -103,7 +108,7 @@
         public Properties getContextEnvironment() {
             Properties props = new Properties();
             props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
-            props.put(Context.PROVIDER_URL, "ejbd://127.0.0.1:" + port);
+            props.put(Context.PROVIDER_URL, "ejbd://localhost:" + port);
             return props;
         }
     }



Mime
View raw message