Skip to main content

How can CDC Tool kit access resources in TCK Setup folder?

1 reply [Last post]
murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi,

I am running TCK in CDC configuration mode.In CDC case,TCK is not creating JAR in which class files and resources present.

So I kept resources also in the same folder where test class files are present.
Whilerunning TCK in CDC mode, I am getting inputstream of the resource by using getResourceasStream API in my test case. In the next test case, i am passing the resource file name to the JSR API. But it is unable(JSR) to get the resource stream.
It is returning null. I am executing these tests using CDC Toolkit. Why toolkit is unable to find the resource.

In MIDP case, TCK is creating JAR files, so we can acces those resources from JAR.

How can we solve this in CDC Case.

Can any one help me?

Thanks & Regards,
Murali

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Alexander Alexeev

Hi Murali,

yes, the JSR can not access resources in TCK folder since system classloader can
access only system resources, but there is one way I hope to solve your problem.
There are $testURL and $testDir harness's environment's variables whose point
out to the location of the test's description and test's directory
correspondingly. You can pass them to the test through executeArgs. So your test
will have a 'file:' URL to the harness's directory. In order to access it from
device (running JSR) you need to mount host's (running harness) filesystem to
the device's filesystem and create map file to translate host's file paths to
the device's file paths (needless step for the CDC Toolkit as JSR running on the
same machine). The syntax of map file is very simple, for example:
C:/ /mnt/jtharness/
so all 'C:/' in the $testURL and $testDir will be replaced by '/mnt/jtharness/'
on the device's side. In order to pass map file to the agent use -map file_name
command line option.

Feel free to ask if something not clear.

Thanks,
Alexander

meframework@mobileandembedded.org wrote:
> Hi,
>
> I am running TCK in CDC configuration mode.In CDC case,TCK is not creating JAR in which class files and resources present.
>
> So I kept resources also in the same folder where test class files are present.
> Whilerunning TCK in CDC mode, I am getting inputstream of the resource by using getResourceasStream API in my test case. In the next test case, i am passing the resource file name to the JSR API. But it is unable(JSR) to get the resource stream.
> It is returning null. I am executing these tests using CDC Toolkit. Why toolkit is unable to find the resource.
>
> In MIDP case, TCK is creating JAR files, so we can acces those resources from JAR.
>
> How can we solve this in CDC Case.
>
> Can any one help me?
>
> Thanks & Regards,
> Murali
> [Message sent by forum member 'murali_reddy219' (murali_reddy219)]
>
> http://forums.java.net/jive/thread.jspa?messageID=343381
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: meframework-unsubscribe@cqme.dev.java.net
> For additional commands, e-mail: meframework-help@cqme.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: meframework-unsubscribe@cqme.dev.java.net
For additional commands, e-mail: meframework-help@cqme.dev.java.net