KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jzonic > jlo > TargetTest


1 /*
2  * TargetTest.java
3  * JUnit based test
4  *
5  * Created on 19. Januar 2003, 18:31
6  */

7
8 package org.jzonic.jlo;
9
10 import junit.framework.Test;
11 import junit.framework.TestCase;
12 import junit.framework.TestSuite;
13
14 /**
15  *
16  * @author Administrator
17  */

18 public class TargetTest extends TestCase {
19     
20     public TargetTest(java.lang.String JavaDoc testName) {
21         super(testName);
22     }
23     
24     public static void main(java.lang.String JavaDoc[] args) {
25         junit.textui.TestRunner.run(suite());
26     }
27     
28     public static Test suite() {
29         TestSuite suite = new TestSuite(TargetTest.class);
30         return suite;
31     }
32     
33     public void testParseLine() {
34         int value = Target.parse("ALL,INFO,!DEBUG");
35         assertEquals(251,value);
36         value = Target.parse("ALL");
37         assertEquals(255,value);
38         value = Target.parse("INFO");
39         assertEquals(2,value);
40         value = Target.parse("INFO,!DEBUG");
41         assertEquals(2,value);
42         value = Target.parse("OFF");
43         assertEquals(0,value);
44         value = Target.parse("OFF,INFO");
45         assertEquals(0,value);
46     }
47     
48     
49 }
50
Popular Tags