portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlest...@apache.org
Subject svn commit: r226650 - /portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/AbstractTestHelper.java
Date Sun, 31 Jul 2005 15:38:31 GMT
Author: dlestrat
Date: Sun Jul 31 08:38:29 2005
New Revision: 226650

URL: http://svn.apache.org/viewcvs?rev=226650&view=rev
Log:
Added empty constructor.

Modified:
    portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/AbstractTestHelper.java

Modified: portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/AbstractTestHelper.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/AbstractTestHelper.java?rev=226650&r1=226649&r2=226650&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/AbstractTestHelper.java
(original)
+++ portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/AbstractTestHelper.java
Sun Jul 31 08:38:29 2005
@@ -1,6 +1,7 @@
 package org.apache.jetspeed.testhelpers;
 
 import java.io.File;
+import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.commons.configuration.CompositeConfiguration;
@@ -13,6 +14,7 @@
 public abstract class AbstractTestHelper implements TestHelper
 {
     public static final String APP_CONTEXT = "AppContext";
+
     private final Map context;
 
     private static final CompositeConfiguration USER_PROPERTIES;
@@ -22,28 +24,28 @@
         {
             File userBuildFile = new File(System.getProperty("user.home"), "build.properties");
             Configuration userBuildProps = loadConfiguration(userBuildFile);
-            
+
             File mavenBuildFile = new File("../../build.properties");
             Configuration mavenBuildProps = loadConfiguration(mavenBuildFile);
-            
+
             File mavenProjectFile = new File("../../project.properties");
             Configuration mavenProjectProps = loadConfiguration(mavenProjectFile);
-            
+
             USER_PROPERTIES = new CompositeConfiguration();
             USER_PROPERTIES.addConfiguration(userBuildProps);
             USER_PROPERTIES.addConfiguration(mavenBuildProps);
-            USER_PROPERTIES.addConfiguration(mavenProjectProps);            
+            USER_PROPERTIES.addConfiguration(mavenProjectProps);
         }
         catch (ConfigurationException e)
         {
-            
-           throw new IllegalStateException("Unable to load ${USER_HOME}/build.properties");
+
+            throw new IllegalStateException("Unable to load ${USER_HOME}/build.properties");
         }
     }
 
     private static Configuration loadConfiguration(File propsFile) throws ConfigurationException
     {
-        if(propsFile.exists())
+        if (propsFile.exists())
         {
             return new PropertiesConfiguration(propsFile);
         }
@@ -51,26 +53,30 @@
         {
             return new PropertiesConfiguration();
         }
-    }   
+    }
 
     public AbstractTestHelper(Map context)
     {
         this.context = context;
     }
+    
+    public AbstractTestHelper()
+    {
+        context = new HashMap();
+    }
 
     public Map getContext()
     {
         return context;
     }
 
-    protected final String getUserProperty(String key)
+    public final String getUserProperty(String key)
     {
         // use system properties passed to test via the
         // maven.junit.sysproperties configuration from
         // maven build.properties and/or project.properties
-        
         String prop = System.getProperty(key);
-        if(prop == null)
+        if (prop == null)
         {
             return (String) USER_PROPERTIES.getProperty(key);
         }
@@ -79,11 +85,11 @@
             return prop;
         }
     }
-    
+
     protected final void addBeanFactory(ConfigurableBeanFactory bf)
     {
         ConfigurableBeanFactory currentBf = (ConfigurableBeanFactory) context.get(APP_CONTEXT);
-        if(currentBf != null)
+        if (currentBf != null)
         {
             bf.setParentBeanFactory(currentBf);
             context.put(APP_CONTEXT, new DefaultListableBeanFactory(bf));



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