Skip to main content

JSR References

6 replies [Last post]
mhuebner
Offline
Joined: 2009-07-02
Points: 0

Hi everyone,

I have to say JDTF looks very promising, but I have run into a problem with my configuration. Maybe someone can give me a hint into the correct direction.

When I am compiling my testsuite, I am missing the jar files for the specific jsr implementations. I have changed build.xml to include the jsr's I need, but that can only be a temporary solution. Are JSR's supposed to be referenced automatically, or did I miss to add an anotation or something similar.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ivan_veselovsky
Offline
Joined: 2007-12-06
Points: 0

The JSR libs that are needed for testpack building should be specified in file "/build/environment.properties" using the property "client.platform.classes".
Typically, libraries are specified relative to the "client.platform.lib" location, like this:
client.platform.classes=\
${client.platform.lib}/cldcapi10.jar:\
${client.platform.lib}/midpapi10.jar:\
${client.platform.lib}/j2me-xmlrpc.jar

The "client.platform.lib" location is defined in file
"/tests/common/build/environment.properties" relative to the "client.platform.home" which, in turn, defined in the same file or as a ant build parameter (via -D...).

navado
Offline
Joined: 2010-03-02
Points: 0

Hi, Ivan
I have a similar problem as above.
If required jar added here (as well as in classpath in build.xml) the common.xml still tries to refer directly to .class file and assumes it holded in /bin folder of the project.

It's possible to add target which extracts jar to required directory, but I hope there is better solution for this problem.

Thanks before.

mhuebner
Offline
Joined: 2009-07-02
Points: 0

Hi,

I have solved the problem like you have described. (By extracting the jar file with an ANT script)

Afaik there is no support for integrating jar files, but I can definitely see a need for that feature as well.

victa
Offline
Joined: 2007-04-27
Points: 0

just try to setup reference jsr's jar into code/external-lib/ directory

Build Instructions: https://jdtf.dev.java.net/jdtf_buildinfo.html
The section about
Java ME Modules
Java ME API libraries and related tools

mhuebner
Offline
Joined: 2009-07-02
Points: 0

Thanks for your answer. However it seems like you have got me wrong and that I should describe my problem in more detail. First of all, there are some things I did not find in the documentation and I am not completely sure if the framework is supposed to behave the way I expected.

I started out by creating a simple test suite for the PIM API. Therefore I needed the jsr75.jar to compile the suite and I was expecting that the framework would load the jar file automatically or support a way to add a dependency via the UI of the Netbeans plugin. However the whole 'Compilation Units' section does not seem to influence the build.xml at all, although the project.xml was changed.

Is that an issue, or is the feature not implemented yet?

ivan_veselovsky
Offline
Joined: 2007-12-06
Points: 0

The ant build script (/build/build.xml) and the NetBeans project configuration (The "Compilation Units") are different things (the former affects the ant build, while the latter affects "understanding" of your project by the IDE), and they do not directly affect each other. That means that if you add some libs in NB project properties, they do not automatically appear in the "environment.properties" file, and vice versa. So, to configure the project properly in all the aspects you need to add the lib into both the places.
It would be nice to have direct connection between the 2 places where the testpack libraries are configured, but this is not yet implemented.