[jboss-cvs] JBossAS SVN: r84693 - in projects/bootstrap/trunk/src: test/java/org/jboss/bootstrap and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 24 21:43:20 EST 2009


Author: ALRubinger
Date: 2009-02-24 21:43:20 -0500 (Tue, 24 Feb 2009)
New Revision: 84693

Added:
   projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/NoInitServerImpl.java
Removed:
   projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot5/NoInitServerImpl.java
Modified:
   projects/bootstrap/trunk/src/main/java/org/jboss/bootstrap/AbstractServerImpl.java
   projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot5/unit/CleanShutdownOnIncompleteInitTestCase.java
Log:
[JBBOOT-13] Reapplied r83923 by scott.stark at jboss.org - "Update the Server interface to accept a map of configuration metadata"

Modified: projects/bootstrap/trunk/src/main/java/org/jboss/bootstrap/AbstractServerImpl.java
===================================================================
--- projects/bootstrap/trunk/src/main/java/org/jboss/bootstrap/AbstractServerImpl.java	2009-02-25 02:37:50 UTC (rev 84692)
+++ projects/bootstrap/trunk/src/main/java/org/jboss/bootstrap/AbstractServerImpl.java	2009-02-25 02:43:20 UTC (rev 84693)
@@ -193,6 +193,7 @@
       boolean overrideTmpDir = Boolean.getBoolean("jboss.server.temp.dir.overrideJavaTmpDir");
       if (overrideTmpDir)
       {
+         //File serverTmpDir = config.getServerTempDir(); //TODO Put this back when we go back to File 
          VirtualFile serverTmpDir = config.getServerTempDir();
          System.setProperty("java.io.tmpdir", serverTmpDir.getPathName());
       }
@@ -334,14 +335,7 @@
 
       return config;
    }
-   
-   protected void setConfig(BaseServerConfig config)
-   {
-      assert config!=null:"Specified " + ServerConfig.class.getSimpleName() + " was null";
-      this.config = config;
-   }
 
-   
    /**
     * Get the optional server configuration metadata
     * @return a possibly empty map of configuration metadata.
@@ -350,6 +344,30 @@
    {
       return metadata;
    }
+   /**
+    * Set the server configuration metadata
+    * @param metadata
+    */
+   public void setMetaData(Map<String, Object> metadata)
+   {
+      if (metadata == null)
+         this.metadata = Collections.emptyMap();
+      else
+         this.metadata = Collections.unmodifiableMap(metadata);
+   }
+   
+   /**
+    * Sets the Server Config
+    * 
+    * Package access for use in testing only
+    * 
+    * @param config
+    */
+   void setConfig(BaseServerConfig config)
+   {
+      assert config!=null:"Specified " + ServerConfig.class.getSimpleName() + " was null";
+      this.config = config;
+   }
 
    /**
     * Check if the server is started.
@@ -509,7 +527,7 @@
     */
    protected void shutdownServer()
    {
-      if (log!=null && log.isTraceEnabled())
+      if (log.isTraceEnabled())
          log.trace("Shutdown caller:", new Throwable("Here"));
       
       // avoid entering twice; may happen when called directly

Copied: projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/NoInitServerImpl.java (from rev 84684, projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot5/NoInitServerImpl.java)
===================================================================
--- projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/NoInitServerImpl.java	                        (rev 0)
+++ projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/NoInitServerImpl.java	2009-02-25 02:43:20 UTC (rev 84693)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bootstrap;
+
+import java.util.Properties;
+
+import org.jboss.bootstrap.test.common.ServerConfigUtil;
+import org.jboss.util.StopWatch;
+
+/**
+ * NoInitServerImpl
+ * 
+ * An implementation of ServerImpl which does not perform initialization
+ * such that shutdown can be tested cleanly (ie. does not rely upon complete 
+ * init)
+ * 
+ * JBBOOT-5
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class NoInitServerImpl extends AbstractServerImpl
+{
+   //--------------------------------------------------------------------||
+   // Required Implementations ------------------------------------------||
+   //--------------------------------------------------------------------||
+
+   /* (non-Javadoc)
+    * @see org.jboss.bootstrap.AbstractServerImpl#doShutdown()
+    */
+   @Override
+   protected void doShutdown()
+   {
+     
+   }
+
+   /* (non-Javadoc)
+    * @see org.jboss.bootstrap.AbstractServerImpl#doStart(org.jboss.util.StopWatch)
+    */
+   @Override
+   protected void doStart(StopWatch watch) throws Throwable
+   {
+    
+   }
+
+   //--------------------------------------------------------------------||
+   // Overridden Implementations ----------------------------------------||
+   //--------------------------------------------------------------------||
+
+   /**
+    * Initialization scheme which does nothing aside set the ServerConfig
+    */
+   @Override
+   public void init(Properties props) throws IllegalStateException, Exception
+   {
+      this.setConfig(ServerConfigUtil.getConfig(props));
+   }
+
+}


Property changes on: projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/NoInitServerImpl.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot5/NoInitServerImpl.java
===================================================================
--- projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot5/NoInitServerImpl.java	2009-02-25 02:37:50 UTC (rev 84692)
+++ projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot5/NoInitServerImpl.java	2009-02-25 02:43:20 UTC (rev 84693)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
-  *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bootstrap.test.jboot5;
-
-import java.util.Properties;
-
-import org.jboss.bootstrap.AbstractServerImpl;
-import org.jboss.bootstrap.test.common.ServerConfigUtil;
-import org.jboss.util.StopWatch;
-
-/**
- * NoInitServerImpl
- * 
- * An implementation of ServerImpl which does not perform initialization
- * such that shutdown can be tested cleanly (ie. does not rely upon complete 
- * init)
- * 
- * JBBOOT-5
- *
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public class NoInitServerImpl extends AbstractServerImpl
-{
-   //--------------------------------------------------------------------||
-   // Required Implementations ------------------------------------------||
-   //--------------------------------------------------------------------||
-
-   /* (non-Javadoc)
-    * @see org.jboss.bootstrap.AbstractServerImpl#doShutdown()
-    */
-   @Override
-   protected void doShutdown()
-   {
-     
-   }
-
-   /* (non-Javadoc)
-    * @see org.jboss.bootstrap.AbstractServerImpl#doStart(org.jboss.util.StopWatch)
-    */
-   @Override
-   protected void doStart(StopWatch watch) throws Throwable
-   {
-    
-   }
-
-   //--------------------------------------------------------------------||
-   // Overridden Implementations ----------------------------------------||
-   //--------------------------------------------------------------------||
-
-   /**
-    * Initialization scheme which does nothing aside set the ServerConfig
-    */
-   @Override
-   public void init(Properties props) throws IllegalStateException, Exception
-   {
-      this.setConfig(ServerConfigUtil.getConfig(props));
-   }
-
-}

Modified: projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot5/unit/CleanShutdownOnIncompleteInitTestCase.java
===================================================================
--- projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot5/unit/CleanShutdownOnIncompleteInitTestCase.java	2009-02-25 02:37:50 UTC (rev 84692)
+++ projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot5/unit/CleanShutdownOnIncompleteInitTestCase.java	2009-02-25 02:43:20 UTC (rev 84693)
@@ -25,8 +25,8 @@
 
 import junit.framework.TestCase;
 
+import org.jboss.bootstrap.NoInitServerImpl;
 import org.jboss.bootstrap.spi.Server;
-import org.jboss.bootstrap.test.jboot5.NoInitServerImpl;
 import org.junit.Test;
 
 /**
@@ -39,7 +39,7 @@
  * JBBOOT-5
  *
  * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 public class CleanShutdownOnIncompleteInitTestCase
 {




More information about the jboss-cvs-commits mailing list