Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gemini-dev] gemini tests

Hi guys,

Bob summarized things pretty well. The biggest advantage of the testing
framework is that it executes everything in process which means there
are no performance penalties, no conversion or serialization and
basically no limitations to what you can do.
As opposed to other approaches out there, one can do local debugging
inside the IDE just as with any java program - set the breakpoint and
run the test.

The dependencies are fairly minimal and includes some OSGi utils from
Spring DM and its dependencies since the project was created mainly for
Spring DM.
These potentially can be eliminated assuming the framework need to be
more generic as the core doesn't depend on Spring DM but rather on JUnit
and the OSGi APIs - as far as the framework is concerned Spring DM is
just a mandatory set of bundles that needs to be installed at startup.

The biggest downsides so far is that the framework is based on JUnit 3.
We had several requests to port it to JUnit 4 (so one could use
annotations rather then base classes) but we never got around it - if
anybody wants to step in, please do so.

Cheers,

On 6/18/2010 8:50 PM, Bob Nettleton wrote:
> Hi Mike,
> 
> The Spring OSGi Test framework is based on Junit, with additional subclasses of TestCase that are used to setup/configure the OSGi environment.  I'm not sure if there is a common method of porting existing Junit test cases to this framework, but I was able to move over my tests with a minimum of effort.  
> 
>>From the perspective of the Gemini Naming tests, the synthetic bundle stuff hasn't really been a problem for me, but I believe the framework allows for some control over the way that bundle's manifest is created.  
> 
> I've used the Spring OSGi Test framework in another internal project, and if memory serves me correctly I just used maven options to set the JDWP remote debug flags in order to enable remote debugging.  
> 
> The Gemini Naming tests use maven as the build tool, and I was able to create a new sub-project in maven that includes the test case code underneath the src/test directory of the project.  Maven picks up on this and automatically executes the tests as Junit tests.  Maven will report the basic status of the test run, but the actual list of test results is found in an xml file underneath the project's "target/surefire-reports" directory.  There may be ways to modify the way that the test results are displayed in maven, but we'd probably have to ask a maven expert about that.  :)  
> 
> I don't think that the test framework depends upon Spring-DM, but Costin and Glyn could probably confirm that.  My experience with the framework has shown that there are a few runtime dependencies needed to execute tests: ASM, spring-osgi-extender, Apache Logging, spring-osgi-annotation.  These test dependencies are captured in the CQs I filed for the Gemini Naming project.  
> 
> hope this helps,
> thanks,
> Bob 
> 
>> -----Original Message-----
>> From: Michael Keith
>> Sent: Friday, June 18, 2010 11:03 AM
>> To: Gemini Dev List
>> Subject: [gemini-dev] gemini tests
>>
>> Hi all,
>>
>> I know that Bob, you are using the Spring OSGi test framework, and the
>> mocks, and I assume that Costin is also using this framework. Glyn, are
>> you using it as well?
>>
>> I may actually get some testing resources for the Gemini JPA project,
>> since EclipseLink wants to make use of the Gemini code and wants some
>> testing done on it. We were considering suggesting the Spring OSGi test
>> framework for their QA but have some questions:
>>
>> - The tests need to extend a framework class, and that seems kind of
>> hard to fit existing tests into. Is there a common delegate or
>> workaround to get around this?
>> - With a bundle getting synthesized and installed at test execution
>> time
>> I am worried about the magic being confusing to the QA people. Is this
>> a
>> valid concern?
>> - With a generated bundle being installed that includes the tests, I
>> was
>> wondering how hard it would be for QA folks to debug when things go
>> south during a test?
>> - Do the results surface in a way that QA would be able to see an
>> automated test result and determine where things went wrong (for
>> example
>> if the framework didn't start)?
>> - I assume that it doesn't have dependencies on Spring DM. What about
>> other third party jars?
>>
>> Any input will be appreciated.
>>
>> Thanks,
>> -Mike
>> _______________________________________________
>> gemini-dev mailing list
>> gemini-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/gemini-dev
> _______________________________________________
> gemini-dev mailing list
> gemini-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/gemini-dev

-- 
Costin


Back to the top