portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r345158 - /portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/testhelpers/SpringEngineHelper.java
Date Thu, 17 Nov 2005 00:33:06 GMT
Author: ate
Date: Wed Nov 16 16:33:02 2005
New Revision: 345158

URL: http://svn.apache.org/viewcvs?rev=345158&view=rev
Log:
Replaced OJBHelper datasource setup with JNDI based datasource setup using new JetspeedTestJNDIComponent.
to support Derby db based testcases (as well as all other dbms).
NB: OJBHelper now is no longer in use.

Modified:
    portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/testhelpers/SpringEngineHelper.java

Modified: portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/testhelpers/SpringEngineHelper.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/testhelpers/SpringEngineHelper.java?rev=345158&r1=345157&r2=345158&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/testhelpers/SpringEngineHelper.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/testhelpers/SpringEngineHelper.java
Wed Nov 16 16:33:02 2005
@@ -2,51 +2,48 @@
 
 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.components.jndi.JetspeedTestJNDIComponent;
 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 class SpringEngineHelper extends AbstractTestHelper
 {
-
     public static final String ENGINE_ATTR = "Engine";     
     
+    protected JetspeedTestJNDIComponent jndiDS;
     
     public SpringEngineHelper(Map context)
     {
-        super(context);     
+        super(context);
     }
     
     private Engine engine;
 
     public void setUp() throws Exception
     {
-        super.setUp();
+        jndiDS = new JetspeedTestJNDIComponent();
+        jndiDS.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(new String[] {"../../etc/db-ojb/test-*.xml"},
new String[] {"/WEB-INF/assembly/*.xml"}, servletContent, appRoot );
+        SpringComponentManager scm = new SpringComponentManager(new String[] {"/WEB-INF/assembly/boot/datasource.xml"},
new String[] {"/WEB-INF/assembly/*.xml"}, servletContent, appRoot );
        
         engine = new JetspeedEngine(config, appRoot, servletConfig, scm );
         engine.start();
@@ -55,10 +52,7 @@
 
     public void tearDown() throws Exception
     {
-        engine.shutdown();  
-        super.tearDown();
+        engine.shutdown();
+        jndiDS.tearDown();
     }
-
-
-
 }



---------------------------------------------------------------------
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