Fwd: How to work with provisional in Probe?

27 views
Skip to first unread message

William la Forge

unread,
May 22, 2013, 3:35:12 AM5/22/13
to AgileWikiDevelopers
A second request for help on the karaf mailing list...

---------- Forwarded message ----------
From: William la Forge <lafo...@gmail.com>
Date: Wed, May 22, 2013 at 1:03 PM
Subject: How to work with provisional in Probe?
To: User <us...@karaf.apache.org>


I'm a newbie to Karaf, trying to integrate my middleware. So the first thing I need are integration tests, which are proving a bit difficult.

I did find a very nice page on integration testing: http://iocanel.blogspot.in/2012/01/advanced-integration-testing-with-pax.html

A problem came up with accessing provisional classes. When I add the following code I get java.lang.NoClassDefFoundError: org/osgi/framework/BundleListener

    @ProbeBuilder
    public TestProbeBuilder probeConfiguration(TestProbeBuilder probe) {
        probe.setHeader(Constants.DYNAMICIMPORT_PACKAGE, "*;status=provisional");
        return probe;
    }


I also tried adding core to no avail:
    mavenBundle("org.osgi", "org.osgi.core", "4.3.1")

Any help would be appreciated. I've had lots of success so far with everything except these integration tests.

Bill


William la Forge

unread,
May 22, 2013, 4:40:45 AM5/22/13
to AgileWikiDevelopers
May prove helpful...

---------- Forwarded message ----------
From: Jean-Baptiste Onofré <j...@nanthrax.net>
Date: Wed, May 22, 2013 at 1:24 PM
Subject: Re: How to work with provisional in Probe?
To: us...@karaf.apache.org


Sorry Bill, I missed your links. I gonna take a look.

Regarding Cellar itests, you can take a look there:

http://svn.apache.org/repos/asf/karaf/cellar/branches/cellar-2.3.x/itests/

especially:
http://svn.apache.org/repos/asf/karaf/cellar/branches/cellar-2.3.x/itests/src/test/java/org/apache/karaf/cellar/itests/CellarTestSupport.java

Regards
JB


On 05/22/2013 09:48 AM, William la Forge wrote:
JB,

Ah, but I did share my pom...
As for looking at the itests of Karaf or Cellar, that is really what I
should be doing. I've found a lot of links to repositories covering
testing with pax exam, but so many of them are dead/404. Could you give
me a link to a reasonably simple example? Not being a strong OSGi
developer, I do have trouble following things. :-)


On Wed, May 22, 2013 at 1:10 PM, Jean-Baptiste Onofré <j...@nanthrax.net
<mailto:j...@nanthrax.net>> wrote:

    Hi Bill,

    did you take a look on the Karaf or Cellar itests (we use
    karaf-pax-exam) here ?

    Could you share your tests pom.xml ?

    Thanks,
    Regards
    JB



    On 05/22/2013 09:33 AM, William la Forge wrote:

        I'm a newbie to Karaf, trying to integrate my middleware. So the
        first
        thing I need are integration tests, which are proving a bit
        difficult.

        I did find a very nice page on integration testing:

        <http://iocanel.blogspot.in/2012/01/advanced-integration-testing-with-pax.html>

        A problem came up with accessing provisional classes. When I add the
        following code I get java.lang.__NoClassDefFoundError:
        org/osgi/framework/__BundleListener

              @ProbeBuilder
              public TestProbeBuilder
        probeConfiguration(__TestProbeBuilder probe) {
                  probe.setHeader(Constants.__DYNAMICIMPORT_PACKAGE,

        "*;status=provisional");
                  return probe;
              }

        pom:

        <https://github.com/laforge49/JActor2/blob/master/jactor-ktest/src/test/java/org/apache/karaf/KarafWithBundleTest.java>

        I also tried adding core to no avail:
        mavenBundle("org.osgi", "org.osgi.core", "4.3.1")

        Any help would be appreciated. I've had lots of success so far with
        everything except these integration tests.

        Bill


    --
    Jean-Baptiste Onofré
    jbon...@apache.org <mailto:jbon...@apache.org>

William la Forge

unread,
May 22, 2013, 5:58:45 AM5/22/13
to AgileWikiDevelopers
Another good link for tests!

---------- Forwarded message ----------
From: Achim Nierbeck <bcan...@googlemail.com>
Date: Wed, May 22, 2013 at 3:07 PM
Subject: Re: How to work with provisional in Probe?
To: "us...@karaf.apache.org" <us...@karaf.apache.org>


Hi Bill, 

the Pax-Web Project also uses Pax-Exam and Pax-Exam-Karaf very intensively, you might find some more examples there :-) [1]
And it's probably best to look at the 3.0.x branch of it, due to that trunk is being merged to a newer version right now :)

regards, Achim 



2013/5/22 William la Forge <lafo...@gmail.com>


On Wed, May 22, 2013 at 2:10 PM, William la Forge <lafo...@gmail.com> wrote:
Many thanks.

I've also just found the gogo runtime bundle. Thinking I can implement a shell to drive tests in a non-pax exam bundle.

--b




--

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project Lead
blog <http://notizblog.nierbeck.de/>

Reply all
Reply to author
Forward
0 new messages