[slf4j-dev] svn commit: r109 - in slf4j/branches/marker-experiment/tests/src/java/org/slf4j: . impl

ceki at slf4j.org ceki at slf4j.org
Mon Jul 4 21:30:19 CEST 2005


Author: ceki
Date: Mon Jul  4 21:30:17 2005
New Revision: 109

Added:
   slf4j/branches/marker-experiment/tests/src/java/org/slf4j/MarkerTest.java
Modified:
   slf4j/branches/marker-experiment/tests/src/java/org/slf4j/SimpleLoggerFAFactory.java
   slf4j/branches/marker-experiment/tests/src/java/org/slf4j/XLoggerFAFactory.java
   slf4j/branches/marker-experiment/tests/src/java/org/slf4j/impl/XLoggerFA.java
Log:

Updates to tests/



Added: slf4j/branches/marker-experiment/tests/src/java/org/slf4j/MarkerTest.java
==============================================================================
--- (empty file)
+++ slf4j/branches/marker-experiment/tests/src/java/org/slf4j/MarkerTest.java	Mon Jul  4 21:30:17 2005
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2004-2005 SLF4J.ORG
+ * Copyright (c) 2004-2005 QOS.ch
+ *
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to  deal in  the Software without  restriction, including
+ * without limitation  the rights to  use, copy, modify,  merge, publish,
+ * distribute, and/or sell copies of  the Software, and to permit persons
+ * to whom  the Software is furnished  to do so, provided  that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the  Software and  that both  the above  copyright notice(s)  and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+ * EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR  A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF  THIRD PARTY  RIGHTS. IN  NO EVENT  SHALL THE  COPYRIGHT  HOLDER OR
+ * HOLDERS  INCLUDED IN  THIS  NOTICE BE  LIABLE  FOR ANY  CLAIM, OR  ANY
+ * SPECIAL INDIRECT  OR CONSEQUENTIAL DAMAGES, OR  ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS  OF USE, DATA OR PROFITS, WHETHER  IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE  OR OTHER TORTIOUS  ACTION, ARISING OUT OF  OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as  contained in  this notice, the  name of a  copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ *
+ */
+package org.slf4j;
+
+import junit.framework.TestCase;
+
+
+/**
+ * @author ceki
+ */
+public class MarkerTest extends TestCase {
+  static final String BLUE = "BLUE";
+  static final String COMP = "COMP";
+
+  public void testPrimitive() {
+    Marker blue = Marker.getMarker(BLUE);
+    assertEquals(BLUE, blue.getName());
+
+    //assertTrue(blue.isImmutable());
+    assertTrue(blue.matches(blue));
+    assertTrue(blue.matches(BLUE));
+
+    Marker blue2 = Marker.getMarker(BLUE);
+    assertEquals(blue, blue2);
+    //blue.add(blue2);
+  }
+
+  public void testStar() {
+    Marker blue = Marker.getMarker(BLUE);
+    assertEquals(BLUE, blue.getName());
+    Marker star = Marker.getMarker("*");
+
+    //assertTrue(blue.isImmutable());
+    assertTrue(blue.matches("*"));
+    assertTrue(blue.matches(star));
+
+    assertTrue(star.matches("asdasd"));
+    assertTrue(star.matches(star));
+
+    assertTrue(star.matches(blue));
+  }
+}

Modified: slf4j/branches/marker-experiment/tests/src/java/org/slf4j/SimpleLoggerFAFactory.java
==============================================================================
--- slf4j/branches/marker-experiment/tests/src/java/org/slf4j/SimpleLoggerFAFactory.java	(original)
+++ slf4j/branches/marker-experiment/tests/src/java/org/slf4j/SimpleLoggerFAFactory.java	Mon Jul  4 21:30:17 2005
@@ -31,11 +31,12 @@
  */
 package org.slf4j;
 
-import org.slf4j.impl.SimpleLoggerFA;
+import org.slf4j.impl.SimpleLoggerAdapterFactory;
+import org.slf4j.spi.LoggerAdapterFactory;
 
 public class SimpleLoggerFAFactory {
 
 	public static LoggerAdapterFactory getInstance() {
-		return new SimpleLoggerFA();
+		return new SimpleLoggerAdapterFactory();
 	}
 }

Modified: slf4j/branches/marker-experiment/tests/src/java/org/slf4j/XLoggerFAFactory.java
==============================================================================
--- slf4j/branches/marker-experiment/tests/src/java/org/slf4j/XLoggerFAFactory.java	(original)
+++ slf4j/branches/marker-experiment/tests/src/java/org/slf4j/XLoggerFAFactory.java	Mon Jul  4 21:30:17 2005
@@ -33,6 +33,7 @@
 package org.slf4j;
 
 import org.slf4j.impl.XLoggerFA;
+import org.slf4j.spi.LoggerAdapterFactory;
 
 
 public class XLoggerFAFactory {

Modified: slf4j/branches/marker-experiment/tests/src/java/org/slf4j/impl/XLoggerFA.java
==============================================================================
--- slf4j/branches/marker-experiment/tests/src/java/org/slf4j/impl/XLoggerFA.java	(original)
+++ slf4j/branches/marker-experiment/tests/src/java/org/slf4j/impl/XLoggerFA.java	Mon Jul  4 21:30:17 2005
@@ -1,12 +1,12 @@
 
 package org.slf4j.impl;
 
-import org.slf4j.LoggerAdapterFactory;
 import org.slf4j.Logger;
+import org.slf4j.spi.LoggerAdapterFactory;
 
 
 /**
- * NOPLoggerFA is am implementation of {@link LoggerAdapterFactory}
+ * NOPLoggerAdapterFactory is am implementation of {@link LoggerAdapterFactory}
  * which always returns the unique instance of NOPLogger.
  * 
  * @author Ceki Gulcu



More information about the slf4j-dev mailing list