[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openejb-cvs
Subject:    [openejb-scm] [2589] branches/v2_1/openejb2/modules/openejb-builder/src/test/org/openejb/deployment:
From:       dain () codehaus ! org
Date:       2006-03-31 6:47:25
Message-ID: 20060331064725.17115.qmail () codehaus ! org
[Download RAW message or body]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li { font-family: verdana,arial,helvetica,sans-serif; \
font-size: 10pt;  } #msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: \
bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: \
6px; } #msg ul, pre { overflow: auto; }
#patch { width: 100%; }
#patch h4 {font-family: \
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
 #patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins \
{background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del \
{background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, \
                .info {color:#888;background:#fff;}
--></style>
<title>[2589] branches/v2_1/openejb2/modules/openejb-builder/src/test/org/openejb/deployment: \
Configurations now only use ConfigurationData for construction, and configuration \
stores produce ConfigurationData insted of GBeanData.</title> </head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2589</dd>
<dt>Author</dt> <dd>dain</dd>
<dt>Date</dt> <dd>2006-03-31 01:47:22 -0500 (Fri, 31 Mar 2006)</dd>
</dl>

<h3>Log Message</h3>
<pre>Configurations now only use ConfigurationData for construction, and \
configuration stores produce ConfigurationData insted of GBeanData. The serialized \
format of a configuration is now simply a serialized ConfigurationData.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchesv2_1openejb2modulesopenejbbuildersrctestorgopenejbdeploymentDepl \
oymentHelperjava">branches/v2_1/openejb2/modules/openejb-builder/src/test/org/openejb/deployment/DeploymentHelper.java</a></li>
 <li><a href="#branchesv2_1openejb2modulesopenejbbuildersrctestorgopenejbdeploymentDep \
loymentTestSuitejava">branches/v2_1/openejb2/modules/openejb-builder/src/test/org/openejb/deployment/DeploymentTestSuite.java</a></li>
 </ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchesv2_1openejb2modulesopenejbbuildersrctestorgopenejbdeploymentDeploymentHelperjava"></a>
 <div class="modfile"><h4>Modified: \
branches/v2_1/openejb2/modules/openejb-builder/src/test/org/openejb/deployment/DeploymentHelper.java \
(2588 => 2589)</h4> <pre class="diff">
<span class="info">--- \
branches/v2_1/openejb2/modules/openejb-builder/src/test/org/openejb/deployment/DeploymentHelper.java	2006-03-29 \
                22:21:32 UTC (rev 2588)
+++ branches/v2_1/openejb2/modules/openejb-builder/src/test/org/openejb/deployment/DeploymentHelper.java	2006-03-31 \
06:47:22 UTC (rev 2589) </span><span class="lines">@@ -47,26 +47,26 @@
</span><span class="cx">  */
</span><span class="cx"> package org.openejb.deployment;
</span><span class="cx"> 
</span><ins>+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
</ins><span class="cx"> import java.util.Collections;
</span><span class="cx"> import java.util.HashMap;
</span><span class="cx"> import java.util.HashSet;
</span><span class="cx"> import java.util.LinkedHashMap;
</span><ins>+import java.util.List;
</ins><span class="cx"> import java.util.Map;
</span><span class="cx"> import java.util.Set;
</span><del>-import java.util.List;
-import java.io.File;
-import java.io.IOException;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectOutputStream;
-import java.net.URL;
-import java.net.URI;
-import java.net.MalformedURLException;
</del><span class="cx"> 
</span><ins>+import junit.framework.TestCase;
</ins><span class="cx"> import \
org.apache.geronimo.connector.ActivationSpecWrapperGBean; </span><span class="cx"> \
import org.apache.geronimo.connector.ResourceAdapterModuleImplGBean; </span><span \
class="cx"> import org.apache.geronimo.connector.ResourceAdapterWrapperGBean; \
</span><span class="cx"> import \
org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinatorGBean;
 </span><span class="cx"> import \
org.apache.geronimo.connector.work.GeronimoWorkManagerGBean; </span><ins>+import \
org.apache.geronimo.deployment.util.DeploymentUtil; </ins><span class="cx"> import \
org.apache.geronimo.gbean.AbstractName; </span><span class="cx"> import \
org.apache.geronimo.gbean.AbstractNameQuery; </span><span class="cx"> import \
org.apache.geronimo.gbean.GBeanData; </span><span class="lines">@@ -76,37 +76,32 @@
</span><span class="cx"> import \
org.apache.geronimo.j2ee.management.impl.J2EEServerImpl; </span><span class="cx"> \
import org.apache.geronimo.kernel.Jsr77Naming; </span><span class="cx"> import \
org.apache.geronimo.kernel.Kernel; </span><del>-import \
org.apache.geronimo.kernel.Naming; </del><span class="cx"> import \
org.apache.geronimo.kernel.KernelFactory; </span><ins>+import \
org.apache.geronimo.kernel.Naming; </ins><span class="cx"> import \
org.apache.geronimo.kernel.config.ConfigurationData; </span><del>-import \
                org.apache.geronimo.kernel.config.EditableKernelConfigurationManager;
-import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.ConfigurationStore;
</del><span class="cx"> import \
org.apache.geronimo.kernel.config.ConfigurationManager; </span><ins>+import \
org.apache.geronimo.kernel.config.ConfigurationStore; +import \
org.apache.geronimo.kernel.config.ConfigurationUtil; +import \
org.apache.geronimo.kernel.config.EditableKernelConfigurationManager; </ins><span \
class="cx"> import org.apache.geronimo.kernel.config.InvalidConfigException; \
</span><span class="cx"> import \
org.apache.geronimo.kernel.config.NoSuchConfigException; </span><del>-import \
                org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.ConfigurationResolver;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
</del><span class="cx"> import org.apache.geronimo.kernel.repository.Artifact;
</span><span class="cx"> import \
org.apache.geronimo.kernel.repository.DefaultArtifactManager; </span><span \
class="cx"> import org.apache.geronimo.kernel.repository.DefaultArtifactResolver; \
</span><del>-import org.apache.geronimo.kernel.repository.ImportType; </del><span \
class="cx"> import org.apache.geronimo.kernel.repository.Environment; \
</span><ins>+import org.apache.geronimo.kernel.repository.ImportType; </ins><span \
class="cx"> import org.apache.geronimo.pool.ThreadPool; </span><ins>+import \
org.apache.geronimo.system.serverinfo.BasicServerInfo; </ins><span class="cx"> import \
org.apache.geronimo.timer.vm.VMStoreThreadPooledNonTransactionalTimer; </span><span \
class="cx"> import org.apache.geronimo.timer.vm.VMStoreThreadPooledTransactionalTimer;
 </span><span class="cx"> import \
org.apache.geronimo.transaction.context.TransactionContextManagerGBean; </span><span \
class="cx"> import org.apache.geronimo.transaction.manager.TransactionManagerImplGBean;
 </span><span class="cx"> import \
org.apache.geronimo.transaction.manager.XidFactoryImplGBean; </span><del>-import \
                org.apache.geronimo.system.serverinfo.BasicServerInfo;
-import org.apache.geronimo.deployment.util.DeploymentUtil;
</del><span class="cx"> import org.apache.geronimo.webservices.SoapHandler;
</span><span class="cx"> import org.apache.geronimo.webservices.WebServiceContainer;
</span><ins>+import org.openejb.ContainerIndex;
</ins><span class="cx"> import org.openejb.deployment.mdb.mockra.MockActivationSpec;
</span><span class="cx"> import \
org.openejb.deployment.mdb.mockra.MockResourceAdapter; </span><del>-import \
                org.openejb.ContainerIndex;
-import junit.framework.TestCase;
</del><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * @version $Revision$ $Date$
</span><span class="lines">@@ -294,28 +289,16 @@
</span><span class="cx">             configs.remove(configID);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        public GBeanData loadConfiguration(Artifact configId) throws \
                NoSuchConfigException, IOException, InvalidConfigException {
-            AbstractName configurationObjectName = \
                Configuration.getConfigurationAbstractName(configId);
-            GBeanData configData = new GBeanData(configurationObjectName, \
Configuration.GBEAN_INFO); </del><ins>+        public ConfigurationData \
loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, \
InvalidConfigException { </ins><span class="cx">             if \
(configs.containsKey(configId)) { </span><span class="cx">                 \
ConfigurationData configurationData = (ConfigurationData) configs.get(configId); \
</span><del>-                configData.setAttribute(&quot;moduleType&quot;, \
                configurationData.getModuleType());
-                Environment environment = configurationData.getEnvironment();
-                configData.setAttribute(&quot;environment&quot;, environment);
-                configData.setAttribute(&quot;gBeanState&quot;, \
                Configuration.storeGBeans(configurationData.getGBeans()));
-                configData.setAttribute(&quot;classPath&quot;, \
                configurationData.getClassPath());
-
-                ConfigurationResolver configurationResolver = new \
ConfigurationResolver(configurationData.getEnvironment().getConfigId(), this, \
                Collections.EMPTY_SET, new DefaultArtifactResolver(null, \
                Collections.EMPTY_SET));
-                configData.setAttribute(&quot;configurationResolver&quot;, \
                configurationResolver);
-
</del><ins>+                configurationData.setConfigurationStore(this);
+                return configurationData;
</ins><span class="cx">             } else {
</span><del>-                Environment environment = new Environment();
-                environment.setConfigId(configId);
-                configData.setAttribute(&quot;environment&quot;, environment);
-                configData.setAttribute(&quot;moduleType&quot;, \
                ConfigurationModuleType.WAR);
-                configData.setAttribute(&quot;gBeanState&quot;, NO_OBJECTS_OS);
</del><ins>+                ConfigurationData configurationData = new \
ConfigurationData(configId, new Jsr77Naming()); +                \
configurationData.setConfigurationStore(this); +                return \
configurationData; </ins><span class="cx">             }
</span><del>-            return configData;
</del><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         public boolean containsConfiguration(Artifact \
configID) { </span><span class="lines">@@ -350,23 +333,12 @@
</span><span class="cx"> 
</span><span class="cx">         public final static GBeanInfo GBEAN_INFO;
</span><span class="cx"> 
</span><del>-        private static final byte[] NO_OBJECTS_OS;
-
</del><span class="cx">         static {
</span><span class="cx">             GBeanInfoBuilder infoBuilder = \
GBeanInfoBuilder.createStatic(MockConfigStore.class, \
NameFactory.CONFIGURATION_STORE); </span><span class="cx">             \
infoBuilder.addAttribute(&quot;baseURL&quot;, URL.class, true, true); </span><span \
class="cx">             infoBuilder.setConstructor(new String[] \
{&quot;baseURL&quot;}); </span><span class="cx">             \
infoBuilder.addInterface(ConfigurationStore.class); </span><span class="cx">          \
GBEAN_INFO = infoBuilder.getBeanInfo(); </span><del>-
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            try {
-                ObjectOutputStream oos = new ObjectOutputStream(baos);
-                oos.flush();
-                NO_OBJECTS_OS = baos.toByteArray();
-            } catch (IOException e) {
-                throw new RuntimeException(e);
-            }
</del><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></pre></div>
<a id="branchesv2_1openejb2modulesopenejbbuildersrctestorgopenejbdeploymentDeploymentTestSuitejava"></a>
 <div class="modfile"><h4>Modified: \
branches/v2_1/openejb2/modules/openejb-builder/src/test/org/openejb/deployment/DeploymentTestSuite.java \
(2588 => 2589)</h4> <pre class="diff">
<span class="info">--- \
branches/v2_1/openejb2/modules/openejb-builder/src/test/org/openejb/deployment/DeploymentTestSuite.java	2006-03-29 \
                22:21:32 UTC (rev 2588)
+++ branches/v2_1/openejb2/modules/openejb-builder/src/test/org/openejb/deployment/DeploymentTestSuite.java	2006-03-31 \
06:47:22 UTC (rev 2589) </span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> import java.sql.Statement;
</span><span class="cx"> import java.util.jar.JarFile;
</span><span class="cx"> import java.util.Collections;
</span><ins>+import java.rmi.MarshalledObject;
</ins><span class="cx"> 
</span><span class="cx"> import javax.sql.DataSource;
</span><span class="cx"> 
</span><span class="lines">@@ -159,6 +160,9 @@
</span><span class="cx">                 jarFile = \
DeploymentUtil.createJarFile(moduleFile); </span><span class="cx">                 \
Object plan = earConfigBuilder.getDeploymentPlan(null, jarFile); </span><span \
class="cx">                 configurationData = \
earConfigBuilder.buildConfiguration(plan, jarFile, \
Collections.singleton(deploymentHelper.configStore), deploymentHelper.configStore); \
</span><ins>+                // copy the configuration to force gbeans to serialize + \
configurationData = (ConfigurationData) new \
MarshalledObject(configurationData).get(); +                \
configurationData.setConfigurationStore(deploymentHelper.configStore); </ins><span \
class="cx">             } finally { </span><span class="cx">                 if \
(jarFile != null) { </span><span class="cx">                     jarFile.close();
</span><span class="lines">@@ -189,7 +193,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">             // start the configuration
</span><del>-            Configuration configuration = \
deploymentHelper.configurationManager.loadConfiguration(configurationData, \
deploymentHelper.configStore); </del><ins>+            Configuration configuration = \
deploymentHelper.configurationManager.loadConfiguration(configurationData); \
</ins><span class="cx">             \
deploymentHelper.configurationManager.startConfiguration(configuration); </span><span \
class="cx">  </span><span class="cx">             // get the configuration \
classloader </span></pre>
</div>
</div>

</body>
</html>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic