mmhh okay. might enable this in exam2. At least as an option.
You could already do this in Exam1 using the probe customizer [1]

[1]
http://wiki.ops4j.org/display/paxexam/ExamAndTinybundles?showComments=true&showCommentArea=true


On Fri, Mar 11, 2011 at 4:37 AM, Sanjeeb Sahoo <[email protected]> wrote:

> I was hoping to do something like this:
>
> @RunWith(JUnit4TestRunner.class)
> public class T1_SamplesTest extends CommonConfiguration {
>
>     // List of bundles installed by a test method
>     private List<Bundle> testBundles = new ArrayList<Bundle>();
>
>     @Test
>     public void uas_simpleservice_test(BundleContext ctx) BundleException {
>         try {
>             Bundle api_b = installTestBundle(ctx, "mvn:..."); // this
> bundle exports pkg named api
>             Bundle service_b = installTestBundle(ctx, "mvn:..."); // this
> bundles registers a service of type api.Hello
>             service_b.start(Bundle.START_TRANSIENT);
>             api.Hello hello =
> ctx.getService(ctx.getServiceReference("api.Hello"));
>             hello.sayHello("Hello World");
>         } catch(Exception e) {
>             fail(e.toString());
>         } finally {
>             uninstallAllTestBundles();
>         }
>     }
> }
>
> Now, I am forced to install my "api" bundle using configuration method.
>
> Thanks,
> Sahoo
>
>
> On Fri, Mar 11, 2011 at 4:40 AM, Toni Menzel <[email protected]> wrote:
>
>> Umm.. need to digest Sahoos idea.
>> Not sure if i fully understand it yet. Can you provide some pseudo code ?
>>
>> Hope you are using Exam2 ? ;))
>>
>>
>> On Fri, Mar 11, 2011 at 12:06 AM, Andreas Pieber <[email protected]>wrote:
>>
>>> Mhm... interesting idea.
>>>
>>> I would really like to hear what Toni (my pax-exam hero) thinks about
>>> this? @Toni: ping :)
>>>
>>> Kind regards,
>>> Andreas
>>>
>>> On Thu, Mar 10, 2011 at 8:40 AM, Sanjeeb Sahoo <[email protected]>
>>> wrote:
>>> > I am new to usng pax-exam, so have not probably got the patterns right,
>>> but
>>> > while writing some test cases, I feel the probe bundle using
>>> "DynamicImport"
>>> > makes it easier for writing test cases. That way, one could just
>>> install
>>> > additional bundles in the test method itself and use the packages
>>> exported
>>> > by those bundles instead of having to provision bundles using
>>> configuration
>>> > methods.
>>> >
>>> > Comments?
>>> >
>>> > _______________________________________________
>>> > general mailing list
>>> > [email protected]
>>> > http://lists.ops4j.org/mailman/listinfo/general
>>> >
>>> >
>>>
>>> _______________________________________________
>>> general mailing list
>>> [email protected]
>>> http://lists.ops4j.org/mailman/listinfo/general
>>>
>>
>>
>>
>> --
>> *Toni Menzel - http://www.okidokiteam.com*
>>
>> _______________________________________________
>> general mailing list
>> [email protected]
>> http://lists.ops4j.org/mailman/listinfo/general
>>
>>
>


-- 
*Toni Menzel - http://www.okidokiteam.com*
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to