01: /*
02: * TargetTest.java
03: * JUnit based test
04: *
05: * Created on 19. Januar 2003, 18:31
06: */
07:
08: package org.jzonic.jlo;
09:
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 testName) {
21: super (testName);
22: }
23:
24: public static void main(java.lang.String[] 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: }
|