portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ate Douma <...@douma.nu>
Subject Re: svn commit: r225527 - /portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/SpringEngineHelper.java
Date Wed, 27 Jul 2005 14:49:45 GMT
Scott,

You broke the build with this!
Missing are JetspeedEngine, ResourceLocationServletContext, PortalTestConstants.JETSPEED_APPLICATION_ROOT,
AbstractTestHelper.APP_CONTEXT.


weaver@apache.org wrote:
> Author: weaver
> Date: Wed Jul 27 07:28:00 2005
> New Revision: 225527
> 
> URL: http://svn.apache.org/viewcvs?rev=225527&view=rev
> Log:
> contains all of the logic required to initalize Spring for use within test cases.
> 
> Added:
>     portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/SpringEngineHelper.java
  (with props)
> 
> Added: portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/SpringEngineHelper.java
> URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/SpringEngineHelper.java?rev=225527&view=auto
> ==============================================================================
> --- portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/SpringEngineHelper.java
(added)
> +++ portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/SpringEngineHelper.java
Wed Jul 27 07:28:00 2005
> @@ -0,0 +1,64 @@
> +package org.apache.jetspeed.testhelpers;
> +
> +import java.io.File;
> +import java.io.FileInputStream;
> +import java.util.HashMap;
> +import java.util.Map;
> +
> +import org.apache.commons.configuration.PropertiesConfiguration;
> +import org.apache.jetspeed.PortalTestConstants;
> +import org.apache.jetspeed.components.SpringComponentManager;
> +import org.apache.jetspeed.components.factorybeans.ServletConfigFactoryBean;
> +import org.apache.jetspeed.engine.Engine;
> +import org.apache.jetspeed.engine.JetspeedEngine;
> +import org.apache.jetspeed.mocks.ResourceLocatingServletContext;
> +import org.springframework.context.ApplicationContext;
> +
> +import com.mockrunner.mock.web.MockServletConfig;
> +
> +public class SpringEngineHelper extends OJBHelper
> +{
> +
> +    public static final String ENGINE_ATTR = "Engine";     
> +    
> +    
> +    public SpringEngineHelper(Map context)
> +    {
> +        super(context);     
> +    }
> +    
> +    private Engine engine;
> +
> +    public void setUp() throws Exception
> +    {
> +        super.setUp();
> +        PropertiesConfiguration config = new PropertiesConfiguration();
> +        config.load(new FileInputStream(PortalTestConstants.JETSPEED_PROPERTIES_PATH));
> +                
> +        HashMap context = new HashMap();
> +        OJBHelper ojbHelper = new OJBHelper(context);
> +        ojbHelper.setUp();
> +        String appRoot = PortalTestConstants.JETSPEED_APPLICATION_ROOT;
> +        
> +        MockServletConfig servletConfig = new MockServletConfig();        
> +        ResourceLocatingServletContext servletContent = new ResourceLocatingServletContext(new
File(appRoot));        
> +        servletConfig.setServletContext(servletContent);
> +        ServletConfigFactoryBean.setServletConfig(servletConfig);
> +        ApplicationContext bootCtx = (ApplicationContext) context.get(AbstractTestHelper.APP_CONTEXT);
> +        
> +        SpringComponentManager scm = new SpringComponentManager(null, new String[] {"/WEB-INF/assembly/*.xml"},
servletContent, appRoot );
> +       
> +        engine = new JetspeedEngine(config, appRoot, servletConfig, scm );
> +        engine.start();
> +        getContext().put(ENGINE_ATTR, engine );
> +    }
> +
> +    public void tearDown() throws Exception
> +    {
> +        engine.shutdown();  
> +        super.tearDown();
> +    }
> +
> +
> +
> +}
> 
> Propchange: portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/SpringEngineHelper.java
> ------------------------------------------------------------------------------
>     svn:eol-style = native
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> 
> 
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message