// OK
}
}
public void testGetDouble() throws Exception {
Configuration config = this.config.subset("socket-factory");
assertEquals(21D, config.getDouble("port"), 0.001);
assertEquals(123D, config.getDouble("dummy", 123), 0.001);
assertEquals(21D, config.getDouble("port", 123), 0.001);
assertEquals(1.234, config.getDouble("double"), 0.001);
// non double value, must throw exception
try{
config.getDouble("address");
fail("Must throw FtpException");
} catch(FtpException e) {
// OK
}
// missing parameter, must throw exception
try{
config.getDouble("dummy");
fail("Must throw FtpException");
} catch(FtpException e) {
// OK
}
}