Author: shane.bryzak(a)jboss.com
Date: 2009-10-08 01:27:34 -0400 (Thu, 08 Oct 2009)
New Revision: 3891
Added:
ri/trunk/logging/src/test/java/org/jboss/weld/
ri/trunk/logging/src/test/java/org/jboss/weld/test/
ri/trunk/logging/src/test/java/org/jboss/weld/test/log/
ri/trunk/logging/src/test/java/org/jboss/weld/test/log/LoggingTest.java
Removed:
ri/trunk/logging/src/test/java/org/jboss/webbeans/
ri/trunk/logging/src/test/java/org/jboss/weld/test/log/LoggingTest.java
Modified:
ri/trunk/logging/src/test/java/org/jboss/weld/test/log/TestAppender.java
Log:
refactored test packages
Copied: ri/trunk/logging/src/test/java/org/jboss/weld/test/log (from rev 3872,
ri/trunk/logging/src/test/java/org/jboss/webbeans/test/log)
Deleted: ri/trunk/logging/src/test/java/org/jboss/weld/test/log/LoggingTest.java
===================================================================
--- ri/trunk/logging/src/test/java/org/jboss/webbeans/test/log/LoggingTest.java 2009-10-07
21:43:49 UTC (rev 3872)
+++ ri/trunk/logging/src/test/java/org/jboss/weld/test/log/LoggingTest.java 2009-10-08
05:27:34 UTC (rev 3891)
@@ -1,86 +0,0 @@
-package org.jboss.webbeans.test.log;
-
-import org.jboss.webbeans.log.Log;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-import org.testng.annotations.Test;
-
-/**
- * Simple tests to verify proper operation of the logging system.
- *
- * @author David Allen
- *
- */
-public class LoggingTest
-{
- private static final String TEST_MSG = "Test Message";
-
- @Test
- public void testLogProvider()
- {
- LogProvider logProvider = Logging.getLogProvider(LoggingTest.class);
- assert logProvider != null;
- }
-
- @Test
- public void testLogBasedOnClassObject()
- {
- Log log = Logging.getLog(LoggingTest.class);
- assert log != null : "No Log object returned";
-
- log.info(TEST_MSG);
- assert TestAppender.getLastEvent() != null : "There was no last event in
Log4j";
- assert
TestAppender.getLastEvent().getLoggerName().equals("org.jboss.webbeans.test.log.LoggingTest");
- assert TestAppender.getLastEvent().getRenderedMessage().equals(TEST_MSG) :
"Last event has incorrect message";
- }
-
- @Test
- public void testLogBasedOnStringObject()
- {
- Log log = Logging.getLog("MyLogger");
- assert log != null;
-
- log.info(TEST_MSG);
- assert TestAppender.getLastEvent() != null : "There was no last event in
Log4j";
- assert TestAppender.getLastEvent().getLoggerName().equals("MyLogger");
- assert TestAppender.getLastEvent().getRenderedMessage().equals(TEST_MSG) :
"Last event has incorrect message";
- }
-
- @Test
- public void testLogMessageFormatting()
- {
- Log log = Logging.getLog(LoggingTest.class);
- assert log != null : "No Log object returned";
-
- log.info("Message with {0} parameters starting with {1} and including
{2}", 3, "param1", "param2");
- assert TestAppender.getLastEvent() != null : "There was no last event in
Log4j";
- assert TestAppender.getLastEvent().getRenderedMessage().equals("Message with 3
parameters starting with param1 and including param2");
- }
-
- @Test
- public void testLogMessageFormattingWithNullValue()
- {
- Log log = Logging.getLog(LoggingTest.class);
- assert log != null : "No Log object returned";
-
- String value = null;
- log.info("Verify we do not barf on a {0} value", value);
- assert TestAppender.getLastEvent() != null : "There was no last event in
Log4j";
- assert TestAppender.getLastEvent().getRenderedMessage().equals("Verify we do
not barf on a null value");
- }
-
- @Test
- public void testArrayConversion()
- {
- Log log = Logging.getLog(LoggingTest.class);
- assert log != null : "No Log object returned";
-
- String[] arr = new String[2];
- arr[0] = "foo";
- arr[1] = "bar";
-
- log.info("Message with {0} array {1}", arr, "baz");
- assert TestAppender.getLastEvent() != null : "There was no last event in
Log4j";
- assert TestAppender.getLastEvent().getRenderedMessage().equals("Message with
[foo, bar] array baz");
- }
-}
Copied: ri/trunk/logging/src/test/java/org/jboss/weld/test/log/LoggingTest.java (from rev
3877, ri/trunk/logging/src/test/java/org/jboss/webbeans/test/log/LoggingTest.java)
===================================================================
--- ri/trunk/logging/src/test/java/org/jboss/weld/test/log/LoggingTest.java
(rev 0)
+++ ri/trunk/logging/src/test/java/org/jboss/weld/test/log/LoggingTest.java 2009-10-08
05:27:34 UTC (rev 3891)
@@ -0,0 +1,86 @@
+package org.jboss.weld.test.log;
+
+import org.jboss.weld.log.Log;
+import org.jboss.weld.log.LogProvider;
+import org.jboss.weld.log.Logging;
+import org.testng.annotations.Test;
+
+/**
+ * Simple tests to verify proper operation of the logging system.
+ *
+ * @author David Allen
+ *
+ */
+public class LoggingTest
+{
+ private static final String TEST_MSG = "Test Message";
+
+ @Test
+ public void testLogProvider()
+ {
+ LogProvider logProvider = Logging.getLogProvider(LoggingTest.class);
+ assert logProvider != null;
+ }
+
+ @Test
+ public void testLogBasedOnClassObject()
+ {
+ Log log = Logging.getLog(LoggingTest.class);
+ assert log != null : "No Log object returned";
+
+ log.info(TEST_MSG);
+ assert TestAppender.getLastEvent() != null : "There was no last event in
Log4j";
+ assert
TestAppender.getLastEvent().getLoggerName().equals("org.jboss.webbeans.test.log.LoggingTest");
+ assert TestAppender.getLastEvent().getRenderedMessage().equals(TEST_MSG) :
"Last event has incorrect message";
+ }
+
+ @Test
+ public void testLogBasedOnStringObject()
+ {
+ Log log = Logging.getLog("MyLogger");
+ assert log != null;
+
+ log.info(TEST_MSG);
+ assert TestAppender.getLastEvent() != null : "There was no last event in
Log4j";
+ assert TestAppender.getLastEvent().getLoggerName().equals("MyLogger");
+ assert TestAppender.getLastEvent().getRenderedMessage().equals(TEST_MSG) :
"Last event has incorrect message";
+ }
+
+ @Test
+ public void testLogMessageFormatting()
+ {
+ Log log = Logging.getLog(LoggingTest.class);
+ assert log != null : "No Log object returned";
+
+ log.info("Message with {0} parameters starting with {1} and including
{2}", 3, "param1", "param2");
+ assert TestAppender.getLastEvent() != null : "There was no last event in
Log4j";
+ assert TestAppender.getLastEvent().getRenderedMessage().equals("Message with 3
parameters starting with param1 and including param2");
+ }
+
+ @Test
+ public void testLogMessageFormattingWithNullValue()
+ {
+ Log log = Logging.getLog(LoggingTest.class);
+ assert log != null : "No Log object returned";
+
+ String value = null;
+ log.info("Verify we do not barf on a {0} value", value);
+ assert TestAppender.getLastEvent() != null : "There was no last event in
Log4j";
+ assert TestAppender.getLastEvent().getRenderedMessage().equals("Verify we do
not barf on a null value");
+ }
+
+ @Test
+ public void testArrayConversion()
+ {
+ Log log = Logging.getLog(LoggingTest.class);
+ assert log != null : "No Log object returned";
+
+ String[] arr = new String[2];
+ arr[0] = "foo";
+ arr[1] = "bar";
+
+ log.info("Message with {0} array {1}", arr, "baz");
+ assert TestAppender.getLastEvent() != null : "There was no last event in
Log4j";
+ assert TestAppender.getLastEvent().getRenderedMessage().equals("Message with
[foo, bar] array baz");
+ }
+}
Modified: ri/trunk/logging/src/test/java/org/jboss/weld/test/log/TestAppender.java
===================================================================
---
ri/trunk/logging/src/test/java/org/jboss/webbeans/test/log/TestAppender.java 2009-10-07
21:43:49 UTC (rev 3872)
+++ ri/trunk/logging/src/test/java/org/jboss/weld/test/log/TestAppender.java 2009-10-08
05:27:34 UTC (rev 3891)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.log;
+package org.jboss.weld.test.log;
import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.varia.NullAppender;