[slf4j-dev] svn commit: r516 - in slf4j/trunk/tests: . src/java/org/slf4j

ceki at slf4j.org ceki at slf4j.org
Mon Jan 23 17:51:35 CET 2006


Author: ceki
Date: Mon Jan 23 17:51:34 2006
New Revision: 516

Added:
   slf4j/trunk/tests/src/java/org/slf4j/AllRegularTest.java
   slf4j/trunk/tests/src/java/org/slf4j/BasicMarkerTest.java
      - copied, changed from r439, slf4j/trunk/tests/src/java/org/slf4j/MarkerTest.java
Removed:
   slf4j/trunk/tests/src/java/org/slf4j/MarkerTest.java
Modified:
   slf4j/trunk/tests/build.xml
Log:

minor rearrangement of tests

Modified: slf4j/trunk/tests/build.xml
==============================================================================
--- slf4j/trunk/tests/build.xml	(original)
+++ slf4j/trunk/tests/build.xml	Mon Jan 23 17:51:34 2006
@@ -133,8 +133,8 @@
 	<!-- ================================================================= -->
 	<target name="all" depends="regression" />
 
-	<target name="regression" depends="MessageFormatter,
-                                     InvokeNOP,
+	<target name="regression" depends="AllRegular,
+		                             InvokeNOP,
                                      InvokeSimple,
 		                             InvokeJDK14,
 		                             InvokeJCL,
@@ -145,11 +145,11 @@
   	                                 InvokeJCLWithSimple,
   	                                 InvokeJCLWithNOP" />
 
-	<target name="MessageFormatter" depends="build, cleanOutputDir">
+	<target name="AllRegular" depends="build, cleanOutputDir">
 		<junit printsummary="yes" fork="yes" haltonfailure="yes">
 			<classpath refid="compile.classpath" />
 			<formatter type="plain" usefile="false" />
-			<test name="org.slf4j.impl.MessageFormatterTest" />
+			<test name="org.slf4j.AllRegularTest" />
 		</junit>
 	</target>
 

Added: slf4j/trunk/tests/src/java/org/slf4j/AllRegularTest.java
==============================================================================
--- (empty file)
+++ slf4j/trunk/tests/src/java/org/slf4j/AllRegularTest.java	Mon Jan 23 17:51:34 2006
@@ -0,0 +1,20 @@
+// TOTO
+
+package org.slf4j;
+
+import org.slf4j.impl.MessageFormatterTest;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class AllRegularTest extends TestCase {
+
+  public static Test suite() {
+    TestSuite suite = new TestSuite();
+    suite.addTestSuite(MessageFormatterTest.class);
+    suite.addTestSuite(BasicMarkerTest.class);
+    return suite;
+  }
+
+}

Copied: slf4j/trunk/tests/src/java/org/slf4j/BasicMarkerTest.java (from r439, slf4j/trunk/tests/src/java/org/slf4j/MarkerTest.java)
==============================================================================
--- slf4j/trunk/tests/src/java/org/slf4j/MarkerTest.java	(original)
+++ slf4j/trunk/tests/src/java/org/slf4j/BasicMarkerTest.java	Mon Jan 23 17:51:34 2006
@@ -34,29 +34,61 @@
 
 import junit.framework.TestCase;
 
+import org.slf4j.impl.BasicMarkerFactory;
+
 
 /**
  * @author ceki
  */
-public class MarkerTest extends TestCase {
-  static final String BLUE = "BLUE";
-  static final String COMP = "COMP";
-
+public class BasicMarkerTest extends TestCase {
+  static final String BLUE_STR = "BLUE";
+  static final String RED_STR = "RED";
+  static final String GREEN_STR = "GREEN";
+  static final String COMP_STR = "COMP";
+  static final String MULTI_COMP_STR = "MULTI_COMP";
+  
+  final Marker blue;
+  final Marker red;
+  final Marker green;
+  final Marker comp;
+  final Marker multiComp;
+  
+  public BasicMarkerTest() {
+    IMarkerFactory factory = new BasicMarkerFactory();
+    
+    blue = factory.getMarker(BLUE_STR);
+    red = factory.getMarker(RED_STR);
+    green = factory.getMarker(GREEN_STR);
+    comp = factory.getMarker(COMP_STR);
+    comp.add(blue);
+    
+    multiComp = factory.getMarker(MULTI_COMP_STR);
+    multiComp.add(green);
+    multiComp.add(comp);
+    
+  }
   public void testPrimitive() {
-    Marker blue = MarkerFactory.getMarker(BLUE);
-    assertEquals(BLUE, blue.getName());
-
-    //assertTrue(blue.isImmutable());
-    assertEquals("BLUE", blue.getName());
+    assertEquals(BLUE_STR, blue.getName());
+    assertTrue(blue.contains(blue));
     
-
-    Marker blue2 = MarkerFactory.getMarker(BLUE);
+    Marker blue2 = MarkerFactory.getMarker(BLUE_STR);
+    assertEquals(BLUE_STR, blue2.getName());
     assertEquals(blue, blue2);
-    //blue.add(blue2);
+    assertTrue(blue.contains(blue2));
+    assertTrue(blue2.contains(blue));
   }
 
-  public void testStar() {
-    Marker blue = MarkerFactory.getMarker(BLUE);
-    assertEquals(BLUE, blue.getName());
+  public void testComposite() {
+    comp.add(blue);
+    assertTrue(comp.contains(comp));
+    assertTrue(comp.contains(blue));
   }
+
+  public void testMultiComposite() {
+    assertTrue(multiComp.contains(comp));
+    assertTrue(multiComp.contains(blue));
+    assertTrue(multiComp.contains(green));
+    assertFalse(multiComp.contains(red));
+  }
+
 }



More information about the slf4j-dev mailing list