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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Feb 25 14:55:56 EST 2009


Author: ALRubinger
Date: 2009-02-25 14:55:56 -0500 (Wed, 25 Feb 2009)
New Revision: 84762

Added:
   projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot11/
   projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot11/unit/
   projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot11/unit/FilePropertiesTestCase.java
   projects/bootstrap/trunk/src/test/resources/jbossas/
Modified:
   projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot5/unit/CleanShutdownOnIncompleteInitTestCase.java
Log:
[JBBOOT-11] Get a proper test case for making a File from jboss.server.data.dir

Added: projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot11/unit/FilePropertiesTestCase.java
===================================================================
--- projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot11/unit/FilePropertiesTestCase.java	                        (rev 0)
+++ projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot11/unit/FilePropertiesTestCase.java	2009-02-25 19:55:56 UTC (rev 84762)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jboot11.unit;
+
+import java.io.File;
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+import org.jboss.bootstrap.microcontainer.ServerImpl;
+import org.jboss.bootstrap.spi.Server;
+import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.test.common.ServerConfigUtil;
+import org.jboss.logging.Logger;
+import org.junit.Test;
+
+/**
+ * FilePropertiesTestCase
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class FilePropertiesTestCase
+{
+
+   private static final Logger log = Logger.getLogger(FilePropertiesTestCase.class);
+
+   @Test
+   public void testFileFromServerDataDirProperty() throws Exception
+   {
+
+      // Create properties (and JBOSS_HOME)
+      Properties props = new Properties();
+      props.put(ServerConfig.HOME_DIR, ServerConfigUtil.getJBossHomeFromCurrentLocation("jbossas").toURL()
+            .toExternalForm());
+
+      // Create and perform minimal initialization upon a new server
+      Server server = new ServerImpl();
+      server.init(props);
+
+      // Attempt to create a file from the System Property for jboss.server.data.dir
+      String serverDataDirPropName = ServerConfig.SERVER_DATA_DIR;
+      String serverDataDirString = System.getProperty(serverDataDirPropName);
+      log.info(serverDataDirPropName + " is: " + serverDataDirString);
+
+      File serverDataDir = new File(serverDataDirString);
+      TestCase.assertTrue("Server data dir does not exist: " + serverDataDir.getAbsolutePath(), serverDataDir.exists());
+
+   }
+
+}

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 19:50:38 UTC (rev 84761)
+++ projects/bootstrap/trunk/src/test/java/org/jboss/bootstrap/test/jboot5/unit/CleanShutdownOnIncompleteInitTestCase.java	2009-02-25 19:55:56 UTC (rev 84762)
@@ -23,8 +23,6 @@
 
 import java.util.Properties;
 
-import junit.framework.TestCase;
-
 import org.jboss.bootstrap.NoInitServerImpl;
 import org.jboss.bootstrap.spi.Server;
 import org.junit.Test;

Copied: projects/bootstrap/trunk/src/test/resources/jbossas (from rev 84172, projects/embedded/trunk/assembly/src/main/resources/embedded)




More information about the jboss-cvs-commits mailing list