*/
public class TestExtractors {
@Test
public void testRegexExtractor() throws IOException, InterruptedException {
MemorySinkSource mem = new MemorySinkSource();
mem.open();
RegexExtractor re1 = new RegexExtractor(mem, "(\\d:\\d)", 1, "colon");
RegexExtractor re2 = new RegexExtractor(re1, "(.+)oo(.+)", 1, "oo");
RegexExtractor re3 = new RegexExtractor(re2, "(.+)oo(.+)", 0, "full");
RegexExtractor re4 = new RegexExtractor(re3, "(blah)blabh", 3, "empty");
RegexExtractor re = new RegexExtractor(re4, "(.+)oo(.+)", 3, "outofrange");
re.open();
re.append(new EventImpl("1:2:3.4foobar5".getBytes()));
re.close();
mem.close();
mem.open();
Event e1 = mem.next();
assertEquals("1:2", Attributes.readString(e1, "colon"));
assertEquals("1:2:3.4f", Attributes.readString(e1, "oo"));
assertEquals("1:2:3.4foobar5", Attributes.readString(e1, "full"));
assertEquals("", Attributes.readString(e1, "empty"));
assertEquals("", Attributes.readString(e1, "outofrange"));