db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <kristian.waa...@oracle.com>
Subject Re: Testing Derby OSGi bundle
Date Tue, 31 Jul 2012 10:35:28 GMT
On 31.07.2012 10:45, Mohamed Nufail wrote:
> Hi,
> For the next part of my GSoC project I'm focusing on testing the Derby 
> OSGi bundle.
> I believe what's required in this case is to make sure the Derby 
> bundle operates correctly in an OSGi environment. So what is needed is 
> to install Derby in an OSGi framework and check if it installs 
> correctly and have its basic functionality.
> I found the Pax Exam framework [1] can be used to achieve this easily. 
> Using Pax Exam we could write a normal JUnit test and it will start an 
> OSGi framework and installs a set of bundles we specify (which would 
> include the Derby bundle in this case) and then the JUnit test will be 
> installed as a bundle. Then the tests would be invoked.
> But the problem is Pax Exam is based on JUnit 4 and Derby uses JUnit 3 
> I think.
> Any ideas regarding this would be appreciated.

Hi Nufail,

JUnit 3 is pretty old by now, but I think the reason why we're holding 
on to it is because we support JSR 169 / Java ME. This platform is 
currently based on J2SE 1.4 (i.e. no support for annotations).

That said, I believe JUnit 4 is backwards compatible with JUnit 3. This 
means you can write your JUnit 4 specific test, make sure it's compiled 
at/to level 1.5, and then run it (standalone or together with other 
existing Derby tests). With a little extra code in the Derby JUnit 
framework, you could make the test run only if JUnit 4 is on the 
classpath and ignore it otherwise.

I haven't actually tried this, so I don't know what kind of challenges 
you'll run into :)

Testing Derby's support for OSGi would be a very welcome effort, as I 
believe the current tests in that area are lacking. We've also seen some 
JIRA issues filed related to OSGi.


> Thanks,
> Nufail.
> [1] http://team.ops4j.org/wiki/display/paxexam/Pax+Exam
> -- 
> Mohamed Nufail
> Undergraduate,
> Department of Computer Science & Engineering,
> University of Moratuwa.
> Blog: http://www.nufailm.blogspot.com/

View raw message