@Test public void testCancelMethods3() throws Exception { Object id = "flibble3"; try { ((ObjectStoreInterMineImpl) os).deregisterRequestId(id); Assert.fail("Should have thrown exception"); } catch (ObjectStoreException e) { Assert.assertEquals("This Thread is not registered with ID flibble3", e.getMessage()); } }
@Test public void testCancelMethods2() throws Exception { Object id = "flibble2"; Connection c = ((ObjectStoreInterMineImpl) os).getConnection(); try { Statement s = c.createStatement(); ((ObjectStoreInterMineImpl) os).registerRequestId(id); ((ObjectStoreInterMineImpl) os).registerStatement(s); ((ObjectStoreInterMineImpl) os).cancelRequest(id); ((ObjectStoreInterMineImpl) os).deregisterStatement(s); ((ObjectStoreInterMineImpl) os).deregisterRequestId(id); try { s.executeQuery("SELECT 1"); } catch (SQLException e) { e.printStackTrace(System.out); } } finally { ((ObjectStoreInterMineImpl) os).releaseConnection(c); } }
@Test public void testCancelMethods1() throws Exception { Object id = "flibble1"; Connection c = ((ObjectStoreInterMineImpl) os).getConnection(); try { Statement s = c.createStatement(); ((ObjectStoreInterMineImpl) os).registerRequestId(id); ((ObjectStoreInterMineImpl) os).registerStatement(s); ((ObjectStoreInterMineImpl) os).deregisterStatement(s); ((ObjectStoreInterMineImpl) os).deregisterRequestId(id); } finally { ((ObjectStoreInterMineImpl) os).releaseConnection(c); } }