[jboss-cvs] JBossAS SVN: r87741 - in projects/bootstrap/trunk/impl-as/src: main/java/org/jboss/bootstrap/impl/as/server and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 23 19:36:12 EDT 2009


Author: ALRubinger
Date: 2009-04-23 19:36:11 -0400 (Thu, 23 Apr 2009)
New Revision: 87741

Modified:
   projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/BasicJBossASServerConfig.java
   projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationInitializer.java
   projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationInitializerImpl.java
   projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationValidator.java
   projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASServerConfig.java
   projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASServerConfigLegacy.java
   projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/server/JBossASServerInitializer.java
   projects/bootstrap/trunk/impl-as/src/test/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationInitializationTestCase.java
   projects/bootstrap/trunk/impl-as/src/test/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationValidationTestCase.java
   projects/bootstrap/trunk/impl-as/src/test/java/org/jboss/bootstrap/impl/as/server/JBossASServerInitializationTestCase.java
Log:
[JBBOOT-31] Support jboss.server.log.dir

Modified: projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/BasicJBossASServerConfig.java
===================================================================
--- projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/BasicJBossASServerConfig.java	2009-04-23 21:47:20 UTC (rev 87740)
+++ projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/BasicJBossASServerConfig.java	2009-04-23 23:36:11 UTC (rev 87741)
@@ -89,6 +89,11 @@
     */
    private URL commonBaseLocation;
 
+   /**
+    * Location in which the server logs reside
+    */
+   private URL serverLogLocation;
+
    //-------------------------------------------------------------------------------||
    // Constructor ------------------------------------------------------------------||
    //-------------------------------------------------------------------------------||
@@ -202,7 +207,7 @@
    /* (non-Javadoc)
     * @see org.jboss.bootstrap.impl.as.config.JBossASServerConfig#bootLibraryLocation(java.lang.String)
     */
-   public JBossASServerConfig bootLibraryLocation(String bootLibraryLocation) throws IllegalArgumentException
+   public JBossASServerConfig bootLibraryLocation(final String bootLibraryLocation) throws IllegalArgumentException
    {
       // If null, just pass along
       if (bootLibraryLocation == null)
@@ -229,7 +234,7 @@
    /* (non-Javadoc)
     * @see org.jboss.bootstrap.impl.as.config.JBossASServerConfig#bootLibraryLocation(java.net.URL)
     */
-   public JBossASServerConfig bootLibraryLocation(URL bootLibraryLocation)
+   public JBossASServerConfig bootLibraryLocation(final URL bootLibraryLocation)
    {
       // Set
       this.bootLibraryLocation = bootLibraryLocation;
@@ -260,7 +265,7 @@
    /* (non-Javadoc)
     * @see org.jboss.bootstrap.impl.as.config.JBossASServerConfig#serverBaseLocation(java.lang.String)
     */
-   public JBossASServerConfig serverBaseLocation(String serverBaseLocation) throws IllegalArgumentException
+   public JBossASServerConfig serverBaseLocation(final String serverBaseLocation) throws IllegalArgumentException
    {
       // If null, just pass along
       if (serverBaseLocation == null)
@@ -287,7 +292,7 @@
    /* (non-Javadoc)
     * @see org.jboss.bootstrap.impl.as.config.JBossASServerConfig#serverBaseLocation(java.net.URL)
     */
-   public JBossASServerConfig serverBaseLocation(URL serverBaseLocation)
+   public JBossASServerConfig serverBaseLocation(final URL serverBaseLocation)
    {
       // Set
       this.serverBaseLocation = serverBaseLocation;
@@ -311,7 +316,7 @@
    /* (non-Javadoc)
     * @see org.jboss.bootstrap.impl.as.config.JBossASServerConfig#serverHomeLocation(java.lang.String)
     */
-   public JBossASServerConfig serverHomeLocation(String serverHomeLocation) throws IllegalArgumentException
+   public JBossASServerConfig serverHomeLocation(final String serverHomeLocation) throws IllegalArgumentException
    {
       // If null, just pass along
       if (serverHomeLocation == null)
@@ -338,7 +343,7 @@
    /* (non-Javadoc)
     * @see org.jboss.bootstrap.impl.as.config.JBossASServerConfig#serverHomeLocation(java.net.URL)
     */
-   public JBossASServerConfig serverHomeLocation(URL serverHomeLocation)
+   public JBossASServerConfig serverHomeLocation(final URL serverHomeLocation)
    {
       // Set
       this.serverHomeLocation = serverHomeLocation;
@@ -354,7 +359,7 @@
    /* (non-Javadoc)
     * @see org.jboss.bootstrap.impl.as.config.JBossASServerConfig#commonBaseLocation(java.lang.String)
     */
-   public JBossASServerConfig commonBaseLocation(String commonBaseLocation) throws IllegalArgumentException
+   public JBossASServerConfig commonBaseLocation(final String commonBaseLocation) throws IllegalArgumentException
    {
       // If null, just pass along
       if (commonBaseLocation == null)
@@ -381,7 +386,7 @@
    /* (non-Javadoc)
     * @see org.jboss.bootstrap.impl.as.config.JBossASServerConfig#commonBaseLocation(java.net.URL)
     */
-   public JBossASServerConfig commonBaseLocation(URL commonBaseLocation)
+   public JBossASServerConfig commonBaseLocation(final URL commonBaseLocation)
    {
       // Set
       this.commonBaseLocation = commonBaseLocation;
@@ -401,6 +406,73 @@
       return this.commonBaseLocation;
    }
 
+   /* (non-Javadoc)
+    * @see org.jboss.bootstrap.impl.as.config.JBossASServerConfig#getServerLogLocation()
+    */
+   public URL getServerLogLocation()
+   {
+      return this.serverLogLocation;
+   }
+
+   /* (non-Javadoc)
+    * @see org.jboss.bootstrap.impl.as.config.JBossASServerConfig#serverLogLocation(java.lang.String)
+    */
+   public JBossASServerConfig serverLogLocation(final String serverLogLocation) throws IllegalArgumentException
+   {
+      // If null, just pass along
+      if (serverLogLocation == null)
+      {
+         return this.serverLogLocation((URL) null);
+      }
+
+      // Convert this String into a URL via File
+      final File file = new File(serverLogLocation);
+      URL url = null;
+      try
+      {
+         url = file.toURI().toURL();
+      }
+      catch (MalformedURLException e)
+      {
+         throw new IllegalArgumentException("Cannot construct URL given: " + serverLogLocation, e);
+      }
+
+      // Return
+      return this.serverLogLocation(url);
+   }
+
+   /* (non-Javadoc)
+    * @see org.jboss.bootstrap.impl.as.config.JBossASServerConfig#serverLogLocation(java.net.URL)
+    */
+   public JBossASServerConfig serverLogLocation(final URL serverLogLocation)
+   {
+      // Set
+      this.serverLogLocation = serverLogLocation;
+
+      // Get the absolute path
+      String location = null;
+      if (serverLogLocation != null)
+      {
+         URI uri = null;
+         try
+         {
+            uri = serverLogLocation.toURI();
+         }
+         catch (URISyntaxException e)
+         {
+            throw new RuntimeException("Error in format of " + uri, e);
+         }
+         location = new File(uri).getAbsolutePath();
+
+      }
+
+      // Set properties
+      this.setPropertyForString(PROP_KEY_JBOSSAS_SERVER_LOG_DIR, location);
+
+      // Return
+      return this.covarientReturn();
+   }
+
    //-------------------------------------------------------------------------------||
    // Internal Helper Methods ------------------------------------------------------||
    //-------------------------------------------------------------------------------||

Modified: projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationInitializer.java
===================================================================
--- projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationInitializer.java	2009-04-23 21:47:20 UTC (rev 87740)
+++ projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationInitializer.java	2009-04-23 23:36:11 UTC (rev 87741)
@@ -82,4 +82,10 @@
     * {@link JBossASServerConfig#PROP_KEY_JBOSSAS_COMMON_BASE_URL}
     */
    String DEFAULT_VALUE_COMMON_BASE_URL_SUFFIX = "common/";
+
+   /**
+    * The suffix used when generating the default value for 
+    * {@link JBossASServerConfig#PROP_KEY_JBOSSAS_SERVER_LOG_DIR}.
+    */
+   String DEFAULT_VALUE_SERVER_LOG_DIR_SUFFIX = "log/";
 }

Modified: projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationInitializerImpl.java
===================================================================
--- projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationInitializerImpl.java	2009-04-23 21:47:20 UTC (rev 87740)
+++ projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationInitializerImpl.java	2009-04-23 23:36:11 UTC (rev 87741)
@@ -137,6 +137,16 @@
       resolvedCommonBaseLocation = this.adjustToTrailingSlash(resolvedCommonBaseLocation);
       config.commonBaseLocation(resolvedCommonBaseLocation);
 
+      // ${jboss.server.log.dir}
+      final URL serverLogLocation = config.getServerLogLocation();
+      final String serverLogDefault = resolvedServerHomeLocation
+            + JBossASConfigurationInitializer.DEFAULT_VALUE_SERVER_LOG_DIR_SUFFIX;
+      final String currentServerLogLocation = serverLogLocation != null ? serverLogLocation.toExternalForm() : null;
+      String resolvedServerLogLocation = this.resolvePropertyValue(JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_LOG_DIR,
+            currentServerLogLocation, serverLogDefault, configProps);
+      resolvedServerLogLocation = this.adjustToTrailingSlash(resolvedServerLogLocation);
+      config.serverLogLocation(resolvedServerLogLocation);
+
    }
 
    //-------------------------------------------------------------------------------||

Modified: projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationValidator.java
===================================================================
--- projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationValidator.java	2009-04-23 21:47:20 UTC (rev 87740)
+++ projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationValidator.java	2009-04-23 23:36:11 UTC (rev 87741)
@@ -87,6 +87,8 @@
       this.require(config.getServerHomeLocation(), JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_HOME_URL);
       // jboss.common.base.url
       this.require(config.getCommonBaseLocation(), JBossASServerConfig.PROP_KEY_JBOSSAS_COMMON_BASE_URL);
+      // jboss.server.log.dir
+      this.require(config.getServerLogLocation(), JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_LOG_DIR);
 
       // Log
       log.debug("Configuration is valid: " + config);

Modified: projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASServerConfig.java
===================================================================
--- projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASServerConfig.java	2009-04-23 21:47:20 UTC (rev 87740)
+++ projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASServerConfig.java	2009-04-23 23:36:11 UTC (rev 87741)
@@ -119,6 +119,12 @@
     */
    String PROP_KEY_JBOSSAS_COMMON_BASE_URL = "jboss.common.base.url";
 
+   /**
+    * Constant that holds the name of the environment property
+    * for specifying the server log directory for JBoss.
+    */
+   String PROP_KEY_JBOSSAS_SERVER_LOG_DIR = "jboss.server.log.dir";
+
    //-------------------------------------------------------------------------------||
    // Contracts --------------------------------------------------------------------||
    //-------------------------------------------------------------------------------||
@@ -289,4 +295,29 @@
     *    is non-null and cannot be constructed into a URL
     */
    JBossASServerConfig commonBaseLocation(String commonBaseLocation) throws IllegalArgumentException;
+
+   /**
+    * Obtains the location in which the server logs reside
+    * 
+    * @return
+    */
+   URL getServerLogLocation();
+
+   /**
+    * Sets the location in which the server logs reside
+    * 
+    * @param serverLogLocation
+    * @return
+    */
+   JBossASServerConfig serverLogLocation(URL serverLogLocation);
+
+   /**
+    * Sets the location in which the server logs reside
+    * 
+    * @param serverLogLocation
+    * @return
+    * @throws IllegalArgumentException If the specified argument 
+    *    is non-null and cannot be constructed into a URL
+    */
+   JBossASServerConfig serverLogLocation(String serverLogLocation) throws IllegalArgumentException;
 }

Modified: projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASServerConfigLegacy.java
===================================================================
--- projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASServerConfigLegacy.java	2009-04-23 21:47:20 UTC (rev 87740)
+++ projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/config/JBossASServerConfigLegacy.java	2009-04-23 23:36:11 UTC (rev 87741)
@@ -79,14 +79,6 @@
 
    /**
     * Constant that holds the name of the environment property
-    * for specifying the server log directory for JBoss.
-    *
-    * <p>Defaults to <tt><em>SERVER_HOME_DIR</em>/<em>log</em></tt>.
-    */
-   String PROP_KEY_JBOSSAS_SERVER_LOG_DIR = "jboss.server.log.dir";
-
-   /**
-    * Constant that holds the name of the environment property
     * for specifying the directory which JBoss will use for
     * temporary file storage.
     *
@@ -188,11 +180,6 @@
    String DEFAULT_VALUE_SERVER_DATA_DIR_SUFFIX = "data";
 
    /**
-    * The suffix used when generating the default value for {@link #PROP_KEY_JBOSSAS_SERVER_LOG_DIR}.
-    */
-   String DEFAULT_VALUE_SERVER_LOG_DIR_SUFFIX = "log";
-
-   /**
     * The suffix used when generating the default value for {@link #PROP_KEY_JBOSSAS_SERVER_TEMP_DIR}.
     */
    String DEFAULT_VALUE_SERVER_TEMP_DIR_SUFFIX = "tmp";

Modified: projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/server/JBossASServerInitializer.java
===================================================================
--- projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/server/JBossASServerInitializer.java	2009-04-23 21:47:20 UTC (rev 87740)
+++ projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/server/JBossASServerInitializer.java	2009-04-23 23:36:11 UTC (rev 87741)
@@ -96,6 +96,7 @@
       final URL serverHomeUrl = configuration.getServerHomeLocation();
       final String serverHomeDir = this.getAbsoluteLocationOfUrl(serverHomeUrl);
       final URL commonBaseUrl = configuration.getCommonBaseLocation();
+      final String serverLogDir = this.getAbsoluteLocationOfUrl(configuration.getServerLogLocation());
 
       // Set our system properties
       this.setSystemProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_HOME, jbossHomeDir);
@@ -109,6 +110,7 @@
       this.setSystemProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_HOME_URL, serverHomeUrl);
       this.setSystemProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_HOME_DIR, serverHomeDir);
       this.setSystemProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_COMMON_BASE_URL, commonBaseUrl);
+      this.setSystemProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_LOG_DIR, serverLogDir);
    }
 
    //-------------------------------------------------------------------------------||

Modified: projects/bootstrap/trunk/impl-as/src/test/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationInitializationTestCase.java
===================================================================
--- projects/bootstrap/trunk/impl-as/src/test/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationInitializationTestCase.java	2009-04-23 21:47:20 UTC (rev 87740)
+++ projects/bootstrap/trunk/impl-as/src/test/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationInitializationTestCase.java	2009-04-23 23:36:11 UTC (rev 87741)
@@ -74,6 +74,8 @@
       }
    }
 
+   private static final String TRAILING_SLASH = "/";
+
    //-------------------------------------------------------------------------------||
    // Instance Members -------------------------------------------------------------||
    //-------------------------------------------------------------------------------||
@@ -222,9 +224,7 @@
       final String actual = config.getServerHomeLocation().toExternalForm();
 
       // Get expected value
-      final String expected = JBOSS_HOME.toExternalForm()
-            + JBossASConfigurationInitializer.DEFAULT_VALUE_SERVER_BASE_URL_SUFFIX
-            + JBossASConfigurationInitializer.DEFAULT_VALUE_SERVER_NAME + "/";
+      final String expected = this.getServerHomeLocation();
 
       // Test
       TestCase.assertEquals("Server home location was not defaulted as expected", expected, actual);
@@ -252,4 +252,39 @@
       TestCase.assertEquals("Common base location was not defaulted as expected", expected, actual);
       log.info("Got expected: " + expected);
    }
+
+   /**
+    * Ensures that the server log location defaults to $JBOSS_HOME/server/$serverName/log
+    * @throws Throwable
+    */
+   @Test
+   public void testServerLogDefault() throws Throwable
+   {
+      // Log
+      log.info("testServerLogDefault");
+
+      // Get out server base location
+      final String actual = config.getServerLogLocation().toExternalForm();
+
+      // Get expected value
+      final String expected = this.getServerHomeLocation()
+            + JBossASConfigurationInitializer.DEFAULT_VALUE_SERVER_LOG_DIR_SUFFIX;
+
+      // Test
+      TestCase.assertEquals("Server log location was not defaulted as expected", expected, actual);
+      log.info("Got expected: " + expected);
+   }
+
+   //-------------------------------------------------------------------------------||
+   // Internal Helper Methods ------------------------------------------------------||
+   //-------------------------------------------------------------------------------||
+
+   /**
+    * Obtains the server home location
+    */
+   private String getServerHomeLocation()
+   {
+      return JBOSS_HOME.toExternalForm() + JBossASConfigurationInitializer.DEFAULT_VALUE_SERVER_BASE_URL_SUFFIX
+            + JBossASConfigurationInitializer.DEFAULT_VALUE_SERVER_NAME + TRAILING_SLASH;
+   }
 }

Modified: projects/bootstrap/trunk/impl-as/src/test/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationValidationTestCase.java
===================================================================
--- projects/bootstrap/trunk/impl-as/src/test/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationValidationTestCase.java	2009-04-23 21:47:20 UTC (rev 87740)
+++ projects/bootstrap/trunk/impl-as/src/test/java/org/jboss/bootstrap/impl/as/config/JBossASConfigurationValidationTestCase.java	2009-04-23 23:36:11 UTC (rev 87741)
@@ -298,6 +298,23 @@
       this.assertMissingValueFails(config, "common base");
    }
 
+   /**
+    * Ensures that an empty/null Server Log location fails
+    */
+   @Test
+   public void testNoServerLogLocationFails()
+   {
+      // Log
+      log.info("testNoServerLogLocationFails");
+
+      // Get config and clear out
+      final JBossASServerConfig config = this.config;
+      config.serverLogLocation((URL) null);
+
+      // Test
+      this.assertMissingValueFails(config, "server log location");
+   }
+
    //-------------------------------------------------------------------------------||
    // Internal Helper Methods ------------------------------------------------------||
    //-------------------------------------------------------------------------------||
@@ -348,13 +365,14 @@
       final String serverName = JBossASConfigurationInitializer.DEFAULT_VALUE_SERVER_NAME;
       final String bootLib = jbossHome + JBossASConfigurationInitializer.DEFAULT_VALUE_LIBRARY_URL_SUFFIX;
       final String serverBase = jbossHome + JBossASConfigurationInitializer.DEFAULT_VALUE_SERVER_BASE_URL_SUFFIX;
-      final String serverHome = serverBase + serverName;
+      final String serverHome = serverBase + serverName + "/";
       final String commonBase = jbossHome + JBossASConfigurationInitializer.DEFAULT_VALUE_COMMON_BASE_URL_SUFFIX;
+      final String serverLog = serverHome + JBossASConfigurationInitializer.DEFAULT_VALUE_LIBRARY_URL_SUFFIX;
 
       // Populate
       config.jbossHome(jbossHome).bootstrapHome(bootstrapHome).bootstrapName(bootstrapName).bindAddress(bindAddress)
             .serverName(serverName).bootLibraryLocation(bootLib).serverBaseLocation(serverBase).serverHomeLocation(
-                  serverHome).commonBaseLocation(commonBase);
+                  serverHome).commonBaseLocation(commonBase).serverLogLocation(serverLog);
 
       // Return
       return config;

Modified: projects/bootstrap/trunk/impl-as/src/test/java/org/jboss/bootstrap/impl/as/server/JBossASServerInitializationTestCase.java
===================================================================
--- projects/bootstrap/trunk/impl-as/src/test/java/org/jboss/bootstrap/impl/as/server/JBossASServerInitializationTestCase.java	2009-04-23 21:47:20 UTC (rev 87740)
+++ projects/bootstrap/trunk/impl-as/src/test/java/org/jboss/bootstrap/impl/as/server/JBossASServerInitializationTestCase.java	2009-04-23 23:36:11 UTC (rev 87741)
@@ -127,6 +127,7 @@
       final String serverHomeUrlPropKey = JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_HOME_URL;
       final String serverHomeDirPropKey = JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_HOME_DIR;
       final String commonBaseUrlPropKey = JBossASServerConfig.PROP_KEY_JBOSSAS_COMMON_BASE_URL;
+      final String serverLogDirPropKey = JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_LOG_DIR;
 
       // Get Properties from Configuration
       final Map<String, String> properties = configuration.getProperties();
@@ -141,6 +142,7 @@
       final String serverHomeUrlFromConfProp = properties.get(serverHomeUrlPropKey);
       final String serverHomeDirFromConfProp = properties.get(serverHomeDirPropKey);
       final String commonBaseUrlFromConfProp = properties.get(commonBaseUrlPropKey);
+      final String serverLogDirFromConfProp = properties.get(serverLogDirPropKey);
 
       // Get Properties from System
       final String jbossHomeFromSystem = System.getProperty(jbossHomePropKey);
@@ -154,6 +156,7 @@
       final String serverHomeUrlFromSystem = System.getProperty(serverHomeUrlPropKey);
       final String serverHomeDirFromSystem = System.getProperty(serverHomeDirPropKey);
       final String commonBaseUrlFromSystem = System.getProperty(commonBaseUrlPropKey);
+      final String serverLogDirFromSystem = System.getProperty(serverLogDirPropKey);
 
       // Get Expected Values
       final URL jbossHomeFromConf = configuration.getJBossHome();
@@ -172,6 +175,9 @@
       final String serverHomeUrlFromConf = serverHomeFromConf.toExternalForm();
       final String serverHomeDirFromConf = serverHomeFile.getAbsolutePath();
       final String commonBaseUrlFromConf = configuration.getCommonBaseLocation().toExternalForm();
+      final URL serverLogFromConf = configuration.getServerLogLocation();
+      final File serverLogFile = new File(serverLogFromConf.toURI());
+      final String serverLogDirFromConf = serverLogFile.getAbsolutePath();
 
       // Ensure all equal
       TestCase.assertEquals("JBoss Home in configuration must match the config property", jbossHomeDirFromConf,
@@ -218,6 +224,10 @@
             commonBaseUrlFromConfProp);
       TestCase.assertEquals("Common Base URL in configuration must match the system property", commonBaseUrlFromConf,
             commonBaseUrlFromSystem);
+      TestCase.assertEquals("Server Log Dir in configuration must match the config property", serverLogDirFromConf,
+            serverLogDirFromConfProp);
+      TestCase.assertEquals("Server Log Dir in configuration must match the system property", serverLogDirFromConf,
+            serverLogDirFromSystem);
 
       // Cleanup
       server.shutdown();
@@ -234,6 +244,7 @@
       final String serverHomeUrlFromSystemAfterCleanup = System.getProperty(serverHomeUrlPropKey);
       final String serverHomeDirFromSystemAfterCleanup = System.getProperty(serverHomeDirPropKey);
       final String commonBaseUrlFromSystemAfterCleanup = System.getProperty(commonBaseUrlPropKey);
+      final String serverLogDirFromSystemAfterCleanup = System.getProperty(serverLogDirPropKey);
 
       // Ensure all null
       final String failMessage = "System property should be null after cleanup";
@@ -248,5 +259,6 @@
       TestCase.assertNull(failMessage, serverHomeUrlFromSystemAfterCleanup);
       TestCase.assertNull(failMessage, serverHomeDirFromSystemAfterCleanup);
       TestCase.assertNull(failMessage, commonBaseUrlFromSystemAfterCleanup);
+      TestCase.assertNull(failMessage, serverLogDirFromSystemAfterCleanup);
    }
 }




More information about the jboss-cvs-commits mailing list