use of org.apache.cxf.ws.rm.RMManager in project cxf by apache.
the class RMTxStoreConfigurationTest method testSetCustomTableExistsState.
@Test
public void testSetCustomTableExistsState() {
SpringBusFactory factory = new SpringBusFactory();
Bus bus = factory.createBus("org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean.xml");
RMManager manager = bus.getExtension(RMManager.class);
assertNotNull(manager);
RMTxStore store = (RMTxStore) manager.getStore();
assertTrue(store.isTableExistsError(new SQLException("Table exists", "I6000", 288)));
assertFalse(store.isTableExistsError(new SQLException("Unknown error", "00000", -1)));
}
use of org.apache.cxf.ws.rm.RMManager in project cxf by apache.
the class RMTxStoreConfigurationTest method testTxStoreBean.
@Test
public void testTxStoreBean() {
// connect exception only results in a log message
SpringBusFactory factory = new SpringBusFactory();
Bus bus = factory.createBus("org/apache/cxf/ws/rm/persistence/jdbc/txstore-bean.xml");
RMManager manager = bus.getExtension(RMManager.class);
assertNotNull(manager);
RMTxStore store = (RMTxStore) manager.getStore();
assertNotNull(store);
assertNotNull("Connection should be null", store.getConnection());
assertEquals("org.apache.derby.jdbc.EmbeddedDriver", store.getDriverClassName());
assertEquals("scott", store.getUserName());
assertEquals("tiger", store.getPassword());
assertEquals("jdbc:derby:target/wsrmdb3;create=true", store.getUrl());
assertNull("schema should be unset", store.getSchemaName());
}
use of org.apache.cxf.ws.rm.RMManager in project cxf by apache.
the class RMTxStoreConfigurationTest method testTxStoreWithDataSource.
@Test
public void testTxStoreWithDataSource() {
SpringBusFactory factory = new SpringBusFactory();
Bus bus = factory.createBus("org/apache/cxf/ws/rm/persistence/jdbc/txstore-ds-bean.xml");
RMManager manager = bus.getExtension(RMManager.class);
assertNotNull(manager);
RMTxStore store = (RMTxStore) manager.getStore();
assertNotNull(store.getDataSource());
assertNotNull(store.getConnection());
}
use of org.apache.cxf.ws.rm.RMManager in project cxf by apache.
the class RMTxStoreConfigurationTest method testTxStoreWithDataSource2.
@Test
public void testTxStoreWithDataSource2() {
SpringBusFactory factory = new SpringBusFactory();
Bus bus = factory.createBus("org/apache/cxf/ws/rm/persistence/jdbc/txstore-ds-bean2.xml");
RMManager manager = bus.getExtension(RMManager.class);
assertNotNull(manager);
RMTxStore store = (RMTxStore) manager.getStore();
assertNotNull(store.getDataSource());
assertNotNull(store.getConnection());
}
use of org.apache.cxf.ws.rm.RMManager in project cxf by apache.
the class AbstractClientPersistenceTest method verifyRecovery.
void verifyRecovery() throws Exception {
RMManager manager = bus.getExtension(RMManager.class);
assertNotNull(manager);
RMStore store = manager.getStore();
assertNotNull(store);
Client client = ClientProxy.getClient(greeter);
String id = RMUtils.getEndpointIdentifier(client.getEndpoint());
Collection<DestinationSequence> dss = store.getDestinationSequences(id);
assertEquals(1, dss.size());
Collection<SourceSequence> sss = store.getSourceSequences(id);
assertEquals(1, sss.size());
int i = 0;
while (store.getMessages(sss.iterator().next().getIdentifier(), true).size() > 0 && i < 10) {
Thread.sleep(200);
i++;
}
assertEquals(0, store.getMessages(sss.iterator().next().getIdentifier(), true).size());
assertEquals(0, store.getMessages(sss.iterator().next().getIdentifier(), false).size());
}
Aggregations