rfa.setFormatter(this.formatter);
rfa.setFormatter((ExtendedFormatter)this.formatter);
    public void testRename() throws Exception {        Thread.sleep(1000);        System.out.println("Entering testRename");        RollingFileHandler rfa = new RollingFileHandler("foo");        rfa.setFormatter(this.formatter);        rfa.setAppend(false);        // rollover by the second        String datePattern = "yyyy-MM-dd_HH_mm_ss";        SimpleDateFormat sdf = new SimpleDateFormat(datePattern);        TimeBasedRollingPolicy tbrp = new TimeBasedRollingPolicy("output/testren-%d{" + datePattern                + "}");        rfa.setFile("output/testren.log");        rfa.setImmediateFlush(true);        tbrp.activateOptions();        rfa.setRollingPolicy(tbrp);        rfa.activateOptions();        Calendar cal = Calendar.getInstance();        LoggerUtil.removeAllHandlers(this.renameLogger);        this.renameLogger.addHandler(rfa);        this.renameLogger.finer("Hello   " + 0);        Thread.sleep(5000);        this.renameLogger.finer("Hello   " + 1);        String rolledFile = "output/testren-" + sdf.format(cal.getTime());        //        // if the rolled file exists        // either the test wasn't run from the Ant script        // which opens test.log in another process or        // the test is running on a platform that allows open files to be        // renamed        getLogger().info("Starte check testRename");        if (new File(rolledFile).exists()) {            getLogger().info("rolledFile exists, two checks");            boolean checkOne = Compare.compare(rolledFile, "witness/rolling/renaming.0");            assertTrue("rolledFile vs renaming.0",checkOne);            boolean checkTwo = Compare.compare("output/testren.log", "witness/rolling/renaming.1");            assertTrue("testren.log vs renaming.1", checkTwo);        } else {            //            // otherwise the rollover should have been blocked            //            getLogger().info("rolledFile does not exist, one check");            boolean ret = Compare.compare("output/testren.log", "witness/rolling/renaming.2");            assertTrue(ret);        }    }