Author: mircea.markus
Date: 2009-02-17 14:45:21 -0500 (Tue, 17 Feb 2009)
New Revision: 7716
Modified:
core/branches/flat/src/test/java/org/horizon/test/testng/SuiteResourcesAndLogTest.java
Log:
also log to file
Modified:
core/branches/flat/src/test/java/org/horizon/test/testng/SuiteResourcesAndLogTest.java
===================================================================
---
core/branches/flat/src/test/java/org/horizon/test/testng/SuiteResourcesAndLogTest.java 2009-02-17
19:21:34 UTC (rev 7715)
+++
core/branches/flat/src/test/java/org/horizon/test/testng/SuiteResourcesAndLogTest.java 2009-02-17
19:45:21 UTC (rev 7716)
@@ -1,5 +1,7 @@
package org.horizon.test.testng;
+import org.horizon.logging.Log;
+import org.horizon.logging.LogFactory;
import org.horizon.test.TestingUtil;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
@@ -14,41 +16,48 @@
*/
@Test(groups = "functional", testName =
"test.testng.SuiteResourcesAndLogTest")
public class SuiteResourcesAndLogTest {
+
+ private static Log log = LogFactory.getLog(SuiteResourcesAndLogTest.class);
@BeforeSuite
@AfterSuite
public void removeTempDir() {
TestingUtil.recursiveFileRemove(TestingUtil.TEST_FILES);
- System.out.println("Removing all the files from " +
TestingUtil.TEST_FILES);
+ log("Removing all the files from " + TestingUtil.TEST_FILES);
File file = new File(TestingUtil.TEST_FILES);
if (file.exists()) {
System.err.println("!!!!!!!!!!!!! Directory '" +
TestingUtil.TEST_FILES + "' should have been deleted!!!");
} else {
- System.out.println("Successfully removed folder: '" +
TestingUtil.TEST_FILES + "'");
+ log("Successfully removed folder: '" + TestingUtil.TEST_FILES +
"'");
}
}
@BeforeSuite
@AfterSuite
public void printEnvInformation() {
- System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~ ENVIRONMENT INFO
~~~~~~~~~~~~~~~~~~~~~~~~~~");
+ log("~~~~~~~~~~~~~~~~~~~~~~~~~ ENVIRONMENT INFO
~~~~~~~~~~~~~~~~~~~~~~~~~~");
String bindAddress = System.getProperty("bind.address");
- System.out.println("bind.address = " + bindAddress);
+ log("bind.address = " + bindAddress);
// //todo for some funny reasons MVN ignores bind.address passed in. This is a
hack..
// if (bindAddress == null)
// {
-// System.out.println("Setting bind.address to 127.0.0.1 as it is
missing!!!");
+// log("Setting bind.address to 127.0.0.1 as it is missing!!!");
// System.setProperty("bind.address","127.0.0.1");
// }
- System.out.println("java.runtime.version = " +
System.getProperty("java.runtime.version"));
- System.out.println("java.runtime.name =" +
System.getProperty("java.runtime.name"));
- System.out.println("java.vm.version = " +
System.getProperty("java.vm.version"));
- System.out.println("java.vm.vendor = " +
System.getProperty("java.vm.vendor"));
- System.out.println("os.name = " +
System.getProperty("os.name"));
- System.out.println("os.version = " +
System.getProperty("os.version"));
- System.out.println("sun.arch.data.model = " +
System.getProperty("sun.arch.data.model"));
- System.out.println("sun.cpu.endian = " +
System.getProperty("sun.cpu.endian"));
- System.out.println("jgroups.stack = " +
System.getProperty("jgroups.stack"));
- System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~ ENVIRONMENT INFO
~~~~~~~~~~~~~~~~~~~~~~~~~~");
+ log("java.runtime.version = " +
System.getProperty("java.runtime.version"));
+ log("java.runtime.name =" +
System.getProperty("java.runtime.name"));
+ log("java.vm.version = " +
System.getProperty("java.vm.version"));
+ log("java.vm.vendor = " +
System.getProperty("java.vm.vendor"));
+ log("os.name = " + System.getProperty("os.name"));
+ log("os.version = " + System.getProperty("os.version"));
+ log("sun.arch.data.model = " +
System.getProperty("sun.arch.data.model"));
+ log("sun.cpu.endian = " +
System.getProperty("sun.cpu.endian"));
+ log("jgroups.stack = " + System.getProperty("jgroups.stack"));
+ log("~~~~~~~~~~~~~~~~~~~~~~~~~ ENVIRONMENT INFO
~~~~~~~~~~~~~~~~~~~~~~~~~~");
}
+
+ private void log(String s) {
+ System.out.println(s);
+ log.info(s);
+ }
}
Show replies by date