[weld-commits] Weld SVN: r6792 - in extensions/trunk/impl/src/test/java/org: slf4j/impl and 1 other directory.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Sat Jul 24 07:18:31 EDT 2010
Author: pete.muir at jboss.org
Date: 2010-07-24 07:18:31 -0400 (Sat, 24 Jul 2010)
New Revision: 6792
Added:
extensions/trunk/impl/src/test/java/org/slf4j/impl/LastMessageLogger.java
extensions/trunk/impl/src/test/java/org/slf4j/impl/LastMessageLoggerFactory.java
Removed:
extensions/trunk/impl/src/test/java/org/slf4j/impl/TestLogger.java
extensions/trunk/impl/src/test/java/org/slf4j/impl/TestLoggerFactory.java
Modified:
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/log/LoggerInjectionTest.java
extensions/trunk/impl/src/test/java/org/slf4j/impl/StaticLoggerBinder.java
Log:
avoid Test name to stop JUnit kicking in
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/log/LoggerInjectionTest.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/log/LoggerInjectionTest.java 2010-07-23 22:49:34 UTC (rev 6791)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/log/LoggerInjectionTest.java 2010-07-24 11:18:31 UTC (rev 6792)
@@ -28,7 +28,7 @@
import org.jboss.weld.extensions.log.Category;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.slf4j.impl.TestLoggerFactory;
+import org.slf4j.impl.LastMessageLoggerFactory;
/**
* All the tests related to the @Logger binding type and injection.
@@ -57,18 +57,18 @@
@Test
public void testBasicLogInjection()
{
- TestLoggerFactory.INSTANCE.getLogger("").reset();
+ LastMessageLoggerFactory.INSTANCE.getLogger("").reset();
sparrow.generateLogMessage();
- assert TestLoggerFactory.INSTANCE.getLogger("").getLastMessage() != null;
- assert TestLoggerFactory.INSTANCE.getLogger("").getLastMessage().equals("Sparrow");
+ assert LastMessageLoggerFactory.INSTANCE.getLogger("").getLastMessage() != null;
+ assert LastMessageLoggerFactory.INSTANCE.getLogger("").getLastMessage().equals("Sparrow");
}
@Test
public void testCategorySpecifiedLogger()
{
- TestLoggerFactory.INSTANCE.getLogger("").reset();
+ LastMessageLoggerFactory.INSTANCE.getLogger("").reset();
finch.generateLogMessage();
- assert TestLoggerFactory.INSTANCE.getLogger("").getLastMessage() != null;
- assert TestLoggerFactory.INSTANCE.getLogger("").getLastMessage().equals("Finch");
+ assert LastMessageLoggerFactory.INSTANCE.getLogger("").getLastMessage() != null;
+ assert LastMessageLoggerFactory.INSTANCE.getLogger("").getLastMessage().equals("Finch");
}
}
Copied: extensions/trunk/impl/src/test/java/org/slf4j/impl/LastMessageLogger.java (from rev 6781, extensions/trunk/impl/src/test/java/org/slf4j/impl/TestLogger.java)
===================================================================
--- extensions/trunk/impl/src/test/java/org/slf4j/impl/LastMessageLogger.java (rev 0)
+++ extensions/trunk/impl/src/test/java/org/slf4j/impl/LastMessageLogger.java 2010-07-24 11:18:31 UTC (rev 6792)
@@ -0,0 +1,220 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.slf4j.impl;
+
+import org.slf4j.helpers.MarkerIgnoringBase;
+
+/**
+ * A very limited test logger which records the last info message logged
+ */
+public class LastMessageLogger extends MarkerIgnoringBase
+{
+
+ private String lastMessage;
+
+ private static final long serialVersionUID = 8313525025872406710L;
+
+ public String getLastMessage()
+ {
+ return lastMessage;
+ }
+
+ public void reset()
+ {
+ this.lastMessage = null;
+ }
+
+ public void debug(String msg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void debug(String format, Object arg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void debug(String format, Object[] argArray)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void debug(String msg, Throwable t)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void debug(String format, Object arg1, Object arg2)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void error(String msg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void error(String format, Object arg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void error(String format, Object[] argArray)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void error(String msg, Throwable t)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void error(String format, Object arg1, Object arg2)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void info(String msg)
+ {
+ lastMessage = msg;
+ }
+
+ public void info(String format, Object arg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void info(String format, Object[] argArray)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void info(String msg, Throwable t)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void info(String format, Object arg1, Object arg2)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean isDebugEnabled()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isErrorEnabled()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isInfoEnabled()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isTraceEnabled()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isWarnEnabled()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void trace(String msg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void trace(String format, Object arg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void trace(String format, Object[] argArray)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void trace(String msg, Throwable t)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void trace(String format, Object arg1, Object arg2)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void warn(String msg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void warn(String format, Object arg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void warn(String format, Object[] argArray)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void warn(String msg, Throwable t)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void warn(String format, Object arg1, Object arg2)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Copied: extensions/trunk/impl/src/test/java/org/slf4j/impl/LastMessageLoggerFactory.java (from rev 6781, extensions/trunk/impl/src/test/java/org/slf4j/impl/TestLoggerFactory.java)
===================================================================
--- extensions/trunk/impl/src/test/java/org/slf4j/impl/LastMessageLoggerFactory.java (rev 0)
+++ extensions/trunk/impl/src/test/java/org/slf4j/impl/LastMessageLoggerFactory.java 2010-07-24 11:18:31 UTC (rev 6792)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.slf4j.impl;
+
+import org.slf4j.ILoggerFactory;
+
+public class LastMessageLoggerFactory implements ILoggerFactory
+{
+
+ public final static LastMessageLoggerFactory INSTANCE = new LastMessageLoggerFactory();
+
+ private final LastMessageLogger logger = new LastMessageLogger();
+
+ public LastMessageLogger getLogger(String name)
+ {
+ return logger;
+ }
+}
Modified: extensions/trunk/impl/src/test/java/org/slf4j/impl/StaticLoggerBinder.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/slf4j/impl/StaticLoggerBinder.java 2010-07-23 22:49:34 UTC (rev 6791)
+++ extensions/trunk/impl/src/test/java/org/slf4j/impl/StaticLoggerBinder.java 2010-07-24 11:18:31 UTC (rev 6792)
@@ -53,7 +53,7 @@
// to avoid constant folding by the compiler, this field must *not* be final
public static String REQUESTED_API_VERSION = "1.5.9.RC1"; // !final
- private static final String loggerFactoryClassStr = TestLoggerFactory.class.getName();
+ private static final String loggerFactoryClassStr = LastMessageLoggerFactory.class.getName();
/**
* The ILoggerFactory instance returned by the {@link #getLoggerFactory}
@@ -62,7 +62,7 @@
private final ILoggerFactory loggerFactory;
private StaticLoggerBinder() {
- loggerFactory = TestLoggerFactory.INSTANCE;
+ loggerFactory = LastMessageLoggerFactory.INSTANCE;
}
public ILoggerFactory getLoggerFactory() {
Deleted: extensions/trunk/impl/src/test/java/org/slf4j/impl/TestLogger.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/slf4j/impl/TestLogger.java 2010-07-23 22:49:34 UTC (rev 6791)
+++ extensions/trunk/impl/src/test/java/org/slf4j/impl/TestLogger.java 2010-07-24 11:18:31 UTC (rev 6792)
@@ -1,222 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.slf4j.impl;
-
-import org.junit.Ignore;
-import org.slf4j.helpers.MarkerIgnoringBase;
-
-/**
- * A very limited test logger which records the last info message logged
- */
- at Ignore
-public class TestLogger extends MarkerIgnoringBase
-{
-
- private String lastMessage;
-
- private static final long serialVersionUID = 8313525025872406710L;
-
- public String getLastMessage()
- {
- return lastMessage;
- }
-
- public void reset()
- {
- this.lastMessage = null;
- }
-
- public void debug(String msg)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void debug(String format, Object arg)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void debug(String format, Object[] argArray)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void debug(String msg, Throwable t)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void debug(String format, Object arg1, Object arg2)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void error(String msg)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void error(String format, Object arg)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void error(String format, Object[] argArray)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void error(String msg, Throwable t)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void error(String format, Object arg1, Object arg2)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void info(String msg)
- {
- lastMessage = msg;
- }
-
- public void info(String format, Object arg)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void info(String format, Object[] argArray)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void info(String msg, Throwable t)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void info(String format, Object arg1, Object arg2)
- {
- // TODO Auto-generated method stub
-
- }
-
- public boolean isDebugEnabled()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isErrorEnabled()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isInfoEnabled()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isTraceEnabled()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isWarnEnabled()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public void trace(String msg)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void trace(String format, Object arg)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void trace(String format, Object[] argArray)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void trace(String msg, Throwable t)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void trace(String format, Object arg1, Object arg2)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void warn(String msg)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void warn(String format, Object arg)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void warn(String format, Object[] argArray)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void warn(String msg, Throwable t)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void warn(String format, Object arg1, Object arg2)
- {
- // TODO Auto-generated method stub
-
- }
-
-}
Deleted: extensions/trunk/impl/src/test/java/org/slf4j/impl/TestLoggerFactory.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/slf4j/impl/TestLoggerFactory.java 2010-07-23 22:49:34 UTC (rev 6791)
+++ extensions/trunk/impl/src/test/java/org/slf4j/impl/TestLoggerFactory.java 2010-07-24 11:18:31 UTC (rev 6792)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.slf4j.impl;
-
-import org.junit.Ignore;
-import org.slf4j.ILoggerFactory;
-
- at Ignore
-public class TestLoggerFactory implements ILoggerFactory
-{
-
- public final static TestLoggerFactory INSTANCE = new TestLoggerFactory();
-
- private final TestLogger logger = new TestLogger();
-
- public TestLogger getLogger(String name)
- {
- return logger;
- }
-}
More information about the weld-commits
mailing list