Search in sources :

Example 1 with RegexEventFilter

use of org.xwiki.observation.event.filter.RegexEventFilter in project xwiki-platform by xwiki.

the class DocumentEventTest method testMatchesWithRegexFilter.

@Test
public void testMatchesWithRegexFilter() {
    DocumentSaveEvent event = new DocumentSaveEvent(new RegexEventFilter(".*Doc.*"));
    Assert.assertTrue(event.matches(new DocumentSaveEvent("some.Document")));
    Assert.assertFalse(event.matches(new DocumentSaveEvent("some.document")));
}
Also used : RegexEventFilter(org.xwiki.observation.event.filter.RegexEventFilter) DocumentSaveEvent(org.xwiki.observation.event.DocumentSaveEvent) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DocumentSaveEvent (org.xwiki.observation.event.DocumentSaveEvent)1 RegexEventFilter (org.xwiki.observation.event.filter.RegexEventFilter)1