portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlest...@apache.org
Subject svn commit: r209402 - in /portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed: container/state/TestNavigationalState.java engine/AbstractEngineTest.java test/JetspeedTestSuite.java tools/TestWebXML.java
Date Wed, 06 Jul 2005 03:22:33 GMT
Author: dlestrat
Date: Tue Jul  5 20:22:31 2005
New Revision: 209402

URL: http://svn.apache.org/viewcvs?rev=209402&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-304

Modified:
    portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/container/state/TestNavigationalState.java
    portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/engine/AbstractEngineTest.java
    portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/test/JetspeedTestSuite.java
    portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/tools/TestWebXML.java

Modified: portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/container/state/TestNavigationalState.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/container/state/TestNavigationalState.java?rev=209402&r1=209401&r2=209402&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/container/state/TestNavigationalState.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/container/state/TestNavigationalState.java
Tue Jul  5 20:22:31 2005
@@ -30,6 +30,7 @@
 
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.jetspeed.Jetspeed;
+import org.apache.jetspeed.PortalTestConstants;
 import org.apache.jetspeed.container.state.NavigationalState;
 import org.apache.jetspeed.container.state.NavigationalStateComponent;
 import org.apache.jetspeed.container.state.impl.JetspeedNavigationalStateComponent;
@@ -64,7 +65,7 @@
  * @version $Id$
  */
 
-public class TestNavigationalState extends TestCase 
+public class TestNavigationalState extends TestCase
 {
     // needed to be able to Mock PortletWindowListCtrl
     private interface CompositeWindowList extends PortletWindowList, PortletWindowListCtrl{}
@@ -102,11 +103,11 @@
         
         // create Engine
         PropertiesConfiguration config = new  PropertiesConfiguration();
-        config.load(new FileInputStream("./src/webapp/WEB-INF/conf/jetspeed.properties"));
+        config.load(new FileInputStream(PortalTestConstants.JETSPEED_PROPERTIES_PATH));
         Mock servletConfigMock = new Mock(ServletConfig.class);
         MockServletConfig msc = new MockServletConfig();
         msc.setServletContext(new MockServletContext());
-        Engine engine = Jetspeed.createEngine(config, "./src/webapp", msc, SpringEngine.class);
+        Engine engine = Jetspeed.createEngine(config, PortalTestConstants.PORTAL_WEBAPP_PATH,
msc, SpringEngine.class);
 
         // mock test PortletWindow
         Mock entityMock = new Mock(MutablePortletEntity.class);        

Modified: portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/engine/AbstractEngineTest.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/engine/AbstractEngineTest.java?rev=209402&r1=209401&r2=209402&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/engine/AbstractEngineTest.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/engine/AbstractEngineTest.java
Tue Jul  5 20:22:31 2005
@@ -23,6 +23,7 @@
 
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.jetspeed.Jetspeed;
+import org.apache.jetspeed.PortalTestConstants;
 import org.apache.jetspeed.components.ComponentManagement;
 import org.jmock.Mock;
 
@@ -33,12 +34,9 @@
  * <p>
  * AbstractEngineTest
  * </p>
- * <p>
- *
- * </p>
+ * 
  * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
  * @version $Id$
- *
  */
 public abstract class AbstractEngineTest extends TestCase
 {
@@ -50,53 +48,58 @@
     {
         super();
     }
+
     /**
      * @param arg0
      */
-    public AbstractEngineTest( String arg0 )
+    public AbstractEngineTest(String arg0)
     {
         super(arg0);
     }
+
     protected Engine engine;
+
     protected Object[] keysToCheck;
-    
+
     public void testEngine() throws Exception
-    {        
+    {
         assertNotNull(engine.getComponentManager());
         assertNotNull(engine.getComponentManager().getRootContainer());
-        if(keysToCheck != null)
+        if (keysToCheck != null)
         {
             verifyComponents(keysToCheck);
         }
     }
+
     protected void setUp() throws Exception
-    {        
+    {
         super.setUp();
         // need to flag internal JNDI on...
         System.setProperty(AbstractEngine.JNDI_SUPPORT_FLAG_KEY, "true");
-        PropertiesConfiguration config = new  PropertiesConfiguration();
-        config.load(new FileInputStream("./src/webapp/WEB-INF/conf/jetspeed.properties"));

+        PropertiesConfiguration config = new PropertiesConfiguration();
+        config.load(new FileInputStream(PortalTestConstants.JETSPEED_PROPERTIES_PATH));
         Mock servletConfigMock = new Mock(ServletConfig.class);
         MockServletConfig msc = new MockServletConfig();
         msc.setServletContext(new MockServletContext());
-        engine = Jetspeed.createEngine(config, "./src/webapp", msc, getEngineClass());
-    
+        engine = Jetspeed.createEngine(config, PortalTestConstants.PORTAL_WEBAPP_PATH, msc,
getEngineClass());
+
     }
+
     protected void tearDown() throws Exception
     {
-        
+
         super.tearDown();
     }
-    
-    protected void verifyComponents( Object[] keys )
+
+    protected void verifyComponents(Object[] keys)
     {
         ComponentManagement cm = engine.getComponentManager();
-        for(int i=0; i < keys.length; i++)
+        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]);
+            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]);
         }
     }
-    
+
     protected abstract Class getEngineClass();
 }

Modified: portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/test/JetspeedTestSuite.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/test/JetspeedTestSuite.java?rev=209402&r1=209401&r2=209402&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/test/JetspeedTestSuite.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/test/JetspeedTestSuite.java
Tue Jul  5 20:22:31 2005
@@ -31,6 +31,7 @@
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.jetspeed.Jetspeed;
+import org.apache.jetspeed.PortalTestConstants;
 import org.apache.jetspeed.engine.Engine;
 import org.apache.jetspeed.engine.JetspeedEngineConstants;
 import org.apache.jetspeed.engine.SpringEngine;
@@ -145,7 +146,7 @@
      */
     public String getApplicationRoot()
     {
-        String applicationRoot = System.getProperty(JetspeedEngineConstants.APPLICATION_ROOT_KEY,
"./src/webapp");
+        String applicationRoot = System.getProperty(JetspeedEngineConstants.APPLICATION_ROOT_KEY,
PortalTestConstants.PORTAL_WEBAPP_PATH);
         return applicationRoot;
     }
 
@@ -155,7 +156,7 @@
      */
     public String getPropertiesFile()
     {
-        String jetspeedProperties = System.getProperty(JetspeedEngineConstants.APPLICATION_ROOT_KEY,
"./src/webapp") + "/WEB-INF/conf/jetspeed.properties";        
+        String jetspeedProperties = System.getProperty(JetspeedEngineConstants.APPLICATION_ROOT_KEY,
PortalTestConstants.PORTAL_WEBAPP_PATH) + "/WEB-INF/conf/jetspeed.properties";        
         return jetspeedProperties;
     }
 

Modified: portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/tools/TestWebXML.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/tools/TestWebXML.java?rev=209402&r1=209401&r2=209402&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/tools/TestWebXML.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/tools/TestWebXML.java
Tue Jul  5 20:22:31 2005
@@ -20,21 +20,19 @@
 import junit.framework.Test;
 import junit.framework.TestCase;
 
-
 /**
  * Tests of rewriting the Web.xml for PAM deployment
- *
+ * 
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  * @since 2.0
  * @version $Id$
  */
-public class TestWebXML
-    extends TestCase
+public class TestWebXML extends TestCase
 {
-     /**
+    /**
      * Creates a new instance.
      */
-    public TestWebXML(String testName) 
+    public TestWebXML(String testName)
     {
         super(testName);
     }
@@ -42,7 +40,7 @@
     /**
      * Return the Test
      */
-    public static Test suite() 
+    public static Test suite()
     {
         return new JetspeedTestSuite(TestWebXML.class);
     }
@@ -50,18 +48,16 @@
     /**
      * Setup the test.
      */
-    public void setUp() 
+    public void setUp()
     {
     }
 
     private static final String TEST_WEB_XML = "./test/testdata/deploy/web.xml";
-   
+
     public void testReadWrite() throws Exception
     {
-//        DeployUtilities util = new DeployUtilities();
-//        util.processWebXML(TEST_WEB_XML, "PATest");
-            
+        // DeployUtilities util = new DeployUtilities();
+        // util.processWebXML(TEST_WEB_XML, "PATest");
     }
 
 }
-



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