You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by at...@apache.org on 2007/10/24 13:43:57 UTC

svn commit: r587858 - in /portals/jetspeed-2/trunk: components/jetspeed-cm/src/main/java/org/apache/jetspeed/components/test/ components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/ components/jetspeed-registry/src/main/java/org/apache/j...

Author: ate
Date: Wed Oct 24 04:43:53 2007
New Revision: 587858

URL: http://svn.apache.org/viewvc?rev=587858&view=rev
Log:
Fixing broken test cases in the trunk because of incomplete spring assembly setup as result of the JS2-634 changes to registry.xml (svn r581756) which now requires the page-manager.xml also to be loaded.
As the page-manager.xml depends on the IdGenerator, PageFileCache bean definitions defined in jetspeed-spring.xml and property ${applicationRoot},
I splitted off the IdGenerator and PageFileCache from jetspeed-spring.xml into a new jetspeed-base.xml (ugh, properly naming these becomes troublesome)
and added initializing the ${applicationRoot} property in AbstractSpringTestCase which assumes the portal WEB-INF/ tree to be expanded under <current project>/target/test-cases/webapp.

Added:
    portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-base.xml   (with props)
Modified:
    portals/jetspeed-2/trunk/components/jetspeed-cm/src/main/java/org/apache/jetspeed/components/test/AbstractSpringTestCase.java
    portals/jetspeed-2/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java
    portals/jetspeed-2/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/util/RegistrySupportedTestCase.java
    portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-spring.xml

Modified: portals/jetspeed-2/trunk/components/jetspeed-cm/src/main/java/org/apache/jetspeed/components/test/AbstractSpringTestCase.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-cm/src/main/java/org/apache/jetspeed/components/test/AbstractSpringTestCase.java?rev=587858&r1=587857&r2=587858&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-cm/src/main/java/org/apache/jetspeed/components/test/AbstractSpringTestCase.java (original)
+++ portals/jetspeed-2/trunk/components/jetspeed-cm/src/main/java/org/apache/jetspeed/components/test/AbstractSpringTestCase.java Wed Oct 24 04:43:53 2007
@@ -17,7 +17,10 @@
 package org.apache.jetspeed.components.test;
 
 import java.io.File;
+import java.util.Properties;
 
+import org.apache.jetspeed.engine.JetspeedEngineConstants;
+import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
@@ -54,12 +57,18 @@
             if (bootConfigurations != null)
             {
                 ApplicationContext bootContext = new ClassPathXmlApplicationContext(bootConfigurations, true);
-                ctx = new ClassPathXmlApplicationContext(getConfigurations(), true, bootContext);
+                ctx = new ClassPathXmlApplicationContext(getConfigurations(), false, bootContext);
             }
             else
             {
-                ctx = new ClassPathXmlApplicationContext(getConfigurations(), true);
+                ctx = new ClassPathXmlApplicationContext(getConfigurations(), false);
             }
+            PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
+            Properties p = new Properties();
+            p.setProperty(JetspeedEngineConstants.APPLICATION_ROOT_KEY, System.getProperty("user.dir")+"/target/test-classes/webapp");
+            ppc.setProperties(p);
+            ctx.addBeanFactoryPostProcessor(ppc);
+            ctx.refresh();
         }
     }
 

Modified: portals/jetspeed-2/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java?rev=587858&r1=587857&r2=587858&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java (original)
+++ portals/jetspeed-2/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java Wed Oct 24 04:43:53 2007
@@ -240,6 +240,8 @@
     {
         String[] confs = super.getConfigurations();
         List confList = new ArrayList(Arrays.asList(confs));
+        confList.add("jetspeed-base.xml");
+        confList.add("page-manager.xml");
         confList.add("registry.xml");
         confList.add("rc3.xml");
         confList.add("JETSPEED-INF/spring/user-info.xml");

Modified: portals/jetspeed-2/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/util/RegistrySupportedTestCase.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/util/RegistrySupportedTestCase.java?rev=587858&r1=587857&r2=587858&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/util/RegistrySupportedTestCase.java (original)
+++ portals/jetspeed-2/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/util/RegistrySupportedTestCase.java Wed Oct 24 04:43:53 2007
@@ -28,6 +28,7 @@
 
 import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent;
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
+import org.apache.jetspeed.engine.JetspeedEngineConstants;
 import org.apache.jetspeed.prefs.util.test.AbstractPrefsSupportedTestCase;
 
 /**
@@ -54,6 +55,8 @@
     {
         String[] confs = super.getConfigurations();
         List confList = new ArrayList(Arrays.asList(confs));
+        confList.add("jetspeed-base.xml");
+        confList.add("page-manager.xml");
         confList.add("registry.xml");
         return (String[]) confList.toArray(new String[1]);
     }

Added: portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-base.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-base.xml?rev=587858&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-base.xml (added)
+++ portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-base.xml Wed Oct 24 04:43:53 2007
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<beans>
+
+    <!-- ID Generator -->
+    <bean id="IdGenerator" class="org.apache.jetspeed.idgenerator.JetspeedIdGenerator" init-method="start" destroy-method="stop">
+        <!-- ID Start value -->
+        <constructor-arg index="0">
+            <value>65536</value>
+        </constructor-arg>
+        <!-- ID Prefix -->
+        <constructor-arg index="1">
+            <value>P-</value>
+        </constructor-arg>
+        <!-- ID Suffix -->
+        <constructor-arg index="2">
+            <value></value>
+        </constructor-arg>
+    </bean>
+
+    <!-- Page File Cache -->
+    <bean id="PageFileCache" class="org.apache.jetspeed.cache.file.FileCache" init-method="startFileScanner" destroy-method="stopFileScanner">
+        <!-- Scan rate for changes in cached files on the file system -->
+        <constructor-arg index="0">
+            <value>10</value>
+        </constructor-arg>
+        <!-- Cache size -->
+        <constructor-arg index="1">
+            <value>100</value>
+        </constructor-arg>
+    </bean>
+
+</beans>

Propchange: portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-base.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-base.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-base.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-spring.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-spring.xml?rev=587858&r1=587857&r2=587858&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-spring.xml (original)
+++ portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/jetspeed-spring.xml Wed Oct 24 04:43:53 2007
@@ -70,34 +70,6 @@
         </constructor-arg>
     </bean>
 
-    <!-- ID Generator -->
-    <bean id="IdGenerator" class="org.apache.jetspeed.idgenerator.JetspeedIdGenerator" init-method="start" destroy-method="stop">
-        <!-- ID Start value -->
-        <constructor-arg index="0">
-            <value>65536</value>
-        </constructor-arg>
-        <!-- ID Prefix -->
-        <constructor-arg index="1">
-            <value>P-</value>
-        </constructor-arg>
-        <!-- ID Suffix -->
-        <constructor-arg index="2">
-            <value></value>
-        </constructor-arg>
-    </bean>
-
-    <!-- Page File Cache -->
-    <bean id="PageFileCache" class="org.apache.jetspeed.cache.file.FileCache" init-method="startFileScanner" destroy-method="stopFileScanner">
-        <!-- Scan rate for changes in cached files on the file system -->
-        <constructor-arg index="0">
-            <value>10</value>
-        </constructor-arg>
-        <!-- Cache size -->
-        <constructor-arg index="1">
-            <value>100</value>
-        </constructor-arg>
-    </bean>
-
     <!-- Request Context -->
     <bean id="org.apache.jetspeed.request.RequestContextComponent" class="org.apache.jetspeed.request.JetspeedRequestContextComponent">
         <constructor-arg index='0'>



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