Examples of ConfigurationEvent


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

     * Tests if a property add event is correctly processed.
     */
    @Test
    public void testEventAdd()
    {
        ConfigurationEvent event = new ConfigurationEvent(this,
                ConfigurationEvent.ADD_PROPERTY, TEST_KEY, TEST_VALUE,
                false);
        layout.onEvent(event);
        assertTrue("Property not stored", layout.getKeys().contains(TEST_KEY));
        assertEquals("Blanc lines before new property", 0, layout
View Full Code Here

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

     * should then be a multi-line property.
     */
    @Test
    public void testEventAddMultiple()
    {
        ConfigurationEvent event = new ConfigurationEvent(this,
                ConfigurationEvent.ADD_PROPERTY, TEST_KEY, TEST_VALUE,
                false);
        layout.onEvent(event);
        layout.onEvent(event);
        assertFalse("No multi-line property", layout.isSingleLine(TEST_KEY));
View Full Code Here

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

    public void testEventAddExisting() throws ConfigurationException
    {
        builder.addComment(TEST_COMMENT);
        builder.addProperty(TEST_KEY, TEST_VALUE);
        layout.load(config, builder.getReader());
        ConfigurationEvent event = new ConfigurationEvent(this,
                ConfigurationEvent.ADD_PROPERTY, TEST_KEY, TEST_VALUE,
                false);
        layout.onEvent(event);
        assertFalse("No multi-line property", layout.isSingleLine(TEST_KEY));
        assertEquals("Comment was modified", TEST_COMMENT, layout
View Full Code Here

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

     * handled.
     */
    @Test
    public void testEventSetNonExisting()
    {
        ConfigurationEvent event = new ConfigurationEvent(this,
                ConfigurationEvent.SET_PROPERTY, TEST_KEY, TEST_VALUE,
                false);
        layout.onEvent(event);
        assertTrue("New property was not found", layout.getKeys().contains(
                TEST_KEY));
View Full Code Here

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

     * Tests if a property delete event is correctly processed.
     */
    @Test
    public void testEventDelete()
    {
        ConfigurationEvent event = new ConfigurationEvent(this,
                ConfigurationEvent.ADD_PROPERTY, TEST_KEY, TEST_VALUE,
                false);
        layout.onEvent(event);
        event = new ConfigurationEvent(this,
                ConfigurationEvent.CLEAR_PROPERTY, TEST_KEY, null,
                false);
        layout.onEvent(event);
        assertFalse("Property still existing", layout.getKeys().contains(
                TEST_KEY));
View Full Code Here

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

     */
    @Test
    public void testEventClearConfig() throws Exception
    {
        fillLayout();
        ConfigurationEvent event = new ConfigurationEvent(this,
                ConfigurationEvent.CLEAR, null, null, false);
        layout.onEvent(event);
        assertTrue("Keys not empty", layout.getKeys().isEmpty());
        assertNull("Header comment was not reset", layout.getHeaderComment());
    }
View Full Code Here

Examples of org.jivesoftware.smackx.pubsub.ConfigurationEvent

{
  @Override
  protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
  {
    if (content.size() == 0)
      return new ConfigurationEvent(attMap.get("node"));
    else
      return new ConfigurationEvent(attMap.get("node"), new ConfigureForm((DataForm)content.iterator().next()));
  }
View Full Code Here

Examples of org.osgi.service.cm.ConfigurationEvent

                Activator.log.error("ConfigurationImpl.delete: Could not get service reference");
                return;
            }

            //TODO join this with the update call. no need for parallel async delivery
            ConfigurationAdminFactory.this.sendEvent(new ConfigurationEvent(
                                                                                reference,
                                                                                ConfigurationEvent.CM_DELETED,
                                                                                factoryPid,
                                                                                servicePid
                                                                                                                                                        )
View Full Code Here

Examples of org.osgi.service.cm.ConfigurationEvent

            {
                Activator.log.error("ConfigurationImpl.update: Could not get service reference for event delivery");
                return;
            }
            //TODO join this with the update call. no need for parallel async delivery
            ConfigurationAdminFactory.this.sendEvent(new ConfigurationEvent(
                                                                                                                                        reference,
                                                                                                                                        ConfigurationEvent.CM_UPDATED,
                                                                                                                                        factoryPid,
                                                                                                                                        servicePid
                                                                                                                                                        )
View Full Code Here

Examples of org.osgi.service.cm.ConfigurationEvent

            Configuration[] configs = findConfigurations((ConfigurationAdmin) configurationAdmin, null);
            if (configs != null)
            {
                for (int i = 0; i < configs.length; i++)
                {
                    ConfigurationEvent cfgEvent = new ConfigurationEvent(configurationAdminReference,
                        ConfigurationEvent.CM_UPDATED, configs[i].getFactoryPid(), configs[i].getPid());
                    configurationEvent(cfgEvent);
                }
            }
        }
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.