@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()); assertNull(store.getConnection()); }
@Test public void testSetCustomTableExistsState2() { SpringBusFactory factory = new SpringBusFactory(); Bus bus = factory.createBus("org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean2.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))); }
@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); assertNull("Connection should be null", store.getConnection()); assertEquals("org.apache.derby.jdbc.NoDriver", store.getDriverClassName()); assertEquals("scott", store.getUserName()); assertEquals("tiger", store.getPassword()); assertEquals("jdbc:derby://localhost:1527/rmdb;create=true", store.getUrl()); assertNull("schema should be unset", store.getSchemaName()); }