use of org.jboss.as.test.integration.jca.beanvalidation.ra.ValidMessageEndpointFactory in project wildfly by wildfly.
the class NegativeValidationASTestCase method testRegistryConfiguration.
@Test(expected = Exception.class)
public void testRegistryConfiguration() throws Throwable {
ServiceController<?> controller = serviceContainer.getService(ConnectorServices.RA_REPOSITORY_SERVICE);
assertNotNull(controller);
ResourceAdapterRepository repository = (ResourceAdapterRepository) controller.getValue();
assertNotNull(repository);
Set<String> ids = repository.getResourceAdapters(javax.jms.MessageListener.class);
assertNotNull(ids);
//assertEquals(1, ids.size());
String piId = ids.iterator().next();
assertNotNull(piId);
Endpoint endpoint = repository.getEndpoint(piId);
assertNotNull(endpoint);
List<MessageListener> listeners = repository.getMessageListeners(piId);
assertNotNull(listeners);
assertEquals(1, listeners.size());
MessageListener listener = listeners.get(0);
ActivationSpec as = listener.getActivation().createInstance();
assertNotNull(as);
assertNotNull(as.getResourceAdapter());
ValidActivationSpec vas = (ValidActivationSpec) as;
ValidMessageEndpoint me = new ValidMessageEndpoint();
ValidMessageEndpointFactory mef = new ValidMessageEndpointFactory(me);
endpoint.activate(mef, vas);
endpoint.deactivate(mef, vas);
}
use of org.jboss.as.test.integration.jca.beanvalidation.ra.ValidMessageEndpointFactory in project wildfly by wildfly.
the class PositiveValidationTestCase method testRegistryConfiguration.
@Test
public void testRegistryConfiguration() throws Throwable {
ServiceController<?> controller = serviceContainer.getService(ConnectorServices.RA_REPOSITORY_SERVICE);
assertNotNull(controller);
ResourceAdapterRepository repository = (ResourceAdapterRepository) controller.getValue();
assertNotNull(repository);
Set<String> ids = repository.getResourceAdapters(javax.jms.MessageListener.class);
assertNotNull(ids);
String piId = ids.iterator().next();
assertNotNull(piId);
Endpoint endpoint = repository.getEndpoint(piId);
assertNotNull(endpoint);
List<MessageListener> listeners = repository.getMessageListeners(piId);
assertNotNull(listeners);
assertEquals(1, listeners.size());
MessageListener listener = listeners.get(0);
ActivationSpec as = listener.getActivation().createInstance();
assertNotNull(as);
assertNotNull(as.getResourceAdapter());
ValidActivationSpec vas = (ValidActivationSpec) as;
ValidMessageEndpoint me = new ValidMessageEndpoint();
ValidMessageEndpointFactory mef = new ValidMessageEndpointFactory(me);
endpoint.activate(mef, vas);
endpoint.deactivate(mef, vas);
}
Aggregations