cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r164112 - in /cocoon: blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/ blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/ trunk/ trunk/src/java/org/apache/cocoon/ trunk/src/java/org/apache/cocoon/bean/ trunk/src/java/org/apache/cocoon/core/ trunk/src/java/org/apache/cocoon/core/container/ trunk/src/java/org/apache/cocoon/serialization/ trunk/src/test/org/apache/cocoon/ trunk/src/test/org/apache/cocoon/core/container/
Date Thu, 21 Apr 2005 20:04:01 GMT
Author: cziegeler
Date: Thu Apr 21 13:04:01 2005
New Revision: 164112

URL: http://svn.apache.org/viewcvs?rev=164112&view=rev
Log:
Remove the need for context object (where possible)
Reduce default logging output during junit tests

Modified:
    cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
    cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java
    cocoon/trunk/build.properties
    cocoon/trunk/src/java/org/apache/cocoon/Cocoon.java
    cocoon/trunk/src/java/org/apache/cocoon/bean/CocoonWrapper.java
    cocoon/trunk/src/java/org/apache/cocoon/core/Core.java
    cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java
    cocoon/trunk/src/java/org/apache/cocoon/core/container/ComponentEnvironment.java
    cocoon/trunk/src/java/org/apache/cocoon/core/container/ComponentFactory.java
    cocoon/trunk/src/java/org/apache/cocoon/core/container/CoreServiceManager.java
    cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
    cocoon/trunk/src/test/org/apache/cocoon/CocoonTestCase.java
    cocoon/trunk/src/test/org/apache/cocoon/SitemapComponentTestCase.java
    cocoon/trunk/src/test/org/apache/cocoon/core/container/ContainerTestCase.java

Modified: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
(original)
+++ cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
Thu Apr 21 13:04:01 2005
@@ -15,7 +15,6 @@
  */
 package org.apache.cocoon.forms.binding;
 
-import java.util.Collection;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.Locale;
@@ -24,7 +23,6 @@
 import org.apache.cocoon.forms.datatype.convertor.Convertor;
 import org.apache.cocoon.forms.datatype.convertor.ConversionResult;
 import org.apache.cocoon.forms.formmodel.Widget;
-import org.apache.commons.jxpath.AbstractFactory;
 import org.apache.commons.jxpath.JXPathContext;
 import org.apache.commons.jxpath.Pointer;
 

Modified: cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java
(original)
+++ cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java
Thu Apr 21 13:04:01 2005
@@ -35,8 +35,6 @@
 import org.apache.cocoon.components.notification.DefaultNotifyingBuilder;
 import org.apache.cocoon.components.notification.Notifier;
 import org.apache.cocoon.components.notification.Notifying;
-import org.apache.cocoon.configuration.Settings;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.environment.portlet.PortletContext;
 import org.apache.cocoon.environment.portlet.PortletEnvironment;
@@ -293,8 +291,6 @@
 
         this.portletContext = conf.getPortletContext();
         this.appContext.put(Constants.CONTEXT_ENVIRONMENT_CONTEXT, new PortletContext(this.portletContext));
-        // FIXME - add settings
-        appContext.put(Core.CONTEXT_SETTINGS, new Settings());
         this.portletContextPath = this.portletContext.getRealPath("/");
 
         // first init the work-directory for the logger.

Modified: cocoon/trunk/build.properties
URL: http://svn.apache.org/viewcvs/cocoon/trunk/build.properties?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/trunk/build.properties (original)
+++ cocoon/trunk/build.properties Thu Apr 21 13:04:01 2005
@@ -74,7 +74,7 @@
 
 junit.test.debugport=8000
 #junit.testcase=org.apache.cocoon.util.test.NetUtilsTestCase
-junit.test.loglevel=0
+junit.test.loglevel=1
 
 # ---- IDE ---------------------------------------------------------------------
 

Modified: cocoon/trunk/src/java/org/apache/cocoon/Cocoon.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/Cocoon.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/Cocoon.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/Cocoon.java Thu Apr 21 13:04:01 2005
@@ -116,6 +116,9 @@
     /** An optional Avalon Component that is called before and after processing all requests.
*/
     protected RequestListener requestListener;
 
+    /** The Cocoon Core */
+    protected Core core;
+
     /**
      * Creates a new <code>Cocoon</code> instance.
      *
@@ -144,6 +147,7 @@
     public void service(ServiceManager manager)
     throws ServiceException {
         this.parentServiceManager = manager;
+        this.core = (Core)this.parentServiceManager.lookup(Core.ROLE);
     }
 
     /* (non-Javadoc)
@@ -152,17 +156,6 @@
     public void contextualize(Context context) throws ContextException {
         this.context = new ComponentContext(context);
         ((DefaultContext)this.context).makeReadOnly();
-
-        final Settings settings = Core.getSettings(this.context);
-        try {
-            URLSource urlSource = new URLSource();
-            urlSource.init(new URL(settings.getConfiguration()), null);
-            this.configurationFile = new DelayedRefreshSourceWrapper(urlSource,
-                                                                     settings.getConfigurationReloadDelay());
-
-        } catch (IOException e) {
-            throw new ContextException("Could not open configuration file: " + settings.getConfiguration(),
e);
-        }
     }
 
     /**
@@ -180,15 +173,27 @@
      * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
     public void initialize() throws Exception {
+        getLogger().debug("Initializing new Cocoon object.");
+        final Settings settings = this.core.getSettings();
+        try {
+            URLSource urlSource = new URLSource();
+            urlSource.init(new URL(settings.getConfiguration()), null);
+            this.configurationFile = new DelayedRefreshSourceWrapper(urlSource,
+                                                                     settings.getConfigurationReloadDelay());
+
+        } catch (IOException e) {
+            throw new ConfigurationException(
+                    "Could not open configuration file: " + settings.getConfiguration(),
e);
+        }
+
         this.serviceManager = new CocoonServiceManager(this.parentServiceManager);
         ContainerUtil.enableLogging(this.serviceManager, this.rootLogger.getChildLogger("manager"));
         ContainerUtil.contextualize(this.serviceManager, this.context);
-        getLogger().debug("Initializing new Cocoon object.");
 
         // Log the System Properties.
         dumpSystemProperties();
 
-        configure();
+        this.configure();
 
         // add the logger manager to the component locator
 
@@ -236,7 +241,7 @@
     private void configure() throws Exception {
         InputSource is = SourceUtil.getInputSource(this.configurationFile);
 
-        final Settings settings = Core.getSettings(context);
+        final Settings settings = this.core.getSettings();
         ConfigurationBuilder builder = new ConfigurationBuilder(settings);
         Configuration conf = builder.build(is);
 

Modified: cocoon/trunk/src/java/org/apache/cocoon/bean/CocoonWrapper.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/bean/CocoonWrapper.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/bean/CocoonWrapper.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/bean/CocoonWrapper.java Thu Apr 21 13:04:01 2005
@@ -165,8 +165,6 @@
             appContext.put(Constants.CONTEXT_CONFIG_URL, conf.toURL());
             appContext.put(Constants.CONTEXT_DEFAULT_ENCODING, "ISO-8859-1");
             appContext.put(ContextHelper.CONTEXT_ROOT_URL, this.context.toURL());
-            // FIXME - add settings
-            appContext.put(Core.CONTEXT_SETTINGS, new Settings());
 
             loadClasses(classList);
 

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/Core.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/Core.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/Core.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/Core.java Thu Apr 21 13:04:01 2005
@@ -25,7 +25,6 @@
 import org.apache.avalon.framework.CascadingRuntimeException;
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.context.ContextException;
-import org.apache.avalon.framework.context.Contextualizable;
 import org.apache.cocoon.Constants;
 import org.apache.cocoon.components.ContextHelper;
 import org.apache.cocoon.configuration.Settings;
@@ -40,17 +39,11 @@
  * @version SVN $Id$
  * @since 2.2
  */
-public class Core
-    implements Contextualizable {
+public class Core {
 
     /** The key to lookup the component. */
     public static String ROLE = Core.class.getName();
 
-    /** Application <code>Context</code> Key for the settings. Please don't
-     * use this constant to lookup the settings object. Lookup the core
-     * component and use {@link #getSettings()} instead. */
-    public static final String CONTEXT_SETTINGS = "settings";
-
     /**
      * The cleanup threads that are invoked after the processing of a
      * request is finished.
@@ -58,7 +51,7 @@
     private static final ThreadLocal cleanup = new ThreadLocal();
 
     /** The component context. */
-    private Context context;
+    private final Context context;
 
     private final Settings settings;
     
@@ -67,13 +60,6 @@
         this.context = c;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
-     */
-    public void contextualize(Context context) throws ContextException {
-        this.context = context;
-    }
-
     public static void addCleanupTask(CleanupTask task) {
         List l = (List)cleanup.get();
         if ( l == null ) {
@@ -160,22 +146,4 @@
             throw new CascadingRuntimeException("Unable to get the cache directory from the
context.", ce);
         }        
     }
-
-    /**
-     * Return the current settings.
-     * Please don't use this method directly, look up the Core component
-     * and use {@link #getSettings()} instead.
-     * @param context The component context.
-     * @return The settings.
-     * FIXME - will be removed before the release
-     */
-    public static final Settings getSettings(Context context) {
-        // the settings object is always present
-        try {
-            return (Settings)context.get(CONTEXT_SETTINGS);
-        } catch (ContextException ce) {
-            throw new CascadingRuntimeException("Unable to get the settings object from the
context.", ce);
-        }
-    }
-    
 }

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java Thu Apr 21 13:04:01 2005
@@ -107,7 +107,6 @@
 
         // create settings
         this.settings = this.createSettings();
-        this.appContext.put(Core.CONTEXT_SETTINGS, this.settings);
 
         if (this.settings.isInitClassloader()) {
             // Force context classloader so that JAXP can work correctly

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/container/ComponentEnvironment.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/container/ComponentEnvironment.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/container/ComponentEnvironment.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/container/ComponentEnvironment.java Thu Apr
21 13:04:01 2005
@@ -22,6 +22,7 @@
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.logger.Logger;
+import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.components.ComponentInfo;
 import org.apache.cocoon.configuration.ConfigurationBuilder;
@@ -42,7 +43,8 @@
     public final RoleManager roleManager;
     public final LoggerManager loggerManager;
     private final ClassLoader classLoader;
-    
+    private Core core;
+
     public ComponentEnvironment(ClassLoader classLoader, Logger logger, RoleManager roleManager,
LoggerManager loggerManager,
             Context context, ServiceManager serviceManager) {
 
@@ -60,6 +62,11 @@
         this.loggerManager = loggerManager;
         this.context = context;
         this.serviceManager = serviceManager;
+        try {
+            this.core = (Core)this.serviceManager.lookup(Core.ROLE);
+        } catch (ServiceException ignore) {
+            // this can never happen
+        }
     }
 
     public Class loadClass(String name) throws ClassNotFoundException {
@@ -73,7 +80,7 @@
         ComponentInfo ci = null;
         final InputStream is = this.classLoader.getResourceAsStream(bu.toString());
         if ( is != null ) {
-            final Settings settings = Core.getSettings(this.context);
+            final Settings settings = this.core.getSettings();
             final ConfigurationBuilder cb = new ConfigurationBuilder(settings);
             final Configuration conf = cb.build(is);
             ci = new ComponentInfo();

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/container/ComponentFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/container/ComponentFactory.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/container/ComponentFactory.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/container/ComponentFactory.java Thu Apr 21
13:04:01 2005
@@ -23,7 +23,10 @@
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.parameters.Parameterizable;
 import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
 import org.apache.cocoon.components.ComponentInfo;
+import org.apache.cocoon.configuration.Settings;
+import org.apache.cocoon.core.Core;
 
 /**
  * Factory for Avalon based components.
@@ -50,6 +53,8 @@
     protected final Method destroyMethod;
     protected final Method poolInMethod;
     protected final Method poolOutMethod;
+    protected Method configureSettingsMethod;
+    protected Core core;
 
     /**
      * Construct a new component factory for the specified component.
@@ -61,6 +66,11 @@
     public ComponentFactory( final ComponentEnvironment environment,
                              final ComponentInfo info) 
     throws Exception {
+        try {
+            this.core = (Core)environment.serviceManager.lookup(Core.ROLE);
+        } catch (ServiceException ignore) {
+            // this can never happen
+        }
         this.environment = environment;
         this.serviceInfo = info;
         
@@ -108,6 +118,11 @@
         } else {
             this.poolOutMethod = null;
         }
+        try {
+            this.configureSettingsMethod = this.serviceClass.getMethod("configure", new Class[]
{Settings.class});
+        } catch (NoSuchMethodException ignore) {
+            this.configureSettingsMethod = null;
+        }
     }
     
     /**
@@ -135,6 +150,9 @@
         ContainerUtil.enableLogging(component, this.componentLogger);
         ContainerUtil.contextualize( component, this.environment.context );
         ContainerUtil.service( component, this.environment.serviceManager );
+        if ( this.configureSettingsMethod != null ) {
+            this.configureSettingsMethod.invoke( component, new Object[] {this.core.getSettings()});
+        }
         ContainerUtil.configure( component, this.serviceInfo.getConfiguration() );
 
         if( component instanceof Parameterizable ) {

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/container/CoreServiceManager.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/container/CoreServiceManager.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/container/CoreServiceManager.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/container/CoreServiceManager.java Thu Apr
21 13:04:01 2005
@@ -133,6 +133,13 @@
         // Always create a role manager, it can be filled several times either through
         // the root "roles" attribute or through loading of includes
         this.roleManager = new RoleManager(parentRoleManager);
+        
+        // get settings
+        try {
+            this.settings = ((Core)parent.lookup(Core.ROLE)).getSettings();
+        } catch (ServiceException ignore) {
+            // this can never happen!
+        }
     }
 
     //=============================================================================================
@@ -152,7 +159,6 @@
      */
     public void contextualize( final Context context ) {
         this.context = context;
-        this.settings = Core.getSettings(context);
     }
 
     /**
@@ -735,8 +741,7 @@
                 // load it and store it in the read set
                 Configuration includeConfig = null;
                 try {
-                    final Settings settings = Core.getSettings(context);
-                    ConfigurationBuilder builder = new ConfigurationBuilder(settings);
+                    ConfigurationBuilder builder = new ConfigurationBuilder(this.settings);
                     includeConfig = builder.build(src.getInputStream(), uri);
                 } catch (ConfigurationException ce) {
                     throw ce;

Modified: cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java Thu
Apr 21 13:04:01 2005
@@ -18,13 +18,9 @@
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.context.Context;
-import org.apache.avalon.framework.context.ContextException;
-import org.apache.avalon.framework.context.Contextualizable;
 import org.apache.cocoon.Constants;
 import org.apache.cocoon.caching.CacheableProcessingComponent;
 import org.apache.cocoon.configuration.Settings;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.util.ClassUtils;
 import org.apache.cocoon.util.TraxErrorHandler;
 import org.apache.cocoon.xml.AbstractXMLPipe;
@@ -60,7 +56,7 @@
  * @version CVS $Id$
  */
 public abstract class AbstractTextSerializer extends AbstractSerializer
-        implements Configurable, CacheableProcessingComponent, Contextualizable {
+        implements Configurable, CacheableProcessingComponent {
 
     /**
      * The trax <code>TransformerFactory</code> used by this serializer.
@@ -166,15 +162,11 @@
         //  }
     }
 
-    /**
-     * Uses the context to retrieve a default encoding for the serializers.
-     */
-    public void contextualize(Context context) throws ContextException {
-        final Settings s = Core.getSettings(context);
-        String defaultEncoding  = s.getFormEncoding();
+    public void configure(Settings settings) {
+        String defaultEncoding  = settings.getFormEncoding();
         if (defaultEncoding != null) {
             this.format.setProperty(OutputKeys.ENCODING, defaultEncoding);
-        }
+        }        
     }
 
     /**

Modified: cocoon/trunk/src/test/org/apache/cocoon/CocoonTestCase.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/CocoonTestCase.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/CocoonTestCase.java (original)
+++ cocoon/trunk/src/test/org/apache/cocoon/CocoonTestCase.java Thu Apr 21 13:04:01 2005
@@ -20,8 +20,6 @@
 import org.apache.avalon.framework.configuration.DefaultConfiguration;
 import org.apache.avalon.framework.context.DefaultContext;
 import org.apache.avalon.framework.service.ServiceException;
-import org.apache.cocoon.configuration.Settings;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.core.container.CoreServiceManager;
 import org.apache.cocoon.core.container.StandaloneServiceSelector;
 import org.apache.cocoon.core.container.ContainerTestCase;
@@ -36,10 +34,6 @@
  * @version CVS $Id: SitemapComponentTestCase.java 55427 2004-10-24 11:38:37Z cziegeler $
  */
 public abstract class CocoonTestCase extends ContainerTestCase {
-
-    protected void addContext(DefaultContext context) {
-        context.put(Core.CONTEXT_SETTINGS, new Settings());
-    }
 
     /* (non-Javadoc)
      * @see org.apache.cocoon.core.container.ContainerTestCase#addComponents(org.apache.cocoon.core.container.CocoonServiceManager)

Modified: cocoon/trunk/src/test/org/apache/cocoon/SitemapComponentTestCase.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/SitemapComponentTestCase.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/SitemapComponentTestCase.java (original)
+++ cocoon/trunk/src/test/org/apache/cocoon/SitemapComponentTestCase.java Thu Apr 21 13:04:01
2005
@@ -40,8 +40,6 @@
 import org.apache.cocoon.components.flow.FlowHelper;
 import org.apache.cocoon.components.flow.Interpreter;
 import org.apache.cocoon.components.source.SourceResolverAdapter;
-import org.apache.cocoon.configuration.Settings;
-import org.apache.cocoon.core.Core;
 import org.apache.cocoon.core.container.CoreServiceManager;
 import org.apache.cocoon.core.container.StandaloneServiceSelector;
 import org.apache.cocoon.environment.ObjectModelHelper;
@@ -108,7 +106,6 @@
         context.put(ContextHelper.CONTEXT_REQUEST_OBJECT, request);
         context.put(ContextHelper.CONTEXT_RESPONSE_OBJECT, response);
         context.put(ContextHelper.CONTEXT_OBJECT_MODEL, objectmodel);
-        context.put(Core.CONTEXT_SETTINGS, new Settings());
     }
 
     /* (non-Javadoc)

Modified: cocoon/trunk/src/test/org/apache/cocoon/core/container/ContainerTestCase.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/core/container/ContainerTestCase.java?rev=164112&r1=164111&r2=164112&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/core/container/ContainerTestCase.java (original)
+++ cocoon/trunk/src/test/org/apache/cocoon/core/container/ContainerTestCase.java Thu Apr
21 13:04:01 2005
@@ -36,6 +36,9 @@
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.cocoon.configuration.Settings;
+import org.apache.cocoon.core.Core;
+import org.apache.cocoon.core.CoreUtil;
 import org.apache.cocoon.util.log.DeprecationLogger;
 
 /**
@@ -296,8 +299,12 @@
         roleManager.enableLogging( this.getLogger() );
         roleManager.configure( confRM );
 
+        // Set up root manager for Core
+        Core core = new Core(new Settings(), this.context);
+        CoreUtil.RootServiceManager rsm = new CoreUtil.RootServiceManager(null, core);
+ 
         // Set up the ComponentLocator
-        CoreServiceManager ecManager = new CoreServiceManager(null);
+        CoreServiceManager ecManager = new CoreServiceManager(rsm);
         ecManager.enableLogging( this.getLogger() );
         ecManager.contextualize( this.context );
         ecManager.setRoleManager( roleManager );



Mime
View raw message