Skip to main content

PUSH WAP registry tests using JTHarness test server - Editing jad file

16 replies [Last post]
jarviss
Offline
Joined: 2009-06-24
Points: 0

hello all,

i'm currently trying to create a PUSH WAP automated test using JTHarness server.

The first issue we are facing is to register the push registry row in our jad file when MIDlet is created.

Typically, it's look like the following : MIDlet-Push-1: socket://:77, com.sample.SampleApplication, *.

Have you ever tried to do the same ?

You can find more informations on PUSH WAP following this link : http://www.javaworld.com/javaworld/jw-04-2006/jw-0417-push.html?page=1

Many thanks in advance.

Kind regards

Guillaume

Reply viewing options

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

Hi Guillaume,

Also, if you just want to transfer some info from the JTharness to the
test running on the device, you could do so without using the property
files.

Take a look at our sample test (from SimpleTestSuite) to see how to do
that: (click on revisions numbers to see the files content)

https://cqme.dev.java.net/source/browse/cqme/trunk/code/samples/SimpleTe...

Essentially, you add "executeArgs" entry into the test description, and
all that you enter into its value, will be delivered to the test on the
device.

You could enter some static text, or, more advanced, some variables,
like: $sample.string.value

These variables will be resolved against the TestEnvironment, supplied
by the interview. Like in this example, we ask user to enter something
in the interview, and then export the entered values into
$sample.string.value, which is being passed to the test.

On the device side, you need to overrdie protected int decodeArg()
method in order to obtain the values, supplied by the JTharness/Framework.

A bit more about executeArgs and overall process can be found in our ME
Framework Developer's Guide:

http://java.sun.com/javame/meframework/docs/framework_dev_guide.pdf

Thanks,
--Vladimir
[vladimir_sizikov.vcf]
---------------------------------------------------------------------
To unsubscribe, e-mail: meframework-unsubscribe@cqme.dev.java.net
For additional commands, e-mail: meframework-help@cqme.dev.java.net

jarviss
Offline
Joined: 2009-06-24
Points: 0

I am testing the "Jad-addon", could you tell me where you put the file ?

my html description is :
(TR)
(TD SCOPE="row") (B)Jad-addon(/B) (/TD)
(TD) test.txt (/TD)
(/TR)

and test.txt is in directory :
classes\shared\com\xxx\JSR118\Interactive

which corresponds to html path :
tests\com\xxx\JSR118\Interactive

For information, my tests inherite from J2MEDistributedTest, I saw in framework that Jad-addon is parsed in a getFilesForTest (called from JTHarness). This function getFilesForTest is in J2meBaseTestSuite. (I do not inherite from this file is it a problem ?)

Guillaume.

Message was edited by: jarviss

Vladimir Sizikov

> I am testing the "Jad-addon", could you tell me where you put the file?

If memory serves, the file's location is relative to the test
description (i.e., the HTML file).

In your case, it should be:
tests\com\xxx\JSR118\Interactive

Thanks,
--Vladimir

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

jarviss
Offline
Joined: 2009-06-24
Points: 0

Thank you Vladimir,

so, i tried and it does'nt work.

I put like this in my HTML file :

(TR)
(TD) SCOPE="row") (B)Jad-addon(/B) (/TD)
(TD) test.txt (/TD)
(/TR)

And i've correctly put my 'test.txt' file and all resources files in following folder : tests\com\xxx\JSR118\Interactive,
but resources in my 'test.txt' file are apparently not read.

Do you know how look like the content of 'test.txt' file if i've got to have access for example an image picture for my test. And if this image picture is stored also in the same path (ie tests\com\xxx\JSR118\Interactive) ?

Thanks a lot!

Guillaume

Vladimir Sizikov

Hi Guillaume,

I probably should have been more clear here.

There are 2 different places, and they are looked into by different
subcomponents of the Framework.

1. The resources, like media files, images, and any other binary data,
they are used by the test bundler to put them inside the test bundle,
along with the test class files. And they are treated similar to class
files.

These resources need to be at the same place where class files are:
classes/....

2. Jad-addon, Manifest-addon files. These need to be at the same places
where the test description is:
tests/....

So, if you want to pack some extra resources into the test bundle, put
them where your classes are, and add "resources" entry into your test
description, with the fully-qualified path, as if the resource was a
class file. Say, I have a test: a.b.c.Test1 and I want to pack a
resource Resource.bin together with the test. In such case, I put the
Resource.bin file into classes/a/b/c directory, and set the "resources"
value in the test description to be a/b/c/Resource.bin

If you want to adjust the manifest/JAD, put the relevant file where your
test description is (then your previous example of the test description
should be correct).

It worth noting that there are no interdependencies between resources
and manifest- and jad-addon handling. These are two different
tasks/topics, completely orthogonal to each other.

In some test suites, users might want to adjust only jad/manifest, in
other suites users might want to add resources to the bundles, this is
all independent.

Let me know if I answered your question. Hopefully, I haven't
misunderstood it.

Thanks,
--Vladimir
[vladimir_sizikov.vcf]
---------------------------------------------------------------------
To unsubscribe, e-mail: meframework-unsubscribe@cqme.dev.java.net
For additional commands, e-mail: meframework-help@cqme.dev.java.net

jarviss
Offline
Joined: 2009-06-24
Points: 0

Hi Vladimir,

thanks your theses explanations.

It is ok for theses 2 points.
My interest focus on 2nd point and it seems that we correctly realized what you have written but it still doesn't work.
Pherhaps have got a documentation, tutorial or a link to recommend me, something that would be able to set me straight about this ?

Kind regards

Guillaume

Vladimir Sizikov

Hi Guillaume,

On 8/4/2009 11:33 AM, meframework@mobileandembedded.org wrote:
> Pherhaps have got a documentation, tutorial or a link to recommend me,
> something that would be able to set me straight about this ?

Let's do it that way. Let's formalize the task you wish to accomplish,
and I'll provide you with the updated test suite sample that does what
you need. :) Along the way we'll create that very documentation/tutorial
that might be useful for others later on.

Currently, my understanding is that you'd like to add, say, the
following line to the JAD file of the test bundle:

MIDlet-Push-1: socket://:77, com.sample.SampleApplication, *.

Is that correct or you have something else in mind?

Thanks,
--Vladimir
[vladimir_sizikov.vcf]
---------------------------------------------------------------------
To unsubscribe, e-mail: meframework-unsubscribe@cqme.dev.java.net
For additional commands, e-mail: meframework-help@cqme.dev.java.net

jarviss
Offline
Joined: 2009-06-24
Points: 0

Hi Vladimir,

so, to be the much clear as possible :

our solution is a test framework. So it has to implement with JTHarness, some packages of test suites.
In this context, each test has his own .jad.
And when a suite of test is launched, .jad of test is created when single test (that belongs to a test suite) is launched. Consequently, this .jad have to be created automatically.
And for a test about Push Wap, we have to add a line (lMIDlet-Push-1: socket://:77, com.sample.SampleApplication, *.) to .jad that we can't put in our html test file because it is not a 'resource' value or a 'grant' value.
So, we search a way to put the line (MIDlet-Push-1: socket://:77, com.sample.SampleApplication, *.) automatically in our .jad when test is launched.

I hope i am clear. The thing is the use of Jad-Addon is veryu unclear to us.

Thanks for all.

Guillaume

palineo
Offline
Joined: 2009-02-26
Points: 0

Thanks Vladimir,

The problem came from the testsuite. We have to inherited from j2meBaseTestSuite in order to have Jad-addon works.

Regards,
Brice.

vsizikov
Offline
Joined: 2004-11-16
Points: 0

> The problem came from the testsuite. We have to
> inherited from j2meBaseTestSuite in order to have
> Jad-addon works.

Thanks for the update! And it's great to see this issue finally resolved. :)

Vladimir Sizikov

Hi Guillaume,

Thanks for trying out the ME Framework!

Before I could comment on your question, I'd like to know a bit more
about your situation.

So, this line you're trying to add to the JAD file, is it on per-test
basis or the same line for every test?

Thanks,
--Vladimir
[vladimir_sizikov.vcf]
---------------------------------------------------------------------
To unsubscribe, e-mail: meframework-unsubscribe@cqme.dev.java.net
For additional commands, e-mail: meframework-help@cqme.dev.java.net

jarviss
Offline
Joined: 2009-06-24
Points: 0

Hi Vladimir,

thank you very much for your help !

So, yes, this line in JAD is on a per-test basis.
Each test have its own JAD file, so this line can be added without any consequence for other tests of test suite.

To complete my question :

in fact, as i wrote in my first mail,
we want to register the push registry row in our JAD. But in our framework, JAD is created automatically (on the fly) when test is launched.
So we can't add the line ourself in JAD before test is ran.

For this purpose, we have already, a solution for resource like URI of image, audio, video etc.. that test need to access in order to run.
We just have to put this kind of line in an html file :

tr
td SCOPE = "row" B resources B td
td com/JSR135/Interactive/Multimedia.properties (uri of resources for game contained in this file)
td/
/tr

And then html file can be read by test from JAR.

But our goal is to avoid using a property file as shown before :

So, does it exist a way to use directly the property value in html file and associate it to a keyword as shown below ?
We know that interview files exist but is there an other solution like below pherhaps ?

tr
td property /td
td MIDlet-Push-1 /td ##keyword
td mms://:MMSDemo, WMA2, */td ##property
/tr

For your information, following is the entire content of the JAD file for this test:

MIDlet-1: WMA2,,WMA2
MIDlet-Jar-URL: WMA2.jar
MicroEdition-Configuration: CLDC-1.0
MIDlet-Push-1: mms://:MMSDemo, WMA2, *
MIDlet-Version: 1.0.0
MIDlet-Name: WMA2
MIDlet-Vendor: **************
MicroEdition-Profile: MIDP-2.0
MIDlet-Permissions: javax.microedition.io.Connector.mms,javax.wireless.messaging.mms.send,javax.wireless.messaging.mms.receive,javax.microedition.io.PushRegistry

Many thanks for your help,

Kind regards

GM

Message was edited by: jarviss

Message was edited by: jarviss

Vladimir Sizikov

Hi Guillaume,

Thanks for clear explanations. The situation is more or less clear now. :)

We have the following which might be of interest to you.

You could add the following entries into the (HTML) test descriptions:
"Jad-addon", and "Manifest-addon". The values for those entries are
*still* the file names, so this won't allow you to eliminate the files
completely, as you've stated.

On the other hand, the content of those "addon" files will be merged
right into JAD and Manifest files for the test bundle, automatically by
the Framework, which might be the main thing you're looking for.

Let me know if that solves your problem or not.

Thanks,
--Vladimir
[vladimir_sizikov.vcf]
---------------------------------------------------------------------
To unsubscribe, e-mail: meframework-unsubscribe@cqme.dev.java.net
For additional commands, e-mail: meframework-help@cqme.dev.java.net

jarviss
Offline
Joined: 2009-06-24
Points: 0

Hi Vladimir,
Thanks for your quick answer and your availability,

In fact I have two operational problems corresponding to the same technical problem.
- Accessing the jad file in order to add a specific line is THE technical problem.

- The first operational problem consist to add the push registration attribute name in jad file => MIDlet-Push-1: mms://:MMSDemo, WMA2, *

The second operationnal problem is to access a file by an attribute rather than its value.
Example :

jad file:
[...]
wav: resource://audio/sample1.wav (here is what I need)
[...]

java :
[...]
url = getAppProperty("wav");
[...]

Today I have a "patch" in the code : I use a .properties file that I put in html test description and I access it in order to retrieve the value

file.properties :
[...]
wav: resource://audio/sample1.wav (here is what I have (not very clean isn't it ?))
[...]

java :
[...]
url = getAppProperty("wav"); (Method is overriden in order to access my property file rather than jad file.)
[...]

I just look the "Jad-addon" in the framework and it seems that it is only used for file support. So I wonder what is the difference with the "resource" tag in html description.

Correct me if I am wrong but the "Jad-addon" could not be used for my first problem (MIDlet-Push-1:...) because it does not design a file attribute.

Thanks,
Guillaume

Vladimir Sizikov

Hi Guillaume,

On 7/31/2009 2:44 PM, meframework@mobileandembedded.org wrote:

> Correct me if I am wrong but the "Jad-addon" could not be used for my first problem (MIDlet-Push-1:...)
> because it does not design a file attribute.

So, let's say you have a file named "jad.extras" which resides at the
same place where the test and the test description are.

Let's say you have the following content in that file:
MIDlet-Push-1: mms://:MMSDemo, WMA2, *
wav: resource://audio/sample1.wav

And let's assume that you've added "Jad-addon" entry to the test
description, with the value "jad.extras".

This way, when the test is bundled into the test bundle before sending
to the device, the Framework would add those two lines into the final
JAD file.

Once the test bundle is installed and being executed on the device, you
will be able to retrieve both values for keys (MIDlet-Push-1 and wav),
from the JAD.

Am I missing something? (I very well might be!) :)

So, the "resource" entry simply adds the specified file into the bundle.
We typically use it when we need to add specific files that are required
by the test (images, resources, sound clips, etc).

The "Jad-addon" entry adds the *content* of the specified file to the
JAD of the test bundle.

Thanks,
--Vladimir
[vladimir_sizikov.vcf]
---------------------------------------------------------------------
To unsubscribe, e-mail: meframework-unsubscribe@cqme.dev.java.net
For additional commands, e-mail: meframework-help@cqme.dev.java.net

palineo
Offline
Joined: 2009-02-26
Points: 0

Thank's a lot Vladimir !

I work with Guillaume, your answer is EXACTLY what we need !
We are going to try just right now :-)

Thanks,
Brice.