/*
* TextFilterTest.java
* JUnit based test
*
* Created on 31. August 2003, 22:48
*/
package org.jzonic.jlo.filter;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author Administrator
*/
public class TextFilterTest extends TestCase {
public TextFilterTest(java.lang.String testName) {
super(testName);
}
public static void main(java.lang.String[] args) {
junit.textui.TestRunner.run(suite());
}
public static Test suite() {
TestSuite suite = new TestSuite(TextFilterTest.class);
return suite;
}
public void testFilter() {
LogFilter textFilter = new TextFilter();
Map params = new HashMap();
params.put("expression","exception");
textFilter.setParameters(params);
String text = "This is an exception";
boolean match = textFilter.match(text);
assertEquals(true, match);
text = "no word matches";
match = textFilter.match(text);
assertEquals(false, match);
text = "no EXCEption matches";
match = textFilter.match(text);
assertEquals(true, match);
}
}