views:

318

answers:

4

I'm considering implementing one or two JSR APIs. I have not yet read the entire specification (the plan is to read them as I code the implementation) but I am very familiar with them. I have read that the JSR process includes implementing a Test Compatibility Kit (TCK) for testing said JSR implementations.

Before I start writing a bunch of unit tests to verify the correctness/completeness of my implementation I would really like to use this TCK but I have no idea if it is available for me. After downloading all files and googling around I could not find anything that could be defined as a TCK for the given JSR.

So my question is basically: What steps do I need to do in order to produce my own implementation of a JSR spec and how do I verify that I have indeed done so.

For what it's worth, I am considering implementing JSR-168 and JSR-286, but I think that is not relevant for this question.

A: 

Why do you want to implement a spec if there is already a working implementation ? Seems like a lot of needless work for little benefit...

mP
There are indeed many implementations, but they are not suitable for what I want to do.
pjesi
Well if they dont do what you want - maybe you are selecting the wrong product. If the spec says that something must offer features and the implementators do this and you dont like any of them, why do you value the spec ?
mP
*that* not *the* spec. Im just saying perhaps the answer is as simple as you need to look somewhere else...
mP
Not that I know details here, but implementing a JSR has its benefits -- if you are planning on implementing the thing anyway, and spec (API) is good enough (but impl(s) not), why not use it? It can help adoption significantly, too - -"non-standard" alternatives often have to explain why they don't support "the standard API".
StaxMan
Why implement a spec that doesnt do what you want ? It seems thats a sign one should move on and find something else.
mP
The implementations depend on various things I do not have in my environment. For example, they usually require to be installed directly in Tomcat but I only have control over one webapp. I am trying to embed Pluto in the application but that requires similar effort as writing a new implementation.
pjesi
+6  A: 

What you may need to do, is to contact the spec lead for the given JSR. They can give you more information on obtaining a TCK.

It may be that you have to pay a license to obtain access to the TCK. Certainly with the Java SE specification, Sun does indeed charge a license fee for the TCK, unless you qualify as a non-profit organization to receive it for free.

That said, I believe it varies from JSR to JSR, so as I said above, the best bet is to contact the JSR spec lead.

Martin OConnor
Correct. For what it's worth, TCKs are not always worth a lot -- I am most familiar with the situation with JSR-173, and as far as I know, TCK for it is not all that useful. Rather, open source test suite (StaxTest) has much more extensive coverage, being freely available.But this may be just be an isolated instance.
StaxMan
Still, strictly, passing the TCK is the only official way to demonstrate that your code is in compliance with the JSR.
Martin OConnor
+3  A: 

Wow, this is a very ambitious project, usually taken over by companies or big open source teams. If you are determined enough to do it, I recommend that you have a look at some open source implementations. The mentioned JSRs are implemented by Pluto. It may worth to have a look at the source distribution.

kgiannakakis
Thanks. I will indeed look at the open source implementations in more detail.
pjesi
+2  A: 

Apologies in davance for the worst case scenario I'm going to present.

From having done this quite a few times before, I strongly advise not writing a single line of code before you have read not only the spec but any kind of e-mail archive from the JSR expert group.

JSR specifications are usually full of ambiguity and can be interpreted in a number of different ways. Going through it in a very methodical way will let you ask relevant questions to the expert group soon enough before it disbands and becomes unresponsive, hopefully.

The TCK is typically a set of tests that does not ensure your implementation even remotely works, it just says you are a legal implementation of the specifications.

TCKs are typically too expensive for a single individual to buy.

Obivously, the way to implement the JSR will depend on what operating system and what virtual machine you are targetting. The nicer JSRs are usually the ones that can be implemented in pure Java.

Good luck!

QuickRecipesOnSymbianOS