portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r771376 - in /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine: AbstractEngineTest.java TestSpringEngine.java
Date Mon, 04 May 2009 17:39:00 GMT
Author: ate
Date: Mon May  4 17:38:59 2009
New Revision: 771376

URL: http://svn.apache.org/viewvc?rev=771376&view=rev
Log:
Rolling back accidentally merged in local (testing) changes on r771327 for AbstractEngineTest
and TestSpringEngine.

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/AbstractEngineTest.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/TestSpringEngine.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/AbstractEngineTest.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/AbstractEngineTest.java?rev=771376&r1=771375&r2=771376&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/AbstractEngineTest.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/AbstractEngineTest.java
Mon May  4 17:38:59 2009
@@ -41,14 +41,52 @@
         super();
     }
 
+    /**
+     * @param arg0
+     */
+    public AbstractEngineTest(String arg0)
+    {
+        super(arg0);
+    }
 
     protected Engine engine;
 
     protected Object[] keysToCheck;
 
     private SpringEngineHelper engineHelper;
-    
-    private boolean setup;
-    
+
+    public void testEngine() throws Exception
+    {
+        assertNotNull(engine.getComponentManager());
+        assertNotNull(engine.getComponentManager().getRootContainer());
+        if (keysToCheck != null)
+        {
+            verifyComponents(keysToCheck);
+        }
+    }
+
+    protected void setUp() throws Exception
+    {
+       HashMap context = new HashMap();
+       engineHelper = new SpringEngineHelper(context);
+       engineHelper.setUp(getBaseDir());
+       engine = (Engine) context.get(SpringEngineHelper.ENGINE_ATTR);
+    }
+
+    protected void tearDown() throws Exception
+    {
+        engineHelper.tearDown();
+        super.tearDown();        
+    }
+
+    protected void verifyComponents(Object[] keys)
+    {
+        ComponentManagement cm = engine.getComponentManager();
+        for (int i = 0; i < keys.length; i++)
+        {
+            assertNotNull("Could not get component insatance " + keys[i], cm.getComponent(keys[i]));
+            System.out.println("Load componenet " + cm.getComponent(keys[i]).getClass() +
" for key " + keys[i]);
+        }
+    }
 
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/TestSpringEngine.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/TestSpringEngine.java?rev=771376&r1=771375&r2=771376&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/TestSpringEngine.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/engine/TestSpringEngine.java
Mon May  4 17:38:59 2009
@@ -22,8 +22,6 @@
  */
 package org.apache.jetspeed.engine;
 
-import java.util.HashMap;
-
 import javax.servlet.ServletConfig;
 
 import junit.framework.Test;
@@ -33,7 +31,6 @@
 import org.apache.jetspeed.aggregator.PortletAggregator;
 import org.apache.jetspeed.aggregator.PortletRenderer;
 import org.apache.jetspeed.capabilities.Capabilities;
-import org.apache.jetspeed.components.ComponentManagement;
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
 import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.profiler.Profiler;
@@ -43,8 +40,6 @@
 import org.apache.jetspeed.security.RoleManager;
 import org.apache.jetspeed.security.UserManager;
 import org.apache.jetspeed.security.impl.RdbmsPolicy;
-import org.apache.jetspeed.test.JetspeedTestCase;
-import org.apache.jetspeed.testhelpers.SpringEngineHelper;
 import org.apache.jetspeed.userinfo.UserInfoManager;
 
 /**
@@ -59,29 +54,26 @@
  * @version $Id$
  *  
  */
-public class TestSpringEngine extends JetspeedTestCase
+public class TestSpringEngine extends AbstractEngineTest
 {
-    private Engine engine;
-    private SpringEngineHelper engineHelper;
-    
+    public TestSpringEngine()
+    {        
+        keysToCheck = new Object[] {"IdGenerator", "DecorationLocator", "TemplateLocator",
"IdGenerator", "PageFileCache", PageManager.class, 
+                                     PortletRegistry.class, "PortalServices",
+                                     Profiler.class, Capabilities.class, UserManager.class,
+                                     GroupManager.class, RoleManager.class, PermissionManager.class,
RdbmsPolicy.class,
+                                     UserInfoManager.class, RequestContextComponent.class,

+                                     PortletRenderer.class, PageAggregator.class, PortletAggregator.class,
"PAM",
+                                     "deploymentManager", "portletFactory", ServletConfig.class,

+                                      "NavigationalStateCodec", "PortalURL", "NavigationalStateComponent"};
+    }
     
-    protected void setUp() throws Exception
+    public static Test suite()
     {
-        super.setUp();
-       HashMap context = new HashMap();
-       engineHelper = new SpringEngineHelper(context);
-       engineHelper.setUp(getBaseDir());
-       engine = (Engine) context.get(SpringEngineHelper.ENGINE_ATTR);
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestSpringEngine.class);
     }
 
-    protected void tearDown() throws Exception
-    {
-        engineHelper.tearDown();
-        super.tearDown();        
-    }
 
-    public void testSomeEngine() throws Exception
-    {
-    }
 
 }



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