Code example for LogManager

Methods: readConfigurationreset

0
    final static String baseClassName = OldMemoryHandlerTest.class.getName();
    MemoryHandler handler;
 
    @Override protected void setUp() throws Exception { 
        super.setUp(); 
        manager.reset();
        initProps(); 
        manager.readConfiguration(propertiesToInputStream(props));
        handler = new MemoryHandler();
    } 
 
    @Override protected void tearDown() throws Exception { 
        super.tearDown(); 
        manager.readConfiguration();
        props.clear();
    } 
 
    public static InputStream propertiesToInputStream(Properties p) throws IOException {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        p.store(bos, "");
        return new ByteArrayInputStream(bos.toByteArray());