EventSubscription { public boolean matches(final String eventType) { return eventType.startsWith(type); } EventSubscription(final String eventType,
            final EventSubscriber eventSubscriber); String getType(); boolean matches(final String eventType); EventSubscriber getSubscriber(); void publish(final JVoiceXMLEvent event); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void testMatches() { final String type = "test.dummy.event"; final EventSubscriber subscriber = new MockEventSubscriber(); final EventSubscription subscription = new EventSubscription(type, subscriber); Assert.assertTrue(subscription.matches(type)); }
@Test public void testMatchesWrongType() { final String type = "test.dummy.event"; final EventSubscriber subscriber = new MockEventSubscriber(); final EventSubscription subscription = new EventSubscription(type, subscriber); Assert.assertFalse(subscription.matches("wrong.event.type")); }
@Test public void testMatchesPrefix() { final String type = "test.dummy"; final EventSubscriber subscriber = new MockEventSubscriber(); final EventSubscription subscription = new EventSubscription(type, subscriber); Assert.assertTrue(subscription.matches("test.dummy.event")); }
@Test public void testMatchesAll() { final String type = ""; final EventSubscriber subscriber = new MockEventSubscriber(); final EventSubscription subscription = new EventSubscription(type, subscriber); Assert.assertTrue(subscription.matches("test.dummy.event")); }