use of loghub.processors.Identity in project LogHub by fbacchella.
the class TestConfigurations method testBadFields3.
// Ensure that multi-fields processor don't access a success sub-pipeline
@Test
public void testBadFields3() {
SyslogPriority processor = new SyslogPriority();
processor.setException(new Identity());
processor.setFields(new String[] { "a", "b" });
Assert.assertFalse(processor.configure(new Properties(Collections.emptyMap())));
}
use of loghub.processors.Identity in project LogHub by fbacchella.
the class TestConfigurations method testBadFields2.
// Ensure that multi-fields processor don't access a success sub-pipeline
@Test
public void testBadFields2() {
SyslogPriority processor = new SyslogPriority();
processor.setFailure(new Identity());
processor.setFields(new String[] { "a", "b" });
Assert.assertFalse(processor.configure(new Properties(Collections.emptyMap())));
}
use of loghub.processors.Identity in project LogHub by fbacchella.
the class TestConfigurations method testBadFields1.
// Ensure that multi-fields processor don't access a success sub-pipeline
@Test
public void testBadFields1() {
SyslogPriority processor = new SyslogPriority();
processor.setSuccess(new Identity());
processor.setFields(new String[] { "a", "b" });
Assert.assertFalse(processor.configure(new Properties(Collections.emptyMap())));
}
use of loghub.processors.Identity in project LogHub by fbacchella.
the class TestProcessor method testIf.
@Test
public void testIf() throws ProcessorException {
Event e = new EventInstance(ConnectionContext.EMPTY);
Processor p = new Identity();
p.setIf("true");
p.configure(new Properties(Collections.emptyMap()));
Assert.assertTrue(p.isprocessNeeded(e));
p.setIf("false");
p.configure(new Properties(Collections.emptyMap()));
Assert.assertFalse(p.isprocessNeeded(e));
p.setIf("0");
p.configure(new Properties(Collections.emptyMap()));
Assert.assertFalse(p.isprocessNeeded(e));
p.setIf("1");
p.configure(new Properties(Collections.emptyMap()));
Assert.assertTrue(p.isprocessNeeded(e));
p.setIf("0.1");
p.configure(new Properties(Collections.emptyMap()));
Assert.assertTrue(p.isprocessNeeded(e));
p.setIf("\"bob\"");
p.configure(new Properties(Collections.emptyMap()));
Assert.assertTrue(p.isprocessNeeded(e));
p.setIf("\"\"");
p.configure(new Properties(Collections.emptyMap()));
Assert.assertFalse(p.isprocessNeeded(e));
}
Aggregations