Randy,

I went ahead and changed the AbstractTestHelper in way that *should* work
for both of us.  Would you mind testing as soon as you have a free moment?

Regards,
-Scott

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 28, 2005 10:17 AM
> To: [email protected]
> Subject: svn commit: r225779 - /portals/jetspeed-
> 2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/AbstractTes
> tHelper.java
> 
> Author: weaver
> Date: Thu Jul 28 07:16:55 2005
> New Revision: 225779
> 
> URL: http://svn.apache.org/viewcvs?rev=225779&view=rev
> Log:
> Hopefully this will work in everyone's development environment.
> 
> I added checks to make sure the properties file exists before trying to
> load them.
> I have also added the loading of ${PROJECT_HOME}/build.properties and
> ${PROJECT_HOME}/project.properties.
> 
> Modified:
>     portals/jetspeed-
> 2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/AbstractTes
> tHelper.java
> 
> Modified: portals/jetspeed-
> 2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/AbstractTes
> tHelper.java
> URL: http://svn.apache.org/viewcvs/portals/jetspeed-
> 2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/AbstractTes
> tHelper.java?rev=225779&r1=225778&r2=225779&view=diff
> ==========================================================================
> ====
> --- portals/jetspeed-
> 2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/AbstractTes
> tHelper.java (original)
> +++ portals/jetspeed-
> 2/trunk/components/cm/src/java/org/apache/jetspeed/testhelpers/AbstractTes
> tHelper.java Thu Jul 28 07:16:55 2005
> @@ -3,6 +3,8 @@
>  import java.io.File;
>  import java.util.Map;
> 
> +import org.apache.commons.configuration.CompositeConfiguration;
> +import org.apache.commons.configuration.Configuration;
>  import org.apache.commons.configuration.ConfigurationException;
>  import org.apache.commons.configuration.PropertiesConfiguration;
>  import org.springframework.beans.factory.config.ConfigurableBeanFactory;
> @@ -13,17 +15,41 @@
>      public static final String APP_CONTEXT = "AppContext";
>      private final Map context;
> 
> -    private static final PropertiesConfiguration USER_PROPERTIES;
> +    private static final CompositeConfiguration USER_PROPERTIES;
>      static
>      {
>          try
>          {
> -            USER_PROPERTIES= new PropertiesConfiguration(new
> File(System.getProperty("user.home"), "build.properties"));
> +            File userBuildFile = new
> File(System.getProperty("user.home"), "build.properties");
> +            Configuration userBuildProps =
> loadConfiguration(userBuildFile);
> +
> +            File mavenBuildFile = new File("../../build.properties");
> +            Configuration mavenBuildProps =
> loadConfiguration(userBuildFile);
> +
> +            File mavenProjectFile = new File("../../project.properties");
> +            Configuration mavenProjectProps =
> loadConfiguration(userBuildFile);
> +
> +            USER_PROPERTIES = new CompositeConfiguration();
> +            USER_PROPERTIES.addConfiguration(userBuildProps);
> +            USER_PROPERTIES.addConfiguration(mavenBuildProps);
> +            USER_PROPERTIES.addConfiguration(mavenProjectProps);
>          }
>          catch (ConfigurationException e)
>          {
> 
>             throw new IllegalStateException("Unable to load
> ${USER_HOME}/build.properties");
> +        }
> +    }
> +
> +    private static Configuration loadConfiguration(File propsFile) throws
> ConfigurationException
> +    {
> +        if(propsFile.exists())
> +        {
> +            return new PropertiesConfiguration(propsFile);
> +        }
> +        else
> +        {
> +            return new PropertiesConfiguration();
>          }
>      }
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to