Examples of EventListenerTestImpl


Examples of org.apache.commons.configuration2.event.EventListenerTestImpl

     * Tests whether set property events are triggered.
     */
    @Test
    public void testEventSetProperty()
    {
        EventListenerTestImpl listener = new EventListenerTestImpl(cc);
        cc.addEventListener(ConfigurationEvent.ANY, listener);
        cc.setProperty("test", "value");
        listener.checkEvent(ConfigurationEvent.SET_PROPERTY, "test", "value", true);
        listener.checkEvent(ConfigurationEvent.SET_PROPERTY, "test", "value", false);
        listener.done();
    }
View Full Code Here

Examples of org.apache.commons.configuration2.event.EventListenerTestImpl

    {
        cc.addConfiguration(conf1);
        String key = "configuration.loaded";
        assertTrue("Wrong value for property", cc
                .getBoolean(key));
        EventListenerTestImpl listener = new EventListenerTestImpl(cc);
        cc.addEventListener(ConfigurationEvent.ANY, listener);
        cc.clearProperty(key);
        assertFalse("Key still present", cc.containsKey(key));
        listener.checkEvent(ConfigurationEvent.CLEAR_PROPERTY, key, null, true);
        listener.checkEvent(ConfigurationEvent.CLEAR_PROPERTY, key, null, false);
        listener.done();
    }
View Full Code Here

Examples of org.apache.commons.configuration2.event.EventListenerTestImpl

     * Tests whether a cloned configuration is decoupled from its original.
     */
    @Test
    public void testCloneModify()
    {
        EventListener<ConfigurationEvent> l = new EventListenerTestImpl(config);
        config.addEventListener(ConfigurationEvent.ANY, l);
        config.addProperty("original", Boolean.TRUE);
        BaseConfiguration config2 = (BaseConfiguration) config.clone();

        config2.addProperty("clone", Boolean.TRUE);
View Full Code Here

Examples of org.apache.commons.configuration2.event.EventListenerTestImpl

     * Tests whether configuration listeners are handled correctly.
     */
    @Test
    public void testAddConfigurationListener() throws ConfigurationException
    {
        EventListener<ConfigurationEvent> l1 = new EventListenerTestImpl(null);
        @SuppressWarnings("unchecked")
        EventListener<Event> l2 =
                EasyMock.createMock(EventListener.class);
        EasyMock.replay(l2);
        MultiFileConfigurationBuilder<XMLConfiguration> builder =
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.