Wednesday, 20 March 2013

OSGi Assertions and Utilities library 1.2.0 released

A new version 1.2.0 of OSGi Assertions and Utilities library for integration tests is released. 

Changes:
  • EventAdmin-specific utilities and assertions
  • @Test
    public void test_Post_Event() {
        postEvent(getBundleContext(), KNOWHOWLAB_TOPICS_TEST, 200);
    
        assertEvent(KNOWHOWLAB_TOPICS_TEST, 500, TimeUnit.MILLISECONDS);
    }
    
    @Test
    public void test_Post_Event_With_Filters() throws InvalidSyntaxException {
        Map props = new HashMap();
        props.put("prop_key", "val123");
    
        postEvent(getBundleContext(), KNOWHOWLAB_TOPICS_TEST, props, 200);
        assertEvent(KNOWHOWLAB_TOPICS_TEST, FilterUtils.eq("prop_key", "val123"), 500, TimeUnit.MILLISECONDS);
    
        postEvent(getBundleContext(), KNOWHOWLAB_TOPICS_TEST, props, 200);
        try {
            assertEvent(KNOWHOWLAB_TOPICS_TEST, FilterUtils.eq("prop_key", "val555"), 500, TimeUnit.MILLISECONDS);
        } catch (AssertionError e) {
        }
    }
    
  • ConfigurationAdmin-specific utilities and assertions
  • @Test
    public void test_Configuration_manipulations() {
        assertConfigurationUnavailable("test.pid", null, null);
    
        Map config = new HashMap();
        config.put("test.key", "test.value");
        supplyConfiguration(getBundleContext(), "test.pid", null, config, 0);
    
        assertConfigurationUpdated("test.pid", null, null, 500, TimeUnit.MILLISECONDS);
    
        assertConfigurationAvailable("test.pid", null, null);
    
        deleteConfiguration(getBundleContext(), "test.pid", null, 0);
    
        assertConfigurationDeleted("test.pid", null, null, 500, TimeUnit.MILLISECONDS);
    
        assertConfigurationUnavailable("test.pid", null, null);
    }
    
  • PaxExam 3.0.x integration tests
  • Bug fixes and improvements

References:

  1. Sources: GitHub
  2. Mailing List: knowhowlab-osgi-testing


Thank you for your attention. Your feedback is welcome as usual.
Best Regards.

No comments:

Post a Comment