limboTransactions = byteOut.toString().split("\n"); assertEquals(3, limboTransactions.length); int trId = Integer.parseInt(limboTransactions[0]); maintenanceManager.rollbackTransaction(trId);
limboTransactions = new StringTokenizer(byteOut.toString(),"\n"); assertEquals(3, limboTransactions.countTokens()); if (limboTransactions.hasMoreTokens()) { int trId = Integer.parseInt(limboTransactions.nextToken()); maintenanceManager.rollbackTransaction(trId); } else fail("There should be 3 limbo transactions.");
    public void testRollbackLimboTransaction() throws Exception {        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();        maintenanceManager.setLogger(byteOut);        maintenanceManager.listLimboTransactions();        String [] limboTransactions = byteOut.toString().split("\n");        assertEquals("[]", Arrays.asList(limboTransactions).toString());        createLimboTransaction(3);        byteOut.reset();        maintenanceManager.listLimboTransactions();        limboTransactions = byteOut.toString().split("\n");        assertEquals(3, limboTransactions.length);        int trId = Integer.parseInt(limboTransactions[0]);        maintenanceManager.rollbackTransaction(trId);        byteOut.reset();        maintenanceManager.listLimboTransactions();        limboTransactions = byteOut.toString().split("\n");        assertEquals(2, limboTransactions.length);    }