use of org.jboss.as.test.integration.jca.annorar.AnnoResourceAdapter in project wildfly by wildfly.
the class NoRaAnnoTestCase method testActivation.
/**
* Test activation
*
* @param clazz class name
* @throws Throwable Thrown if case of an error
*/
public void testActivation(Class clazz) throws Throwable {
ServiceController<?> controller = serviceContainer.getService(ConnectorServices.RA_REPOSITORY_SERVICE);
assertNotNull(controller);
ResourceAdapterRepository raRepository = (ResourceAdapterRepository) controller.getValue();
Set<String> ids = raRepository.getResourceAdapters(clazz);
assertNotNull(ids);
assertEquals(1, ids.size());
String piId = ids.iterator().next();
assertNotNull(piId);
Endpoint endpoint = raRepository.getEndpoint(piId);
assertNotNull(endpoint);
List<MessageListener> listeners = raRepository.getMessageListeners(piId);
assertNotNull(listeners);
assertEquals(2, listeners.size());
MessageListener listener = listeners.get(0);
MessageListener listener1 = listeners.get(1);
ActivationSpec as = listener.getActivation().createInstance();
ActivationSpec as1 = listener1.getActivation().createInstance();
assertNotNull(as);
assertNotNull(as.getResourceAdapter());
assertNotNull(as1);
assertNotNull(as1.getResourceAdapter());
AnnoActivationSpec tas = (AnnoActivationSpec) as;
log.trace("AS:" + tas + "//1//" + tas.getFirst() + "//2//" + tas.getSecond());
assertEquals(new Character('C'), tas.getFirst());
assertEquals(new Double(0.5), tas.getSecond());
assertTrue(tas.getResourceAdapter() instanceof AnnoResourceAdapter);
AnnoResourceAdapter tra = (AnnoResourceAdapter) tas.getResourceAdapter();
log.trace("RA:" + tra + "//1//" + tra.getFirst() + "//2//" + tra.getSecond());
assertEquals("A", tra.getFirst());
assertEquals(new Integer(5), tra.getSecond());
}
use of org.jboss.as.test.integration.jca.annorar.AnnoResourceAdapter in project wildfly by wildfly.
the class RaAnnoTestCase method testActivation.
/**
* Test activation
*
* @param clazz class name
* @throws Throwable Thrown if case of an error
*/
public void testActivation(Class clazz) throws Throwable {
ServiceController<?> controller = serviceContainer.getService(ConnectorServices.RA_REPOSITORY_SERVICE);
assertNotNull(controller);
ResourceAdapterRepository raRepository = (ResourceAdapterRepository) controller.getValue();
Set<String> ids = raRepository.getResourceAdapters(clazz);
assertNotNull(ids);
assertEquals(1, ids.size());
String piId = ids.iterator().next();
assertNotNull(piId);
Endpoint endpoint = raRepository.getEndpoint(piId);
assertNotNull(endpoint);
List<MessageListener> listeners = raRepository.getMessageListeners(piId);
assertNotNull(listeners);
assertEquals(1, listeners.size());
MessageListener listener = listeners.get(0);
ActivationSpec as = listener.getActivation().createInstance();
assertNotNull(as);
assertNotNull(as.getResourceAdapter());
AnnoActivationSpec tas = (AnnoActivationSpec) as;
log.trace("AS:" + tas + "//1//" + tas.getFirst() + "//2//" + tas.getSecond());
assertEquals(new Character('U'), tas.getFirst());
assertEquals(new Double(4.4), tas.getSecond());
assertTrue(tas.getResourceAdapter() instanceof AnnoResourceAdapter);
AnnoResourceAdapter tra = (AnnoResourceAdapter) tas.getResourceAdapter();
log.trace("RA:" + tra + "//1//" + tra.getFirst() + "//2//" + tra.getSecond());
assertEquals("G", tra.getFirst());
assertEquals(new Integer(99), tra.getSecond());
}
Aggregations