You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Ken Gilmer <kg...@gmail.com> on 2011/12/06 09:11:05 UTC

Suggestions on OSGi-context testing

Hi,

  I'd like to begin adding some test cases to the httplite bundle.  Ideally
I'd like my tests executed within an OSGi context so I don't have to mock
anything, and the test environment is as close as possible to a real
instance.  Also I'd like my tests to execute as part of the maven build
process.  Can anyone suggest an existing and somewhat current Felix project
that does this or provide other suggestions?

Thanks!
ken

Re: Suggestions on OSGi-context testing

Posted by Ken Gilmer <kg...@gmail.com>.
Thanks Karl,

That fixed it.  Now I'm off and running writing unit tests!

Thanks
Ken

On Dec 12, 2011, at 5:00 AM, Karl Pauls <ka...@gmail.com> wrote:

> Yeah, I see - you have the osgi.core 4.1 as a dependency. Try to
> remove it (pojosr probably has all classes you need embeded) or update
> to 4.2.
> 
> regards,
> 
> Karl
> 
> On Sun, Dec 11, 2011 at 8:49 PM, Karl Pauls <ka...@gmail.com> wrote:
>> Hi Ken,
>> 
>> that used to be a problem with older versions of the framework util
>> shipped with osgi. Is it possible that you somehow have an osgi.core
>> jar < 4.2 on the classpath in front of pojosr? If so, try to
>> remove/exclude it or reorder your dependencies. A possible test is as
>> well to use felix instead of pojosr - it should have the same issue
>> (assuming it ends-up in the same classpath location as pojosr - you
>> should be able to see the classpath with mvn -X ).
>> 
>> regards,
>> 
>> Karl
>> 
>> On Sat, Dec 10, 2011 at 7:46 AM, Ken Gilmer <kg...@gmail.com> wrote:
>>> Hi Karl,
>>> 
>>>  Thanks for the additional guidance.  So I spent some time setting up
>>> a vanilla maven osgi bundle project.  I was able to add pojosr and
>>> create a simple test case that started my bundle, retrieved the
>>> service via the pojosr service registry, and executed the service.
>>> 
>>>  I then moved to integrating pojosr into httplite so I could begin
>>> writing tests.  As my bundle starts in my test case, I ran into a
>>> problem where "org.osgi.vendor.framework" is an undefined system
>>> property.  I did some digging and determined that the FrameworkUtil
>>> class tries to be dynamically loaded based on the root classname as
>>> defined by "org.osgi.vendor.framework".  Setting to this to
>>> "org.osgi.framework", (which is the root package name for the class
>>> contained in pojosr) resulted in a stack overflow.  The FrameworkUtil
>>> in the Felix framework is available but has all sorts of private
>>> dependencies and is not easy to pull out into my own package. It
>>> appears that the pojosr implementation is just calling itself, or
>>> expecting another class to be available?  Any suggestions?
>>> 
>>> thx
>>> ken
>>> 
>>> On Thu, Dec 8, 2011 at 6:58 PM, Karl Pauls <ka...@gmail.com> wrote:
>>>> On Thu, Dec 8, 2011 at 8:59 AM, Ken Gilmer <kg...@gmail.com> wrote:
>>>>> Thanks Andreas, Karl, and Arjun!
>>>>> 
>>>>> Andreas,
>>>>> 
>>>>>  I spent some time learning the basics of Pax Exam.  One of my
>>>>> particular requirements is JUnit3/Java1.4.  I see it mentioned in a
>>>>> JIRA issue that support has been added but cannot find a suitable
>>>>> example of how this works.  Ideally for me, the Pax Exam documentation
>>>>> would contain the initial description of what Pax Exam is, and then
>>>>> want to see only a maven-based project with:
>>>>> 
>>>>> a) a service definition (public api)
>>>>> b) some implementation (private)
>>>>> c) a test that gets the service and executes a method via junit
>>>>> d) the minimal POM that builds the regular bundle and also runs the junit test
>>>>> 
>>>>>  The existing example code is helpful but doesn't really answer my
>>>>> immediate needs of getting started quickly, (as one who is not too
>>>>> familiar with Maven yet).
>>>>> 
>>>>> Karl,
>>>>> 
>>>>>  Regarding PojoSR, I probably do not need a full OSGi framework for
>>>>> my tests, so it could be suitable for me.  However I need a bit more
>>>>> guidance on how to set up running a test (I can visualize how to
>>>>> compose a test) in Maven.  Can you point me to an existing pom.xml
>>>>> that uses PojoSR to execute JUnit tests against a service?
>>>> 
>>>> I guess there are (at least could be) several approaches which also
>>>> depend on your needs. One public example I know of is the work
>>>> Guillaume Nodet (and maybe others) did for fuse:
>>>> 
>>>> https://github.com/fusesource/fuse/tree/master/fabric/fabric-itests/fabric-pojosr
>>>> 
>>>> Does that help?
>>>> 
>>>>>  Regarding bnd, it seems to utilize Ant makefiles.  I'd like to avoid
>>>>> that if possible.  Nothing against Ant, in fact I have my own
>>>>> Ant-based osgi test framework, but I'd like to keep the test stuff as
>>>>> simple as I can and keep things in Maven.
>>>> 
>>>> It might not be impossible to hook it up to maven (if nothing else, by
>>>> executing the and file from there). I think it is mostly based on bnd
>>>> and the ant files are just very lightweight wrappers around it but I
>>>> can't say whether it would be easy or not. You can see an example in
>>>> ricks sandbox (the example requires you to use ant to execute the
>>>> tests but it uses maven to get the thing assembled iirc) :
>>>> 
>>>> http://svn.apache.org/repos/asf/felix/sandbox/rickhall/bnd-test/
>>>> 
>>>> regards,
>>>> 
>>>> Karl
>>>> 
>>>>> Arjun,
>>>>> 
>>>>>  For me, the most difficult part is the Maven integration.  I want
>>>>> the tests to run and fail as part of the build.  In any case it's good
>>>>> to know you've got that, I'll check it out.
>>>>> 
>>>>> thx,
>>>>> ken
>>>>> 
>>>>> 
>>>>> 
>>>>> On Tue, Dec 6, 2011 at 6:56 PM, Karl Pauls <ka...@gmail.com> wrote:
>>>>>> To use PojoSR for testing with your dependencies from maven I guess
>>>>>> you could just use the exec-maven-plugin, hook it up to the test phase
>>>>>> and have it start with all dependencies from the test scope.
>>>>>> 
>>>>>> regards,
>>>>>> 
>>>>>> Karl
>>>>>> 
>>>>>> On Tue, Dec 6, 2011 at 9:25 AM, Karl Pauls <ka...@gmail.com> wrote:
>>>>>>> If you are looking for real integration testing, Pax Exam is probably
>>>>>>> what you want.
>>>>>>> 
>>>>>>> However, if you want to test you services without a full OSGi
>>>>>>> framework you might want to have  a look at PojoSR:
>>>>>>> 
>>>>>>> http://pojosr.googlecode.com
>>>>>>> 
>>>>>>> I know that some people use it for JUnit testing their services.
>>>>>>> Finally, bnd itself can be used for testing (we use that in the
>>>>>>> framework) and it is used by the OSGi ct.
>>>>>>> 
>>>>>>> regards,
>>>>>>> 
>>>>>>> Karl
>>>>>>> 
>>>>>>> On Tue, Dec 6, 2011 at 9:17 AM, Andreas Pieber <an...@gmail.com> wrote:
>>>>>>>> Hey Ken,
>>>>>>>> 
>>>>>>>> You might want to give Pax Exam a look for integration tests with OSGi:
>>>>>>>> http://team.ops4j.org/wiki/display/paxexam/Pax+Exam
>>>>>>>> 
>>>>>>>> Kind regards,
>>>>>>>> Andreas
>>>>>>>> 
>>>>>>>> On Tue, Dec 6, 2011 at 09:11, Ken Gilmer <kg...@gmail.com> wrote:
>>>>>>>> 
>>>>>>>>> Hi,
>>>>>>>>> 
>>>>>>>>>  I'd like to begin adding some test cases to the httplite bundle.  Ideally
>>>>>>>>> I'd like my tests executed within an OSGi context so I don't have to mock
>>>>>>>>> anything, and the test environment is as close as possible to a real
>>>>>>>>> instance.  Also I'd like my tests to execute as part of the maven build
>>>>>>>>> process.  Can anyone suggest an existing and somewhat current Felix project
>>>>>>>>> that does this or provide other suggestions?
>>>>>>>>> 
>>>>>>>>> Thanks!
>>>>>>>>> ken
>>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> --
>>>>>>> Karl Pauls
>>>>>>> karlpauls@gmail.com
>>>>>>> http://twitter.com/karlpauls
>>>>>>> http://www.linkedin.com/in/karlpauls
>>>>>>> https://profiles.google.com/karlpauls
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Karl Pauls
>>>>>> karlpauls@gmail.com
>>>>>> http://twitter.com/karlpauls
>>>>>> http://www.linkedin.com/in/karlpauls
>>>>>> https://profiles.google.com/karlpauls
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Karl Pauls
>>>> karlpauls@gmail.com
>>>> http://twitter.com/karlpauls
>>>> http://www.linkedin.com/in/karlpauls
>>>> https://profiles.google.com/karlpauls
>> 
>> 
>> 
>> --
>> Karl Pauls
>> karlpauls@gmail.com
>> http://twitter.com/karlpauls
>> http://www.linkedin.com/in/karlpauls
>> https://profiles.google.com/karlpauls
> 
> 
> 
> -- 
> Karl Pauls
> karlpauls@gmail.com
> http://twitter.com/karlpauls
> http://www.linkedin.com/in/karlpauls
> https://profiles.google.com/karlpauls

Re: Suggestions on OSGi-context testing

Posted by Karl Pauls <ka...@gmail.com>.
Yeah, I see - you have the osgi.core 4.1 as a dependency. Try to
remove it (pojosr probably has all classes you need embeded) or update
to 4.2.

regards,

Karl

On Sun, Dec 11, 2011 at 8:49 PM, Karl Pauls <ka...@gmail.com> wrote:
> Hi Ken,
>
> that used to be a problem with older versions of the framework util
> shipped with osgi. Is it possible that you somehow have an osgi.core
> jar < 4.2 on the classpath in front of pojosr? If so, try to
> remove/exclude it or reorder your dependencies. A possible test is as
> well to use felix instead of pojosr - it should have the same issue
> (assuming it ends-up in the same classpath location as pojosr - you
> should be able to see the classpath with mvn -X ).
>
> regards,
>
> Karl
>
> On Sat, Dec 10, 2011 at 7:46 AM, Ken Gilmer <kg...@gmail.com> wrote:
>> Hi Karl,
>>
>>  Thanks for the additional guidance.  So I spent some time setting up
>> a vanilla maven osgi bundle project.  I was able to add pojosr and
>> create a simple test case that started my bundle, retrieved the
>> service via the pojosr service registry, and executed the service.
>>
>>  I then moved to integrating pojosr into httplite so I could begin
>> writing tests.  As my bundle starts in my test case, I ran into a
>> problem where "org.osgi.vendor.framework" is an undefined system
>> property.  I did some digging and determined that the FrameworkUtil
>> class tries to be dynamically loaded based on the root classname as
>> defined by "org.osgi.vendor.framework".  Setting to this to
>> "org.osgi.framework", (which is the root package name for the class
>> contained in pojosr) resulted in a stack overflow.  The FrameworkUtil
>> in the Felix framework is available but has all sorts of private
>> dependencies and is not easy to pull out into my own package. It
>> appears that the pojosr implementation is just calling itself, or
>> expecting another class to be available?  Any suggestions?
>>
>> thx
>> ken
>>
>> On Thu, Dec 8, 2011 at 6:58 PM, Karl Pauls <ka...@gmail.com> wrote:
>>> On Thu, Dec 8, 2011 at 8:59 AM, Ken Gilmer <kg...@gmail.com> wrote:
>>>> Thanks Andreas, Karl, and Arjun!
>>>>
>>>> Andreas,
>>>>
>>>>  I spent some time learning the basics of Pax Exam.  One of my
>>>> particular requirements is JUnit3/Java1.4.  I see it mentioned in a
>>>> JIRA issue that support has been added but cannot find a suitable
>>>> example of how this works.  Ideally for me, the Pax Exam documentation
>>>> would contain the initial description of what Pax Exam is, and then
>>>> want to see only a maven-based project with:
>>>>
>>>> a) a service definition (public api)
>>>> b) some implementation (private)
>>>> c) a test that gets the service and executes a method via junit
>>>> d) the minimal POM that builds the regular bundle and also runs the junit test
>>>>
>>>>  The existing example code is helpful but doesn't really answer my
>>>> immediate needs of getting started quickly, (as one who is not too
>>>> familiar with Maven yet).
>>>>
>>>> Karl,
>>>>
>>>>  Regarding PojoSR, I probably do not need a full OSGi framework for
>>>> my tests, so it could be suitable for me.  However I need a bit more
>>>> guidance on how to set up running a test (I can visualize how to
>>>> compose a test) in Maven.  Can you point me to an existing pom.xml
>>>> that uses PojoSR to execute JUnit tests against a service?
>>>
>>> I guess there are (at least could be) several approaches which also
>>> depend on your needs. One public example I know of is the work
>>> Guillaume Nodet (and maybe others) did for fuse:
>>>
>>> https://github.com/fusesource/fuse/tree/master/fabric/fabric-itests/fabric-pojosr
>>>
>>> Does that help?
>>>
>>>>  Regarding bnd, it seems to utilize Ant makefiles.  I'd like to avoid
>>>> that if possible.  Nothing against Ant, in fact I have my own
>>>> Ant-based osgi test framework, but I'd like to keep the test stuff as
>>>> simple as I can and keep things in Maven.
>>>
>>> It might not be impossible to hook it up to maven (if nothing else, by
>>> executing the and file from there). I think it is mostly based on bnd
>>> and the ant files are just very lightweight wrappers around it but I
>>> can't say whether it would be easy or not. You can see an example in
>>> ricks sandbox (the example requires you to use ant to execute the
>>> tests but it uses maven to get the thing assembled iirc) :
>>>
>>> http://svn.apache.org/repos/asf/felix/sandbox/rickhall/bnd-test/
>>>
>>> regards,
>>>
>>> Karl
>>>
>>>> Arjun,
>>>>
>>>>  For me, the most difficult part is the Maven integration.  I want
>>>> the tests to run and fail as part of the build.  In any case it's good
>>>> to know you've got that, I'll check it out.
>>>>
>>>> thx,
>>>> ken
>>>>
>>>>
>>>>
>>>> On Tue, Dec 6, 2011 at 6:56 PM, Karl Pauls <ka...@gmail.com> wrote:
>>>>> To use PojoSR for testing with your dependencies from maven I guess
>>>>> you could just use the exec-maven-plugin, hook it up to the test phase
>>>>> and have it start with all dependencies from the test scope.
>>>>>
>>>>> regards,
>>>>>
>>>>> Karl
>>>>>
>>>>> On Tue, Dec 6, 2011 at 9:25 AM, Karl Pauls <ka...@gmail.com> wrote:
>>>>>> If you are looking for real integration testing, Pax Exam is probably
>>>>>> what you want.
>>>>>>
>>>>>> However, if you want to test you services without a full OSGi
>>>>>> framework you might want to have  a look at PojoSR:
>>>>>>
>>>>>> http://pojosr.googlecode.com
>>>>>>
>>>>>> I know that some people use it for JUnit testing their services.
>>>>>> Finally, bnd itself can be used for testing (we use that in the
>>>>>> framework) and it is used by the OSGi ct.
>>>>>>
>>>>>> regards,
>>>>>>
>>>>>> Karl
>>>>>>
>>>>>> On Tue, Dec 6, 2011 at 9:17 AM, Andreas Pieber <an...@gmail.com> wrote:
>>>>>>> Hey Ken,
>>>>>>>
>>>>>>> You might want to give Pax Exam a look for integration tests with OSGi:
>>>>>>> http://team.ops4j.org/wiki/display/paxexam/Pax+Exam
>>>>>>>
>>>>>>> Kind regards,
>>>>>>> Andreas
>>>>>>>
>>>>>>> On Tue, Dec 6, 2011 at 09:11, Ken Gilmer <kg...@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>>  I'd like to begin adding some test cases to the httplite bundle.  Ideally
>>>>>>>> I'd like my tests executed within an OSGi context so I don't have to mock
>>>>>>>> anything, and the test environment is as close as possible to a real
>>>>>>>> instance.  Also I'd like my tests to execute as part of the maven build
>>>>>>>> process.  Can anyone suggest an existing and somewhat current Felix project
>>>>>>>> that does this or provide other suggestions?
>>>>>>>>
>>>>>>>> Thanks!
>>>>>>>> ken
>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Karl Pauls
>>>>>> karlpauls@gmail.com
>>>>>> http://twitter.com/karlpauls
>>>>>> http://www.linkedin.com/in/karlpauls
>>>>>> https://profiles.google.com/karlpauls
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Karl Pauls
>>>>> karlpauls@gmail.com
>>>>> http://twitter.com/karlpauls
>>>>> http://www.linkedin.com/in/karlpauls
>>>>> https://profiles.google.com/karlpauls
>>>
>>>
>>>
>>> --
>>> Karl Pauls
>>> karlpauls@gmail.com
>>> http://twitter.com/karlpauls
>>> http://www.linkedin.com/in/karlpauls
>>> https://profiles.google.com/karlpauls
>
>
>
> --
> Karl Pauls
> karlpauls@gmail.com
> http://twitter.com/karlpauls
> http://www.linkedin.com/in/karlpauls
> https://profiles.google.com/karlpauls



-- 
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

Re: Suggestions on OSGi-context testing

Posted by Karl Pauls <ka...@gmail.com>.
Hi Ken,

that used to be a problem with older versions of the framework util
shipped with osgi. Is it possible that you somehow have an osgi.core
jar < 4.2 on the classpath in front of pojosr? If so, try to
remove/exclude it or reorder your dependencies. A possible test is as
well to use felix instead of pojosr - it should have the same issue
(assuming it ends-up in the same classpath location as pojosr - you
should be able to see the classpath with mvn -X ).

regards,

Karl

On Sat, Dec 10, 2011 at 7:46 AM, Ken Gilmer <kg...@gmail.com> wrote:
> Hi Karl,
>
>  Thanks for the additional guidance.  So I spent some time setting up
> a vanilla maven osgi bundle project.  I was able to add pojosr and
> create a simple test case that started my bundle, retrieved the
> service via the pojosr service registry, and executed the service.
>
>  I then moved to integrating pojosr into httplite so I could begin
> writing tests.  As my bundle starts in my test case, I ran into a
> problem where "org.osgi.vendor.framework" is an undefined system
> property.  I did some digging and determined that the FrameworkUtil
> class tries to be dynamically loaded based on the root classname as
> defined by "org.osgi.vendor.framework".  Setting to this to
> "org.osgi.framework", (which is the root package name for the class
> contained in pojosr) resulted in a stack overflow.  The FrameworkUtil
> in the Felix framework is available but has all sorts of private
> dependencies and is not easy to pull out into my own package. It
> appears that the pojosr implementation is just calling itself, or
> expecting another class to be available?  Any suggestions?
>
> thx
> ken
>
> On Thu, Dec 8, 2011 at 6:58 PM, Karl Pauls <ka...@gmail.com> wrote:
>> On Thu, Dec 8, 2011 at 8:59 AM, Ken Gilmer <kg...@gmail.com> wrote:
>>> Thanks Andreas, Karl, and Arjun!
>>>
>>> Andreas,
>>>
>>>  I spent some time learning the basics of Pax Exam.  One of my
>>> particular requirements is JUnit3/Java1.4.  I see it mentioned in a
>>> JIRA issue that support has been added but cannot find a suitable
>>> example of how this works.  Ideally for me, the Pax Exam documentation
>>> would contain the initial description of what Pax Exam is, and then
>>> want to see only a maven-based project with:
>>>
>>> a) a service definition (public api)
>>> b) some implementation (private)
>>> c) a test that gets the service and executes a method via junit
>>> d) the minimal POM that builds the regular bundle and also runs the junit test
>>>
>>>  The existing example code is helpful but doesn't really answer my
>>> immediate needs of getting started quickly, (as one who is not too
>>> familiar with Maven yet).
>>>
>>> Karl,
>>>
>>>  Regarding PojoSR, I probably do not need a full OSGi framework for
>>> my tests, so it could be suitable for me.  However I need a bit more
>>> guidance on how to set up running a test (I can visualize how to
>>> compose a test) in Maven.  Can you point me to an existing pom.xml
>>> that uses PojoSR to execute JUnit tests against a service?
>>
>> I guess there are (at least could be) several approaches which also
>> depend on your needs. One public example I know of is the work
>> Guillaume Nodet (and maybe others) did for fuse:
>>
>> https://github.com/fusesource/fuse/tree/master/fabric/fabric-itests/fabric-pojosr
>>
>> Does that help?
>>
>>>  Regarding bnd, it seems to utilize Ant makefiles.  I'd like to avoid
>>> that if possible.  Nothing against Ant, in fact I have my own
>>> Ant-based osgi test framework, but I'd like to keep the test stuff as
>>> simple as I can and keep things in Maven.
>>
>> It might not be impossible to hook it up to maven (if nothing else, by
>> executing the and file from there). I think it is mostly based on bnd
>> and the ant files are just very lightweight wrappers around it but I
>> can't say whether it would be easy or not. You can see an example in
>> ricks sandbox (the example requires you to use ant to execute the
>> tests but it uses maven to get the thing assembled iirc) :
>>
>> http://svn.apache.org/repos/asf/felix/sandbox/rickhall/bnd-test/
>>
>> regards,
>>
>> Karl
>>
>>> Arjun,
>>>
>>>  For me, the most difficult part is the Maven integration.  I want
>>> the tests to run and fail as part of the build.  In any case it's good
>>> to know you've got that, I'll check it out.
>>>
>>> thx,
>>> ken
>>>
>>>
>>>
>>> On Tue, Dec 6, 2011 at 6:56 PM, Karl Pauls <ka...@gmail.com> wrote:
>>>> To use PojoSR for testing with your dependencies from maven I guess
>>>> you could just use the exec-maven-plugin, hook it up to the test phase
>>>> and have it start with all dependencies from the test scope.
>>>>
>>>> regards,
>>>>
>>>> Karl
>>>>
>>>> On Tue, Dec 6, 2011 at 9:25 AM, Karl Pauls <ka...@gmail.com> wrote:
>>>>> If you are looking for real integration testing, Pax Exam is probably
>>>>> what you want.
>>>>>
>>>>> However, if you want to test you services without a full OSGi
>>>>> framework you might want to have  a look at PojoSR:
>>>>>
>>>>> http://pojosr.googlecode.com
>>>>>
>>>>> I know that some people use it for JUnit testing their services.
>>>>> Finally, bnd itself can be used for testing (we use that in the
>>>>> framework) and it is used by the OSGi ct.
>>>>>
>>>>> regards,
>>>>>
>>>>> Karl
>>>>>
>>>>> On Tue, Dec 6, 2011 at 9:17 AM, Andreas Pieber <an...@gmail.com> wrote:
>>>>>> Hey Ken,
>>>>>>
>>>>>> You might want to give Pax Exam a look for integration tests with OSGi:
>>>>>> http://team.ops4j.org/wiki/display/paxexam/Pax+Exam
>>>>>>
>>>>>> Kind regards,
>>>>>> Andreas
>>>>>>
>>>>>> On Tue, Dec 6, 2011 at 09:11, Ken Gilmer <kg...@gmail.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>>  I'd like to begin adding some test cases to the httplite bundle.  Ideally
>>>>>>> I'd like my tests executed within an OSGi context so I don't have to mock
>>>>>>> anything, and the test environment is as close as possible to a real
>>>>>>> instance.  Also I'd like my tests to execute as part of the maven build
>>>>>>> process.  Can anyone suggest an existing and somewhat current Felix project
>>>>>>> that does this or provide other suggestions?
>>>>>>>
>>>>>>> Thanks!
>>>>>>> ken
>>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Karl Pauls
>>>>> karlpauls@gmail.com
>>>>> http://twitter.com/karlpauls
>>>>> http://www.linkedin.com/in/karlpauls
>>>>> https://profiles.google.com/karlpauls
>>>>
>>>>
>>>>
>>>> --
>>>> Karl Pauls
>>>> karlpauls@gmail.com
>>>> http://twitter.com/karlpauls
>>>> http://www.linkedin.com/in/karlpauls
>>>> https://profiles.google.com/karlpauls
>>
>>
>>
>> --
>> Karl Pauls
>> karlpauls@gmail.com
>> http://twitter.com/karlpauls
>> http://www.linkedin.com/in/karlpauls
>> https://profiles.google.com/karlpauls



-- 
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

Re: Suggestions on OSGi-context testing

Posted by Ken Gilmer <kg...@gmail.com>.
Hi Karl,

  Thanks for the additional guidance.  So I spent some time setting up
a vanilla maven osgi bundle project.  I was able to add pojosr and
create a simple test case that started my bundle, retrieved the
service via the pojosr service registry, and executed the service.

  I then moved to integrating pojosr into httplite so I could begin
writing tests.  As my bundle starts in my test case, I ran into a
problem where "org.osgi.vendor.framework" is an undefined system
property.  I did some digging and determined that the FrameworkUtil
class tries to be dynamically loaded based on the root classname as
defined by "org.osgi.vendor.framework".  Setting to this to
"org.osgi.framework", (which is the root package name for the class
contained in pojosr) resulted in a stack overflow.  The FrameworkUtil
in the Felix framework is available but has all sorts of private
dependencies and is not easy to pull out into my own package. It
appears that the pojosr implementation is just calling itself, or
expecting another class to be available?  Any suggestions?

thx
ken

On Thu, Dec 8, 2011 at 6:58 PM, Karl Pauls <ka...@gmail.com> wrote:
> On Thu, Dec 8, 2011 at 8:59 AM, Ken Gilmer <kg...@gmail.com> wrote:
>> Thanks Andreas, Karl, and Arjun!
>>
>> Andreas,
>>
>>  I spent some time learning the basics of Pax Exam.  One of my
>> particular requirements is JUnit3/Java1.4.  I see it mentioned in a
>> JIRA issue that support has been added but cannot find a suitable
>> example of how this works.  Ideally for me, the Pax Exam documentation
>> would contain the initial description of what Pax Exam is, and then
>> want to see only a maven-based project with:
>>
>> a) a service definition (public api)
>> b) some implementation (private)
>> c) a test that gets the service and executes a method via junit
>> d) the minimal POM that builds the regular bundle and also runs the junit test
>>
>>  The existing example code is helpful but doesn't really answer my
>> immediate needs of getting started quickly, (as one who is not too
>> familiar with Maven yet).
>>
>> Karl,
>>
>>  Regarding PojoSR, I probably do not need a full OSGi framework for
>> my tests, so it could be suitable for me.  However I need a bit more
>> guidance on how to set up running a test (I can visualize how to
>> compose a test) in Maven.  Can you point me to an existing pom.xml
>> that uses PojoSR to execute JUnit tests against a service?
>
> I guess there are (at least could be) several approaches which also
> depend on your needs. One public example I know of is the work
> Guillaume Nodet (and maybe others) did for fuse:
>
> https://github.com/fusesource/fuse/tree/master/fabric/fabric-itests/fabric-pojosr
>
> Does that help?
>
>>  Regarding bnd, it seems to utilize Ant makefiles.  I'd like to avoid
>> that if possible.  Nothing against Ant, in fact I have my own
>> Ant-based osgi test framework, but I'd like to keep the test stuff as
>> simple as I can and keep things in Maven.
>
> It might not be impossible to hook it up to maven (if nothing else, by
> executing the and file from there). I think it is mostly based on bnd
> and the ant files are just very lightweight wrappers around it but I
> can't say whether it would be easy or not. You can see an example in
> ricks sandbox (the example requires you to use ant to execute the
> tests but it uses maven to get the thing assembled iirc) :
>
> http://svn.apache.org/repos/asf/felix/sandbox/rickhall/bnd-test/
>
> regards,
>
> Karl
>
>> Arjun,
>>
>>  For me, the most difficult part is the Maven integration.  I want
>> the tests to run and fail as part of the build.  In any case it's good
>> to know you've got that, I'll check it out.
>>
>> thx,
>> ken
>>
>>
>>
>> On Tue, Dec 6, 2011 at 6:56 PM, Karl Pauls <ka...@gmail.com> wrote:
>>> To use PojoSR for testing with your dependencies from maven I guess
>>> you could just use the exec-maven-plugin, hook it up to the test phase
>>> and have it start with all dependencies from the test scope.
>>>
>>> regards,
>>>
>>> Karl
>>>
>>> On Tue, Dec 6, 2011 at 9:25 AM, Karl Pauls <ka...@gmail.com> wrote:
>>>> If you are looking for real integration testing, Pax Exam is probably
>>>> what you want.
>>>>
>>>> However, if you want to test you services without a full OSGi
>>>> framework you might want to have  a look at PojoSR:
>>>>
>>>> http://pojosr.googlecode.com
>>>>
>>>> I know that some people use it for JUnit testing their services.
>>>> Finally, bnd itself can be used for testing (we use that in the
>>>> framework) and it is used by the OSGi ct.
>>>>
>>>> regards,
>>>>
>>>> Karl
>>>>
>>>> On Tue, Dec 6, 2011 at 9:17 AM, Andreas Pieber <an...@gmail.com> wrote:
>>>>> Hey Ken,
>>>>>
>>>>> You might want to give Pax Exam a look for integration tests with OSGi:
>>>>> http://team.ops4j.org/wiki/display/paxexam/Pax+Exam
>>>>>
>>>>> Kind regards,
>>>>> Andreas
>>>>>
>>>>> On Tue, Dec 6, 2011 at 09:11, Ken Gilmer <kg...@gmail.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>  I'd like to begin adding some test cases to the httplite bundle.  Ideally
>>>>>> I'd like my tests executed within an OSGi context so I don't have to mock
>>>>>> anything, and the test environment is as close as possible to a real
>>>>>> instance.  Also I'd like my tests to execute as part of the maven build
>>>>>> process.  Can anyone suggest an existing and somewhat current Felix project
>>>>>> that does this or provide other suggestions?
>>>>>>
>>>>>> Thanks!
>>>>>> ken
>>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Karl Pauls
>>>> karlpauls@gmail.com
>>>> http://twitter.com/karlpauls
>>>> http://www.linkedin.com/in/karlpauls
>>>> https://profiles.google.com/karlpauls
>>>
>>>
>>>
>>> --
>>> Karl Pauls
>>> karlpauls@gmail.com
>>> http://twitter.com/karlpauls
>>> http://www.linkedin.com/in/karlpauls
>>> https://profiles.google.com/karlpauls
>
>
>
> --
> Karl Pauls
> karlpauls@gmail.com
> http://twitter.com/karlpauls
> http://www.linkedin.com/in/karlpauls
> https://profiles.google.com/karlpauls

Re: Suggestions on OSGi-context testing

Posted by Karl Pauls <ka...@gmail.com>.
On Thu, Dec 8, 2011 at 8:59 AM, Ken Gilmer <kg...@gmail.com> wrote:
> Thanks Andreas, Karl, and Arjun!
>
> Andreas,
>
>  I spent some time learning the basics of Pax Exam.  One of my
> particular requirements is JUnit3/Java1.4.  I see it mentioned in a
> JIRA issue that support has been added but cannot find a suitable
> example of how this works.  Ideally for me, the Pax Exam documentation
> would contain the initial description of what Pax Exam is, and then
> want to see only a maven-based project with:
>
> a) a service definition (public api)
> b) some implementation (private)
> c) a test that gets the service and executes a method via junit
> d) the minimal POM that builds the regular bundle and also runs the junit test
>
>  The existing example code is helpful but doesn't really answer my
> immediate needs of getting started quickly, (as one who is not too
> familiar with Maven yet).
>
> Karl,
>
>  Regarding PojoSR, I probably do not need a full OSGi framework for
> my tests, so it could be suitable for me.  However I need a bit more
> guidance on how to set up running a test (I can visualize how to
> compose a test) in Maven.  Can you point me to an existing pom.xml
> that uses PojoSR to execute JUnit tests against a service?

I guess there are (at least could be) several approaches which also
depend on your needs. One public example I know of is the work
Guillaume Nodet (and maybe others) did for fuse:

https://github.com/fusesource/fuse/tree/master/fabric/fabric-itests/fabric-pojosr

Does that help?

>  Regarding bnd, it seems to utilize Ant makefiles.  I'd like to avoid
> that if possible.  Nothing against Ant, in fact I have my own
> Ant-based osgi test framework, but I'd like to keep the test stuff as
> simple as I can and keep things in Maven.

It might not be impossible to hook it up to maven (if nothing else, by
executing the and file from there). I think it is mostly based on bnd
and the ant files are just very lightweight wrappers around it but I
can't say whether it would be easy or not. You can see an example in
ricks sandbox (the example requires you to use ant to execute the
tests but it uses maven to get the thing assembled iirc) :

http://svn.apache.org/repos/asf/felix/sandbox/rickhall/bnd-test/

regards,

Karl

> Arjun,
>
>  For me, the most difficult part is the Maven integration.  I want
> the tests to run and fail as part of the build.  In any case it's good
> to know you've got that, I'll check it out.
>
> thx,
> ken
>
>
>
> On Tue, Dec 6, 2011 at 6:56 PM, Karl Pauls <ka...@gmail.com> wrote:
>> To use PojoSR for testing with your dependencies from maven I guess
>> you could just use the exec-maven-plugin, hook it up to the test phase
>> and have it start with all dependencies from the test scope.
>>
>> regards,
>>
>> Karl
>>
>> On Tue, Dec 6, 2011 at 9:25 AM, Karl Pauls <ka...@gmail.com> wrote:
>>> If you are looking for real integration testing, Pax Exam is probably
>>> what you want.
>>>
>>> However, if you want to test you services without a full OSGi
>>> framework you might want to have  a look at PojoSR:
>>>
>>> http://pojosr.googlecode.com
>>>
>>> I know that some people use it for JUnit testing their services.
>>> Finally, bnd itself can be used for testing (we use that in the
>>> framework) and it is used by the OSGi ct.
>>>
>>> regards,
>>>
>>> Karl
>>>
>>> On Tue, Dec 6, 2011 at 9:17 AM, Andreas Pieber <an...@gmail.com> wrote:
>>>> Hey Ken,
>>>>
>>>> You might want to give Pax Exam a look for integration tests with OSGi:
>>>> http://team.ops4j.org/wiki/display/paxexam/Pax+Exam
>>>>
>>>> Kind regards,
>>>> Andreas
>>>>
>>>> On Tue, Dec 6, 2011 at 09:11, Ken Gilmer <kg...@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>>  I'd like to begin adding some test cases to the httplite bundle.  Ideally
>>>>> I'd like my tests executed within an OSGi context so I don't have to mock
>>>>> anything, and the test environment is as close as possible to a real
>>>>> instance.  Also I'd like my tests to execute as part of the maven build
>>>>> process.  Can anyone suggest an existing and somewhat current Felix project
>>>>> that does this or provide other suggestions?
>>>>>
>>>>> Thanks!
>>>>> ken
>>>>>
>>>
>>>
>>>
>>> --
>>> Karl Pauls
>>> karlpauls@gmail.com
>>> http://twitter.com/karlpauls
>>> http://www.linkedin.com/in/karlpauls
>>> https://profiles.google.com/karlpauls
>>
>>
>>
>> --
>> Karl Pauls
>> karlpauls@gmail.com
>> http://twitter.com/karlpauls
>> http://www.linkedin.com/in/karlpauls
>> https://profiles.google.com/karlpauls



-- 
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

Re: Suggestions on OSGi-context testing

Posted by Andreas Pieber <an...@gmail.com>.
Hey Ken,

I don't think that exam 2.x runs with java < 1.5.

For source examples though
https://github.com/ops4j/org.ops4j.pax.exam2/tree/master/it-regression is a
good starting point.

Kind regards,
Andreas

On Thu, Dec 8, 2011 at 08:59, Ken Gilmer <kg...@gmail.com> wrote:

> Thanks Andreas, Karl, and Arjun!
>
> Andreas,
>
>  I spent some time learning the basics of Pax Exam.  One of my
> particular requirements is JUnit3/Java1.4.  I see it mentioned in a
> JIRA issue that support has been added but cannot find a suitable
> example of how this works.  Ideally for me, the Pax Exam documentation
> would contain the initial description of what Pax Exam is, and then
> want to see only a maven-based project with:
>
> a) a service definition (public api)
> b) some implementation (private)
> c) a test that gets the service and executes a method via junit
> d) the minimal POM that builds the regular bundle and also runs the junit
> test
>
>  The existing example code is helpful but doesn't really answer my
> immediate needs of getting started quickly, (as one who is not too
> familiar with Maven yet).
>
> Karl,
>
>  Regarding PojoSR, I probably do not need a full OSGi framework for
> my tests, so it could be suitable for me.  However I need a bit more
> guidance on how to set up running a test (I can visualize how to
> compose a test) in Maven.  Can you point me to an existing pom.xml
> that uses PojoSR to execute JUnit tests against a service?
>
>  Regarding bnd, it seems to utilize Ant makefiles.  I'd like to avoid
> that if possible.  Nothing against Ant, in fact I have my own
> Ant-based osgi test framework, but I'd like to keep the test stuff as
> simple as I can and keep things in Maven.
>
> Arjun,
>
>  For me, the most difficult part is the Maven integration.  I want
> the tests to run and fail as part of the build.  In any case it's good
> to know you've got that, I'll check it out.
>
> thx,
> ken
>
>
>
> On Tue, Dec 6, 2011 at 6:56 PM, Karl Pauls <ka...@gmail.com> wrote:
> > To use PojoSR for testing with your dependencies from maven I guess
> > you could just use the exec-maven-plugin, hook it up to the test phase
> > and have it start with all dependencies from the test scope.
> >
> > regards,
> >
> > Karl
> >
> > On Tue, Dec 6, 2011 at 9:25 AM, Karl Pauls <ka...@gmail.com> wrote:
> >> If you are looking for real integration testing, Pax Exam is probably
> >> what you want.
> >>
> >> However, if you want to test you services without a full OSGi
> >> framework you might want to have  a look at PojoSR:
> >>
> >> http://pojosr.googlecode.com
> >>
> >> I know that some people use it for JUnit testing their services.
> >> Finally, bnd itself can be used for testing (we use that in the
> >> framework) and it is used by the OSGi ct.
> >>
> >> regards,
> >>
> >> Karl
> >>
> >> On Tue, Dec 6, 2011 at 9:17 AM, Andreas Pieber <an...@gmail.com>
> wrote:
> >>> Hey Ken,
> >>>
> >>> You might want to give Pax Exam a look for integration tests with OSGi:
> >>> http://team.ops4j.org/wiki/display/paxexam/Pax+Exam
> >>>
> >>> Kind regards,
> >>> Andreas
> >>>
> >>> On Tue, Dec 6, 2011 at 09:11, Ken Gilmer <kg...@gmail.com> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>>  I'd like to begin adding some test cases to the httplite bundle.
>  Ideally
> >>>> I'd like my tests executed within an OSGi context so I don't have to
> mock
> >>>> anything, and the test environment is as close as possible to a real
> >>>> instance.  Also I'd like my tests to execute as part of the maven
> build
> >>>> process.  Can anyone suggest an existing and somewhat current Felix
> project
> >>>> that does this or provide other suggestions?
> >>>>
> >>>> Thanks!
> >>>> ken
> >>>>
> >>
> >>
> >>
> >> --
> >> Karl Pauls
> >> karlpauls@gmail.com
> >> http://twitter.com/karlpauls
> >> http://www.linkedin.com/in/karlpauls
> >> https://profiles.google.com/karlpauls
> >
> >
> >
> > --
> > Karl Pauls
> > karlpauls@gmail.com
> > http://twitter.com/karlpauls
> > http://www.linkedin.com/in/karlpauls
> > https://profiles.google.com/karlpauls
>

Re: Suggestions on OSGi-context testing

Posted by Ken Gilmer <kg...@gmail.com>.
Thanks Andreas, Karl, and Arjun!

Andreas,

  I spent some time learning the basics of Pax Exam.  One of my
particular requirements is JUnit3/Java1.4.  I see it mentioned in a
JIRA issue that support has been added but cannot find a suitable
example of how this works.  Ideally for me, the Pax Exam documentation
would contain the initial description of what Pax Exam is, and then
want to see only a maven-based project with:

a) a service definition (public api)
b) some implementation (private)
c) a test that gets the service and executes a method via junit
d) the minimal POM that builds the regular bundle and also runs the junit test

  The existing example code is helpful but doesn't really answer my
immediate needs of getting started quickly, (as one who is not too
familiar with Maven yet).

Karl,

  Regarding PojoSR, I probably do not need a full OSGi framework for
my tests, so it could be suitable for me.  However I need a bit more
guidance on how to set up running a test (I can visualize how to
compose a test) in Maven.  Can you point me to an existing pom.xml
that uses PojoSR to execute JUnit tests against a service?

  Regarding bnd, it seems to utilize Ant makefiles.  I'd like to avoid
that if possible.  Nothing against Ant, in fact I have my own
Ant-based osgi test framework, but I'd like to keep the test stuff as
simple as I can and keep things in Maven.

Arjun,

  For me, the most difficult part is the Maven integration.  I want
the tests to run and fail as part of the build.  In any case it's good
to know you've got that, I'll check it out.

thx,
ken



On Tue, Dec 6, 2011 at 6:56 PM, Karl Pauls <ka...@gmail.com> wrote:
> To use PojoSR for testing with your dependencies from maven I guess
> you could just use the exec-maven-plugin, hook it up to the test phase
> and have it start with all dependencies from the test scope.
>
> regards,
>
> Karl
>
> On Tue, Dec 6, 2011 at 9:25 AM, Karl Pauls <ka...@gmail.com> wrote:
>> If you are looking for real integration testing, Pax Exam is probably
>> what you want.
>>
>> However, if you want to test you services without a full OSGi
>> framework you might want to have  a look at PojoSR:
>>
>> http://pojosr.googlecode.com
>>
>> I know that some people use it for JUnit testing their services.
>> Finally, bnd itself can be used for testing (we use that in the
>> framework) and it is used by the OSGi ct.
>>
>> regards,
>>
>> Karl
>>
>> On Tue, Dec 6, 2011 at 9:17 AM, Andreas Pieber <an...@gmail.com> wrote:
>>> Hey Ken,
>>>
>>> You might want to give Pax Exam a look for integration tests with OSGi:
>>> http://team.ops4j.org/wiki/display/paxexam/Pax+Exam
>>>
>>> Kind regards,
>>> Andreas
>>>
>>> On Tue, Dec 6, 2011 at 09:11, Ken Gilmer <kg...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>>  I'd like to begin adding some test cases to the httplite bundle.  Ideally
>>>> I'd like my tests executed within an OSGi context so I don't have to mock
>>>> anything, and the test environment is as close as possible to a real
>>>> instance.  Also I'd like my tests to execute as part of the maven build
>>>> process.  Can anyone suggest an existing and somewhat current Felix project
>>>> that does this or provide other suggestions?
>>>>
>>>> Thanks!
>>>> ken
>>>>
>>
>>
>>
>> --
>> Karl Pauls
>> karlpauls@gmail.com
>> http://twitter.com/karlpauls
>> http://www.linkedin.com/in/karlpauls
>> https://profiles.google.com/karlpauls
>
>
>
> --
> Karl Pauls
> karlpauls@gmail.com
> http://twitter.com/karlpauls
> http://www.linkedin.com/in/karlpauls
> https://profiles.google.com/karlpauls

Re: Suggestions on OSGi-context testing

Posted by Karl Pauls <ka...@gmail.com>.
To use PojoSR for testing with your dependencies from maven I guess
you could just use the exec-maven-plugin, hook it up to the test phase
and have it start with all dependencies from the test scope.

regards,

Karl

On Tue, Dec 6, 2011 at 9:25 AM, Karl Pauls <ka...@gmail.com> wrote:
> If you are looking for real integration testing, Pax Exam is probably
> what you want.
>
> However, if you want to test you services without a full OSGi
> framework you might want to have  a look at PojoSR:
>
> http://pojosr.googlecode.com
>
> I know that some people use it for JUnit testing their services.
> Finally, bnd itself can be used for testing (we use that in the
> framework) and it is used by the OSGi ct.
>
> regards,
>
> Karl
>
> On Tue, Dec 6, 2011 at 9:17 AM, Andreas Pieber <an...@gmail.com> wrote:
>> Hey Ken,
>>
>> You might want to give Pax Exam a look for integration tests with OSGi:
>> http://team.ops4j.org/wiki/display/paxexam/Pax+Exam
>>
>> Kind regards,
>> Andreas
>>
>> On Tue, Dec 6, 2011 at 09:11, Ken Gilmer <kg...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>>  I'd like to begin adding some test cases to the httplite bundle.  Ideally
>>> I'd like my tests executed within an OSGi context so I don't have to mock
>>> anything, and the test environment is as close as possible to a real
>>> instance.  Also I'd like my tests to execute as part of the maven build
>>> process.  Can anyone suggest an existing and somewhat current Felix project
>>> that does this or provide other suggestions?
>>>
>>> Thanks!
>>> ken
>>>
>
>
>
> --
> Karl Pauls
> karlpauls@gmail.com
> http://twitter.com/karlpauls
> http://www.linkedin.com/in/karlpauls
> https://profiles.google.com/karlpauls



-- 
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

Re: Suggestions on OSGi-context testing

Posted by Karl Pauls <ka...@gmail.com>.
If you are looking for real integration testing, Pax Exam is probably
what you want.

However, if you want to test you services without a full OSGi
framework you might want to have  a look at PojoSR:

http://pojosr.googlecode.com

I know that some people use it for JUnit testing their services.
Finally, bnd itself can be used for testing (we use that in the
framework) and it is used by the OSGi ct.

regards,

Karl

On Tue, Dec 6, 2011 at 9:17 AM, Andreas Pieber <an...@gmail.com> wrote:
> Hey Ken,
>
> You might want to give Pax Exam a look for integration tests with OSGi:
> http://team.ops4j.org/wiki/display/paxexam/Pax+Exam
>
> Kind regards,
> Andreas
>
> On Tue, Dec 6, 2011 at 09:11, Ken Gilmer <kg...@gmail.com> wrote:
>
>> Hi,
>>
>>  I'd like to begin adding some test cases to the httplite bundle.  Ideally
>> I'd like my tests executed within an OSGi context so I don't have to mock
>> anything, and the test environment is as close as possible to a real
>> instance.  Also I'd like my tests to execute as part of the maven build
>> process.  Can anyone suggest an existing and somewhat current Felix project
>> that does this or provide other suggestions?
>>
>> Thanks!
>> ken
>>



-- 
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

Re: Suggestions on OSGi-context testing

Posted by Andreas Pieber <an...@gmail.com>.
Hey Ken,

You might want to give Pax Exam a look for integration tests with OSGi:
http://team.ops4j.org/wiki/display/paxexam/Pax+Exam

Kind regards,
Andreas

On Tue, Dec 6, 2011 at 09:11, Ken Gilmer <kg...@gmail.com> wrote:

> Hi,
>
>  I'd like to begin adding some test cases to the httplite bundle.  Ideally
> I'd like my tests executed within an OSGi context so I don't have to mock
> anything, and the test environment is as close as possible to a real
> instance.  Also I'd like my tests to execute as part of the maven build
> process.  Can anyone suggest an existing and somewhat current Felix project
> that does this or provide other suggestions?
>
> Thanks!
> ken
>

Re: Suggestions on OSGi-context testing

Posted by Arjun Panday <ar...@alcatel-lucent.com>.
Hi Ken,

The webconsole-plugins/servicediagnostics/sample/ subproject has a small 
Felix launcher that will install and start any bundle you give it as 
arguments.

I've been using this for unit testing, by calling junit from within an 
activator, after being injected with all the dependencies required for 
the test.

Don't know if it fits your needs, but I found this to be the most 
lightweight approach. (Not sure about the maven integration though, 
since i'm not yet super familiar with maven).

-arjun


On 12/06/2011 09:11 AM, Ken Gilmer wrote:
> Hi,
>
>    I'd like to begin adding some test cases to the httplite bundle.  Ideally
> I'd like my tests executed within an OSGi context so I don't have to mock
> anything, and the test environment is as close as possible to a real
> instance.  Also I'd like my tests to execute as part of the maven build
> process.  Can anyone suggest an existing and somewhat current Felix project
> that does this or provide other suggestions?
>
> Thanks!
> ken