use of org.opennms.core.soa.support.MyProvider in project opennms by OpenNMS.
the class NamespaceHandlerTest method testRegistrationListenerBeanDefinition.
@Test
@DirtiesContext
public void testRegistrationListenerBeanDefinition() {
assertNotNull(m_helloListListener);
MyProvider myProvider = new MyProvider();
int expected = m_helloListListener.getTotalProviders() + 1;
Registration registration = m_defaultServiceRegistry.register(myProvider, Hello.class);
assertEquals(expected, m_helloListListener.getTotalProviders());
expected = m_helloListListener.getTotalProviders() - 1;
registration.unregister();
assertEquals(expected, m_helloListListener.getTotalProviders());
}
use of org.opennms.core.soa.support.MyProvider in project opennms by OpenNMS.
the class NamespaceHandlerTest method testFilteredReferenceListBeanDefinition.
@Test
@DirtiesContext
public void testFilteredReferenceListBeanDefinition() {
assertNotNull(m_bigGoodbyeList);
int expected = m_bigGoodbyeList.size() + 1;
Map<String, String> bigProps = new HashMap<String, String>();
bigProps.put("size", "big");
Registration bigRegistration = m_defaultServiceRegistry.register(new MyProvider("alsoBig"), bigProps, Goodbye.class);
Map<String, String> props = new HashMap<String, String>();
props.put("size", "small");
Registration smallRegistration = m_defaultServiceRegistry.register(new MyProvider("alsoSmall"), props, Goodbye.class);
assertEquals(expected, m_bigGoodbyeList.size());
expected = m_bigGoodbyeList.size() - 1;
bigRegistration.unregister();
smallRegistration.unregister();
assertEquals(expected, m_bigGoodbyeList.size());
}
use of org.opennms.core.soa.support.MyProvider in project opennms by OpenNMS.
the class NamespaceHandlerTest method testReferenceListBeanDefinition.
@Test
@DirtiesContext
public void testReferenceListBeanDefinition() {
assertNotNull(m_helloList);
int expected = m_helloList.size() + 1;
Registration registration = m_defaultServiceRegistry.register(new MyProvider(), Hello.class);
assertEquals(expected, m_helloList.size());
expected = m_helloList.size() - 1;
registration.unregister();
assertEquals(expected, m_helloList.size());
}
Aggregations