On Tue, Sep 27, 2016 at 12:09 PM, Steinar Bang <[email protected]> wrote:
>>>>>> Benson Margulies <[email protected]>:
>
>> Why not just run the junit test in eclipse the usual way? Assuming
>> that you are not using the exam-maven-plugin.
>
> That would require a
> test-that-isn't-actually-a-test-but-just-a-way-of-launching-an-osgi-runtime-with-my-bundles.

That is the definition of pax-exam in the most common usage mode, only
without the 'isn't actually'. It creates a container, loads your
bundles, then makes a tinybundle out of your test, loads that, and
causes the test cases to run. It is a means of creating a set of JUnit
(or, I suppose, testng) test cases that run inside an OSGi container.

There is another mechanism if your test cases do NOT want to be run in
the OSGi bundle, but rather want to talk to the OSGi container via a
web service or something.



// CHECKSTYLE:OFF
@ClassRule
public static PaxExamServer exam = new PaxExamServer();
// CHECKSTYLE:ON

@Configuration
public static Option[] paxConfiguration() {
    return new Option[]{
            composite(Utils.baseConfiguration(frontEndPort)),
            Utils.improvedTransportConfig(frontEndPort), // worker and
front end on the same port.
            Utils.distributionOption("full-test")
    };
}

This launches an OSGi container, configures it to your spec, runs your
test cases, and then tears it down.

Surely you want something that also works in your commands-line/CI
system, not just eclipse?



>
> And that seems kind of clumsy, and it feels like a hack.
>
> I have it on the list as a last resort.
>
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - [email protected]
>
> ---
> You received this message because you are subscribed to the Google Groups 
> "OPS4J" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to