Search in sources :

Example 6 with MessageListener

use of org.jboss.jca.core.spi.rar.MessageListener 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);
}
Also used : ValidActivationSpec(org.jboss.as.test.integration.jca.beanvalidation.ra.ValidActivationSpec) ValidMessageEndpoint(org.jboss.as.test.integration.jca.beanvalidation.ra.ValidMessageEndpoint) Endpoint(org.jboss.jca.core.spi.rar.Endpoint) ValidActivationSpec(org.jboss.as.test.integration.jca.beanvalidation.ra.ValidActivationSpec) ActivationSpec(javax.resource.spi.ActivationSpec) MessageListener(org.jboss.jca.core.spi.rar.MessageListener) ResourceAdapterRepository(org.jboss.jca.core.spi.rar.ResourceAdapterRepository) ValidMessageEndpointFactory(org.jboss.as.test.integration.jca.beanvalidation.ra.ValidMessageEndpointFactory) ValidMessageEndpoint(org.jboss.as.test.integration.jca.beanvalidation.ra.ValidMessageEndpoint) Test(org.junit.Test)

Example 7 with MessageListener

use of org.jboss.jca.core.spi.rar.MessageListener in project wildfly by wildfly.

the class InflowJarTestCase method testRegistryConfiguration.

/**
     * Test configuration
     *
     * @throws Throwable Thrown if case of an error
     */
@Test
public void testRegistryConfiguration() throws Throwable {
    assertNotNull(serviceContainer);
    ServiceController<?> controller = serviceContainer.getService(ConnectorServices.RA_REPOSITORY_SERVICE);
    assertNotNull(controller);
    ResourceAdapterRepository repository = (ResourceAdapterRepository) controller.getValue();
    assertNotNull(repository);
    Set<String> ids = repository.getResourceAdapters();
    assertNotNull(ids);
    String piId = getElementContaining(ids, "MultipleResourceAdapter");
    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());
}
Also used : Endpoint(org.jboss.jca.core.spi.rar.Endpoint) ActivationSpec(javax.resource.spi.ActivationSpec) MessageListener(org.jboss.jca.core.spi.rar.MessageListener) ResourceAdapterRepository(org.jboss.jca.core.spi.rar.ResourceAdapterRepository) Test(org.junit.Test)

Example 8 with MessageListener

use of org.jboss.jca.core.spi.rar.MessageListener in project wildfly by wildfly.

the class InflowFlatTestCase method testRegistryConfiguration.

/**
     * Test configuration
     *
     * @throws Throwable Thrown if case of an error
     */
@Test
public void testRegistryConfiguration() throws Throwable {
    assertNotNull(serviceContainer);
    ServiceController<?> controller = serviceContainer.getService(ConnectorServices.RA_REPOSITORY_SERVICE);
    assertNotNull(controller);
    ResourceAdapterRepository repository = (ResourceAdapterRepository) controller.getValue();
    assertNotNull(repository);
    Set<String> ids = repository.getResourceAdapters();
    assertNotNull(ids);
    String piId = getElementContaining(ids, "MultipleResourceAdapter");
    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());
}
Also used : Endpoint(org.jboss.jca.core.spi.rar.Endpoint) ActivationSpec(javax.resource.spi.ActivationSpec) MessageListener(org.jboss.jca.core.spi.rar.MessageListener) ResourceAdapterRepository(org.jboss.jca.core.spi.rar.ResourceAdapterRepository) Test(org.junit.Test)

Aggregations

ActivationSpec (javax.resource.spi.ActivationSpec)8 MessageListener (org.jboss.jca.core.spi.rar.MessageListener)8 ResourceAdapterRepository (org.jboss.jca.core.spi.rar.ResourceAdapterRepository)8 Endpoint (org.jboss.jca.core.spi.rar.Endpoint)7 Test (org.junit.Test)5 AnnoActivationSpec (org.jboss.as.test.integration.jca.annorar.AnnoActivationSpec)2 AnnoMessageListener (org.jboss.as.test.integration.jca.annorar.AnnoMessageListener)2 AnnoResourceAdapter (org.jboss.as.test.integration.jca.annorar.AnnoResourceAdapter)2 ValidActivationSpec (org.jboss.as.test.integration.jca.beanvalidation.ra.ValidActivationSpec)2 ValidMessageEndpoint (org.jboss.as.test.integration.jca.beanvalidation.ra.ValidMessageEndpoint)2 ValidMessageEndpointFactory (org.jboss.as.test.integration.jca.beanvalidation.ra.ValidMessageEndpointFactory)2 IntrospectionException (java.beans.IntrospectionException)1 Properties (java.util.Properties)1 ResourceException (javax.resource.ResourceException)1 Activation (org.jboss.jca.core.spi.rar.Activation)1 NotFoundException (org.jboss.jca.core.spi.rar.NotFoundException)1