You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Pierre Leman <pi...@gmail.com> on 2008/05/28 12:14:22 UTC

Unit testing of a custom SPI implementation

Hi,


As I'm currently working on writing a custom SPI implementation, I was
wondering on the best way to do unit testing in order to test if my
implementation do what it's figured to do.
I saw that some unit tests are already written in the jcr2spi package, the
package which allow to bootstrap the SPI implementation, but that the
JackRabbit implementation also provide general purpose unit tests in the
jcr-tests package.
As the jcr2spi's aim is to provide a JCR API to a content application while
a part of the 'backoffice' have to be handled manually implementing the SPI
interfaces, I was thinking of running tests at two levels :
- Firstly internally by running the jcr2spi package unit tests (in the same
time content application and SPI implementation's point of view ?)
- Secondly externally by running the jcr-tests package unit tests (content
application's point of view)
Do you think I'm in the right way ?

I was considering these other ways :
- Using only the jcr2spi unit tests (maybe they are sufficient to test a SPI
implementation) ?
- Writing custom tests (possibly reusing the current and adapting it to my
needs) ?

I also have general questions on the unit tests currently implemented :
- How the JCR's compliance levels are taken into consideration in the unit
tests (in the contingency as I would be able to test a level 1 only SPI
implementation) ?

Thank you in advance for your answers,
Pierre

Re: Unit testing of a custom SPI implementation

Posted by Angela Schreiber <an...@day.com>.
hi pierre

> Sorry to learn that there isn't any existing test-suite that could validates
> any SPI implementation.

sorry for that.
i will open an issue and see whether we can start with
some simple setup that can be extended based on questions
and problems arising on the jackrabbit mailing lists...

i will keep you informed.
angela




Re: Unit testing of a custom SPI implementation

Posted by Pierre Leman <pi...@gmail.com>.
Hi angela,


First, thank you for all.
I have created a JIRA account and voted for this issue.
Keep listening news on this issue for the future.

Best regards,
Pierre

Re: Unit testing of a custom SPI implementation

Posted by Angela Schreiber <an...@day.com>.
hi pierre

https://issues.apache.org/jira/browse/JCR-1629

is the corresponding feature request.
angela


Re: Unit testing of a custom SPI implementation

Posted by Pierre Leman <pi...@gmail.com>.
Hi Angela,


Sorry to learn that there isn't any existing test-suite that could validates
any SPI implementation.
I was searching it precisely as I wasn't sure of the correctness of my
implementation, so concerning the idea of writing a generic test-suite for
this purpose by myself, I think I am probably not the good person to ask for
that for the moment. Sorry ;)
I will try to write a small test-suite for the purpose of testing directly
my SPI implementation and I will use jointly the jackrabbit-jcr-test for the
indirect tests.

Regards,
Pierre

Re: Unit testing of a custom SPI implementation

Posted by Angela Schreiber <an...@day.com>.
hi pierre

first of all:
up to now there is not test-suite that validates an SPI
implementation nor do we have tests that run on the SPI
directly (contributions would be welcome).

the jcr2spi test suite consists of

- all tests from jackrabbit-jcr-test
- additional test for the JCR API that are not covered by
   the tests in jackrabbit-jcr-test
- implementation specific test for jcr2spi covering areas
   where the JSR 170 leaves the details to the impl.

consequently, the SPI implementation is only indirectly
tested.

if you want to start testing your SPI implementation
specifically, would have to write your own tests (sorry).

if you want to rely on the jcr-test (indirect SPI test):
the tests in jackrabbit-jcr-test have a javadoc comment
indicating the compliance level: @keywords.
@keywords level1 covers read-only tests as far as i know.

hope that helps
angela