OSGi Testing 1.2.0 released

15 views
Skip to first unread message

Dmytro Pishchukhin

unread,
Mar 20, 2013, 1:58:10 PM3/20/13
to knowhowlab-...@googlegroups.com
  • Added EventAdmin utils and assertions
  • Added ConfigurationAdmin utils and assertions
  • Added PaxExam 3.0.x integration tests
  • bug fixes and improvements

Samples

@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<String, String> props = new HashMap<String, String>();
    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) {
    }
}

@Test
public void test_Service_Event() throws InvalidSyntaxException {
    // start bundle in 2 sec
    startBundleAsync(getBundleContext(), "org.knowhowlab.osgi.testing.it.test.bundle", 200);

    assertEvent("org/osgi/framework/ServiceEvent/REGISTERED", FilterUtils.eq("service.objectClass", "org.knowhowlab.osgi.testing.it.testbundle.service.Echo"), 1, TimeUnit.SECONDS);
}

@Test
public void test_Configuration_manipulations() {
    assertConfigurationUnavailable("test.pid", null, null);

    Map<String, String> config = new HashMap<String, String>();
    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);
}

Cristiano Gavião

unread,
Mar 20, 2013, 2:05:35 PM3/20/13
to Dmytro Pishchukhin, knowhowlab-...@googlegroups.com
Hi Dmytro,

Cool !!! thanks for this nice improvement.

But I could not find this version in maven repo.

regards,

Cristiano

2013/3/20 Dmytro Pishchukhin <dmytro.pi...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "KnowHowLab OSGi testing" group.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
"Tudo vale a pena se a alma não é pequena..."

Dmytro Pishchukhin

unread,
Mar 20, 2013, 2:08:40 PM3/20/13
to Cristiano Gavião, knowhowlab-...@googlegroups.com
Hi Cristiano,

it takes time to sync OSS with Maven Central. Up to 1 hour.

--
Best regards,
Dmytro Pishchukhin
Reply all
Reply to author
Forward
0 new messages