Skip to main content

How to plugin the newley created interview class into ME Framework ?

43 replies [Last post]
murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi all...

I have some doubts in creating new interview class to run it using JT Harness.

Recently i created one interview class with the help of ME Framework developer guide. I want to plugin that class into ME Framework,so that i can execute it using JT Harness.
I was unable to do that process.

Plz any one can tell me how to plugin newely created interview class inorder to run it using JT Harness..and how to create effective interview classes.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vsizikov
Offline
Joined: 2004-11-16
Points: 0

Hi Murali,

It seems that your questions are getting more and more complex... Looks like you're making quite some progress writing your test suite, right? :)

> i have usecase where bunch of midlets has to
> trusted (i.e should be signed with third part
> Certificates) using testharness and
> meframework...Please kindly mentioned of the
> processor to do.

I'm not sure I fully understand the question. Do you want to sign *ALL* test bundles with some special certificate, or do you want just some MIDlets to be signed by special certificate, and the test bundles to be signed by the certificate specified in the Interview?

Thanks,
--Vladimir

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir,

>It seems that your questions are getting more and more complex... Looks like you're > making quite some progress writing your test suite, right? :)

Yes,now i have better idea on MEFramework :).Thank you very much for your valuable suggestions.
>Do you want to sign *ALL* test bundles with some special certificate,
> or do you want just some MIDlets to be signed by special certificate,

I have a bunch of Midlets in my test suite.But i want to [b]sign only some of the Midlets[/b] with special certification.

Actually when i tried with default certification, it was signing all Midlets.

What is the proecedure to sign only some midlets in my test suite?

Thanks,
Murali

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir,

I think you are busy.Sorry for disturbing.

Can I know the answer for my previous Question regarding signing midlets

Thanks,
Murali

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

> I think you are busy.

Just to many different things at the same time :)

> Sorry for disturbing.

No problem at all! In case if I'm busy, there are many others who might help out too.
So feel free to post as many question as you need :)

One thing I'd suggest though. Please use separate threads for different questions, or we'll end up with one HUGE discussion thread, and that would complicate things: harder to find information, harder to see what's answered and what's not, harder to participate.

You see, when other engineers see big discussion, they don't know whether everything was answered or not. But if they see a new thread with your question, and no answer, that's clear. This might encourage others to participate, an everyone benefits (you too). :)

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

Hi Murali,

I moved 2 last questions to the separate threads, for other viewers convenience, since the questions are unrelated to the this thread's subject.

Thanks,
--Vladimir

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi .Vladimir
i have usecase where bunch of midlets has to trusted (i.e should be signed with third part Certificates) using testharness and meframework...Please kindly mentioned of the processor to do.

Thanks
murali.

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi vladimir,

while running JTHarness , i am getting the following error.

"An error occurred while reading the tests in the test suite.
Problem reading file D:\MEFramework\testsuite\tests\index.html,near line 1
Java.io.IOException:Identifier expected"

I had written the index.html file properly.It was showing error at line 1.But at line 1 no error was there.I have the following statement at line 1

""

Some times it was giving error at <\table>.

Why i am getting those errors.What is the problem actually?

Thanks,
Murali

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

Hi Murali,

> "An error occurred while reading the tests in the
> test suite.
> Problem reading file
> D:\MEFramework\testsuite\tests\index.html,near line
> 1
> Java.io.IOException:Identifier expected"
>
> I had written the index.html file properly.It was
> showing error at line 1.But at line 1 no error was
> there.I have the following statement at line 1
>
> " > Transitional//EN">"

Most typically, this kind of error is due to problems with HTML file format. Most probably, some tags are not closed or incorrectly used. Please double-check that your HTML file is fully compliant to the spec, by running some HTML validators.

When the HTML format is broken, the HTML parser inside JTHarness is confused, and produces that error.

> Some times it was giving error at <\table>.

You use the wrong slash, you should use '/' instead of '\', isn't it?

Once I insert this incorrect tag into my HTML file, I see the very same error about Identifier expected.

> Why i am getting those errors.What is the problem
> actually?

With 99% -- HTML format errors that confuse the HTML parser inside JTHarness.

Thanks,
--Vladimir

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

> [b]We got proper result for Interview by using FW 1.2
> also[/b].I did the same thing what u told in the
> previous message.Thank you

Excellent!!! :)

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir,

I just added those three libraries in classpath,but still i am getting the same error.
[b]" Cannot start service manager: null "[/b]

and [b]"NosuchElementException"[/b] at command prompt.

Thanks
Muralidhar

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

Hi Murali,

> I just added those three libraries in classpath,but
> still i am getting the same error.
> [b]" Cannot start service manager: null "[/b]
>
> and [b]"NosuchElementException"[/b] at command
> prompt.

OK, we eliminated the side effects by fixing the classpath, and I just looked more thoroughly at the stacktrace.

The exception is out of TestBuilder.loadTestData(). And in this method we read testclasses.lst file in order to obtain the information which classes need to be bundled with which tests.

In your case, nextToken() returns null, and that means that you probably have an empty string in that file, which is not allowed.

So, with 95% probability, the problem lies in testclasses.lst, please double-check it and let me know.

Note: the file typically is at TestSuite/classes/shared/testClasses.lst

Thanks,
--Vladimir

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

> In your case, nextToken() returns null, and that
> means that you probably have an empty string in that
> file, which is not allowed.
>
> So, with 95% probability, the problem lies in
> testclasses.lst, please double-check it and let me
> know.

I've simulated the problem in my testClasses.lst by adding an empty line to the file, and was able to reproduce the exception and the error message.

I've filed the following ISSUE in our Issue Tracker:
https://cqme.dev.java.net/issues/show_bug.cgi?id=259
"Empty line in testClasses.lst leads to exception and confusing error message"

We'll fix the problem in the update release.
Meanwhile, please make sure that there are no empty strings in your file.

Thanks,
--Vladimir

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir,

Thanks a lot,Now FW 1.2 is working properly.

Actually you had given some information about working with CDC on FW 1.2,but there is no enough information.

Plz tell me how to go with CDC.I did with FW 1.2 and FW 1.1.1 for CLDC ....Now i am happy.

Plz tell me,what can i do for CDC configuration.

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

> Thanks a lot,Now FW 1.2 is working properly.

> I did with FW 1.2 and FW 1.1.1 for CLDC ....Now i am happy.

Very good! :)

> Plz tell me,what can i do for CDC configuration.

Most important thing. When you open Configuration Editor with your Interview, do you have a question titled "Implementation Base"? It should be one of the first questions (4th to be exact). If such question is present, just select "CDC" and follow the interview. Once the configuration is done, your test suite is configured to be run under CDC. On device/emulator side, please follow the command line options I gave earlier in this thread.

If there is "Implementation Base" question, we need to enable it. Take a look at the SimpleTestSuite on how it's done.

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

Hi Murali,

Here's the code from SimpleTestSuite that deals with setting up the implementation base question with appropriate choices (in your case, MIDP and CDC).

Here's how the interview is created:

return BasicTckInterview.createBuilder(this)
.setSubInterview("sample.suite.SampleInterview")
.setDistributed(true) // required for distributed tests
.setImplemetationBaseChoices(MIDP_AND_CDC)
.setBundleSizeLimit(100000)
.setKeywordsEnabled(true)
.setPreverifierAware(false)
.setEnableSeparatorQuestion(true)
.build();

First, we create an interview builder, and then set appropriate info.
The setImplementationBaseChoices(MIDP_AND_CDC) is the one. At the end, the builder creates the Interview via build() method.

The MIDP_AND_CDC is defined as:

// This test suite supports MIDP and CDC
private static final String[] MIDP_AND_CDC
= new String[] {VmInterview.MIDP, VmInterview.CDC};

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir,

When i pressed execute test button in FW 1.2 , Harness is showing the following error:
[b]"Cannot start service manager: null"[/b] and i get the following error in the command prompt
[b]"
java.util.NoSuchElementException
at java.util.StringTokenizer.nextToken(Unknown Source)
at com.sun.tck.cldc.javatest.TestBuilder.loadTestData(TestBuilder.java:287)
at com.sun.tck.cldc.javatest.TestBuilder.(TestBuilder.java:58)
at com.sun.tck.cldc.javatest.TestBundler.createTestBuilder(TestBundler.java:236)
at com.sun.tck.cldc.javatest.TestBundler.reset(TestBundler.java:202)
at com.sun.tck.j2me.services.testBundlingService.TestBundlingService.start(TestBundlingService.java:468)
at com.sun.tck.j2me.services.LifeCycleAwareManager.start(LifeCycleAwareManager.java:60)
at com.sun.tck.j2me.javatest.ServiceBasedTestSuite.startRun(ServiceBasedTestSuite.java:144)
at com.sun.tck.cldc.javatest.CldcTCKBaseTestSuite.startRun(CldcTCKBaseTestSuite.java:160)
at com.sun.tck.j2me.javatest.ExportTestSuite.startRun(ExportTestSuite.java:120)
at com.sun.tck.j2me.javatest.ServiceBasedTestSuite.starting(ServiceBasedTestSuite.java:226)
at com.sun.javatest.Harness.runTests(Harness.java:656)
at com.sun.javatest.Harness.access$000(Harness.java:45)
at com.sun.javatest.Harness$1.run(Harness.java:529)"[/b]

Actually i added all the libraries ( jar files ) of FW 1.2 in the classpath.Without adding we cannot execute harness. Then i executed javatest.jar .

[b]what is that error? ..Is there any way to archive all jar files into one ?...then i can give that one jar in the classpath.
[/b]

After choosing MIDP option in interview questions, there was no interview question whether we need CLDC 1.0 or CLDC 1.1.

Thanks
Murali

Message was edited by: murali_reddy219

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

Hi Murali,

> Actually i added all the libraries ( jar files ) of

> FW 1.2 in the classpath.Without adding we cannot

> execute harness. Then i executed javatest.jar .

>

> [b]what is that error? ..Is there any way to archive

> all jar files into one ?...then i can give that one

> jar in the classpath.

> [/b]

You definitely should not put all the JAR files into classpath.
Ideally, the command line to start the Harness is:

java -jar javatest.jar

All classpath-related settings must be done in testsuite.jtt file, in "classpath" entry.
And even there, there is no need to add too much.

Take a look into testsuite.jtt from our SimpleTestSuite sample for ME FW 1.2:
testsuite.jtt.

You'll see only three files in the classpath: j2mefw_jt.jar - this is the main ME Framework JAR file, required. interviewlib.jar - ME Framework's extension to standard JavaTest interview, optional. sample_jt.jar - this is a custom JAR file with particular testsuite's classes (like custom test suite class, interview, etc).

In your case, you should probably just add the j2mefw_jt.jar, and the location where your classes for testuite and interview are stored, that's it.

Once you clean-up the classpath issue, let me know what error/exception you see (You've mentioned that you had some problem, that was the reason to add everything to the classpath).

Thanks,

--Vladimir

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

Hi Murali,

> Upto now this 1.1.1 is working fine...

Very good!

> But as u told...i was downloaded ME Framework 1.2
> from java.net and then i added javatest.jar and
> jh.jar ( what i have) to that Me Framework library

Hmmm, it does seem like we have some sort of disconnect here. The download page that I provided earlier has a zip file with all ME Framework JAR files already pre-built. You don't need to compile them anymore. The sources in the download zip file are just for your reference (or for debugging purposes).

All you have to do is to copy all JAR files from "lib" directory to your test suite's "lib" directory, overriding the JAR files from ME Framework 1.1.1.

You don't need to copy ME Framework's sources and you don't need to compile them manually.

> ..But when i am trying to build it( using ant ) , it
> is giving some many errors( one of that error was
> package javax.comm not found...)

It seems that you try to compile ME Framework 1.2 sources, but you probably shouldn't do that. Just use the official JAR files.

If you really want to build ME Framework from the sources, you need to check ME Fraemwork's sources from Subversion repository, provide all required dependencies (like javax.comm, etc) in build.properties file, and build it by using the ant build files that are also part of Me Framework repository.

That's a bit more work than just to use the prebuilt JAR files, and in most cases is not needed.

Let me know if you really do want to build ME Framework from the sources, and I'll provide a step-by-step instruction for you. But I don't really understand why would you want to go that more complex way when all you need to do is just to use the prebuilt binary zip file from downloads page.

> If you have working ME Framework 1.2...plz send it to
> me at murali.reddy219@gmail.com

The main download page contains the zip file with prebuilt JAR files inside it, just download the zip file from here:
http://download.java.net/mobileembedded/cqme/download.html

The JAR files are in "lib" directory in the zip file.

Thanks,
--Vladimir

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir,

>Let me know if you really do want to build ME Framework from the sources, and I'll provide > a step-by-step instruction for you. But I don't really understand why would you want to go > that more complex way when all you need to do is just to use the prebuilt binary zip file
> from downloads page.

I had put some printf statements in the java files.Whybcoz i want to know the flow of meframework properly.Thats why i tried to build ME Framework files.

Did you have any documents on " When the harness is calling test cases and Me Framework, how Me Framework and Harness are connecting,"

That to i want document on total flow of ME Framework and how it is going on from taking test cases to till executing test cases using harness.

If you have these documents, plz provide me at murali.reddy219@gmail.com.

Bcoz i need to know the full flow of ME Framework.[b] It is too interesting.[/b]

Thanks
Murali

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

Hi Murali,

> I had put some printf statements in the java
> files.Why bcoz i want to know the flow of meframework
> properly.Thats why i tried to build ME Framework
> files.

Oh, now I understand! Sure, for this you'd need a properly working build.
I'll try to provide step-by-step build instructions to you then. And later we'll post them
on our build instructions page:
https://cqme.dev.java.net/fw_buildinfo.html

Currently, the page is mostly for FW 1.1.1, and we'll need to update it to reflect changes in FW 1.2 (you've already mentioned some of the changes - javax.comm dependency, JDK 1.5 requirement etc).

> Did you have any documents on " When the harness is
> calling test cases and Me Framework, how Me Framework
> and Harness are connecting,"

Mostly, ME Framework uses an extensible architecture of JavaTest Harness, and "plugs" Java ME specific components here and there (things like Java ME specific TestSuite, Interview, Script, Command).

For better understanding of JavaTest Harness architecture, take a look at "JavaTest
Architect Guide":
http://java.sun.com/javame/javatest/docs/javatest_arch_guide.pdf

And here's the ME Framework's Developer Guide:
http://java.sun.com/javame/meframework/docs/framework_dev_guide.pdf

But I agree with you that we should probably provide more info on how
things relate to each other and how they communicate with each other.

I'll open a new Issue in our Issue Tracker so that we'll improve this in the future releases.

> That to i want document on total flow of ME Framework
> and how it is going on from taking test cases to till
> executing test cases using harness.

One possibility here might be to use remote debugging on Java SE side, so that you could start JavaTest harness with remote debugging options in the command line and then attach the debugger from most Java IDE (NetBeans, Eclipse, etc).

Here's the command I use to start the JavaTest:
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=3232,suspend=n -jar javatest.jar

In some cases you might also try to attach debugger to the emulators (like WTK), to debug things on Java ME side.

Setting up the debugger is a bit more work than to enter printf statements, but in the long run it's much more productive and you'll get much better understanding on how things work by using the debugger.

> If you have these documents, plz provide me

Some fundamental info is provided in the PDF files I referenced above (without those, it will be pretty hard to understand how everything works). For additional info, feel free to ask here, in the forum, and I'll try to answer (and will take a note to improve the docs).

Thanks,
--Vladimir

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir,

Thanks for the provided Information

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

Hi Murali,

> Thanks for the provided Information

Sure, my pleasure!

And here are two related issues I've opened/updated in our IssueTracker:

https://cqme.dev.java.net/issues/show_bug.cgi?id=20
Usability issues with ME Framework build instructions

https://cqme.dev.java.net/issues/show_bug.cgi?id=256
Info on how Harness and Framework relate to each other needed

Thanks,
--Vladimir

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir,

Upto now we did for CLDC. Now we want to do for CDC. We selected the option of CDC in the interview.But while executing test , it is showing an error stating as [b]"Cant find class "{0}", used in "{1}"[/b]

what is that error? How can we approach for CDC configuration.

Thanks
Murali

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

> Upto now we did for CLDC. Now we want to do for CDC.
> We selected the option of CDC in the interview.But
> while executing test , it is showing an error
> stating as [b]"Cant find class "{0}", used in
> "{1}"[/b]
>
> what is that error? How can we approach for CDC
> configuration.

CDC support is relatively new feature, and we extensively reworked/improved it for ME Framework 1.2. So, I guess, [b]you don't really have any choice but to switch to the ME Framework 1.2[/b], since that's the only version that properly supports CDC.

Under which version do you see the error, under FW 1.1.1?

And, the overall test execution works a bit differently for CDC, as compared to MIDP/CLDC. No Autostart is used, you just have to launch the test agent, and it will communicate with the JavaTest harness and ME Framework on top of it, in order to obtain the tests and to return the results.

The info on how to start the agents for CDC is here:
https://cqme.dev.java.net/issues/show_bug.cgi?id=249

Thanks,
--Vladimir

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir,

We got this error under FW 1.1.1

Till now we didn't try under FW 1.2

[b]We got proper result for Interview by using FW 1.2 also[/b].I did the same thing what u told in the previous message.Thank you

Our final aim is to get the result for CDC. Presently i am working in that way.

Thanks
Murali

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi vladimir

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

Hi Murali,

> In this version, in J2meBaseTestSuite class, i was

> added the following statement

>

> String customInterviewClass =

> getTestSuiteInfo("interview.custom.classname");

> For this "interview.custom.classname" string, i had

> given my interview class path in testsuite.jtt file.

In most cases, there is no need to complicate things to define
this custom interview class name in the jtt file and then to use reflection
to load it in the code.

You could just create your interview object right in the createInterview() method.
As I mentioned in previous messages, in ME FW 1.1.1 there were some bugs related
to this functionality, so ME Framework 1.2 is a better candidate to work with.

Still, for ME Framework 1.1.1, take a look at
createInterview method in SampleTestSuite.

You'll see how to create custom interviews there, and how to attach them to the main interview (with some workaround).

But the very same createInterview() method is much simpler if you switch to ME Framework 1.2:

createInterview method used with ME FW 1.2.

There, in the sample for FW 1.2, just change "sample.suite.SampleInterview" to your interview class, and it should be loaded and attached to the main interview.

> I am getting the following error " WARNING: missing

> resource: ts.errorInitInterview

> com.sun.javatest.util.I18NResourceBundle@1ee2c2c for

> com.sun.tck.j2me.javatest.i18n"

First, it seems that the appropriate i18n message is not defined, but this is a minor thing. The main thing is that your interview couldn't be initialized for some reason.
You could add printStackTrace() method in catch, and see what's the error.

If you don't mind, feel free to send me your sources, and I'll take a look at them. That way, it most probably will be easier to detect the problem/misconfiguration.

Thanks,
--Vladimir

Message was edited by: vsizikov

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir...

Thanks a lot for all your suggestions...finally i got it for framework 1.1.1...Upto now this 1.1.1 is working fine...

But as u told...i was downloaded ME Framework 1.2 from java.net and then i added javatest.jar and jh.jar ( what i have) to that Me Framework library ..But when i am trying to build it( using ant ) , it is giving some many errors( one of that error was package javax.comm not found...)

If you have working ME Framework 1.2...plz send it to me at murali.reddy219@gmail.com
or murali_mule@yahoo.co.in..

If you have any problem,then tell me what to do for working with ME Framework 1.2

Thanks

Murali

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir...

In addition to that ME Framework 1.2, i want to know about midlet signing.We successfully completed custom interview for framework 1.1.1 and midlet permissions.Thaks for ur valuable suggestions.Now the final stage is midlet signing.

How can we give signing certificate for midlet in this ME Framework?If this completes my project finishes for Framework 1.1.1.

Plz help me in this aspect also.

Thanks
Murali

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

Hi Murali,

> We successfully completed custom
> interview for framework 1.1.1 and midlet
> permissions.Thaks for ur valuable suggestions.

Cool!

> How can we give signing certificate for midlet in
> this ME Framework?

If your integration of custom interview with the main ME Framework interview was correct, then you'll see some standard questions in the interview first, and then your interview's questions.

One of the questions is in "Security" section, "Trusted MIDlet Suites Support". Answer "Yes" there. One of the following questions will be "Build-in Certificate". By default, the answer is "Yes", and the ME Framework's default certificate is used to sign test bundles before delivering them to the device. But you are free to answer "No" and provide the information about your certificate in the subsequent questions.

Let me know if this answers your question.

Thanks,
--Vladimir

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir,

For ME Framework 1.2 , i will do as you told.

> Let me know if this answers your question.

My problems are listed below:

1. How can we know whether the testbundle is signed or not?

I had given "YES" to the following interview question:[b]" Do you want to use a custom class to sign MIDlets?"[/b]

then i got the following questions.

a.) Specify the JAR file that contains the SuiteSigner implementation classes:
b.) Enter the fully-qualified class name of your SuiteSigner implementation:
c.) Enter any arguments that the test suite must pass to your SuiteSigner init() method:

I want answers for those questions.

2. If i say "YES" for the question: Do you want the test suite to sign a MIDlet suite with its built-in certificate?, then i got the following questions

d). Enter the full name of the J2SE(tm) keystore containing the signing certificate:
e).Enter the alias of the certificate:
f.) Enter the keystore password:
g).Enter the certificate private key password:
how can we answer for these questions?

Or is there any other way to do signing?

plz provide me the enough information.

Thanks
Murali

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

Hi Murali,

> 1. How can we know whether the testbundle is signed
> or not?

You could try to download the getNextApp.jad file in any web browser, and
you should see the security related entries there if the test bundle is signed.

Typically, if you answered "Yes" to "trusted apps support" question, the bundles *will* be signed. Another hint whether the bundle is signed or not might be whether you get security related prompts or not.

You could also enable "Verbose Output" question to see some output in Java SE console, and among other things there should be signing related output.

> I had given "YES" to the following interview
> question:[b]" Do you want to use a custom class to
> sign MIDlets?"[/b]

You probably should not say "Yes" here. The default signer used in ME Framework is typically enough for standard devices/emulators.

This question is only for those who have very special needs and use non-standard ways to sign their bundles (e.g., their devices do not support standard way of signing bundles).

> 2. If i say "YES" for the question: Do you want the
> test suite to sign a MIDlet suite with its built-in
> certificate?, then i got the following questions

You need to decide which certificate to use here.
If you're using the built-in certificate (it resides in midptck.ks file),
then no more questions will be asked. This certificate is already integrated into, say, WTK, and your signed test bundles will be accepted by WTK.

If you need to use your own certificate, then the subsequent questions
will ask the relevant questions.

They are:

> d). Enter the full name of the J2SE(tm)
> keystore containing the signing certificate:
> e).Enter the alias of the certificate:
> f.) Enter the keystore password:
> g).Enter the certificate private key password:
> n we answer for these questions?

This is the info you should now, because it's your certificate residing in your keystore, and only you know the location of the keystore/file, the alias for the certificate, and the passwords.

If you don't know this info, you need to ask those who created/provided the keystore to you.

Thanks,
--Vladimir

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir,

>This is the info you should now, because it's your certificate residing in your keystore, and >only you know the location of the keystore/file, the alias for the certificate, and the >passwords.

I dont have any keystore files. can u send me keystore (.ks)files? I need to check for own certificates also

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

Hi Murali,

> I dont have any keystore files. can u send me
> keystore (.ks)files?

One keystore is being shipped as part of ME Framework bundle (in "lib" directory, there is a file midptck.ks - this is it).

That's the keystore used by default in ME Framework interview (built-in certificate is "Yes").
But you could use it if you answer "No" to built-in certificate and provide the following info:

Certificate Alias: dummyCA
Keystore Password: keystorepwd
Private Key Password: keypwd

This is just to check that everything works.

The built-in certificate will work out of the box with WTK emulators. But for real devices you have to know the device specific certificate (which is not that easy to get - manufacturers will not give it that easy :). Important thing here is that in ME Framework *there is* a way to customize the signing certificate, and when particular user would like to run on particular device using custom certificate, he/she can do that.

Message was edited by: vsizikov

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

Hi Murali,

Here's the promised write-up.

Here is an outline on how to plug in the custom Interview:

1. First, and foremost, let's start with testsuite.jtt file.
This file is a main marker/configuration file for every
JavaTest Harness based test suite (including all ME Framework
based test suites). It resides in the root of the test suite.

In the file there is a "testsuite" entry that specifies the
test suite class to be used to construct everything else.
(Note: Make sure that "classpath" entry in the testsuite.jtt
specifies where this class should be loaded from).

2. Once you have your custom TestSuite class (
and com.sun.javatest.TestSuite should be among
its parents), and have it specified in the testsuite.jtt
file, you need to modify the source for your test suite
class to specify which interview to use.
Override createInterview() method (inherited from the
base com.sun.javatest.TestSuite) and specify your
interview class.

And alternative way of specifying the interview would
be to have "interview" entry in the testsuite.jtt.
But be warned, not all TestSuites look into this entry, some
test suites could just use createInterview() method
described above and might not look into the testsuite.jtt.

3. Now, you have your testsuite.jtt file, you have your TestSuite
class, and you have your Interview class, plugged into the
JavaTest harness.

The only thing that remains is how to write the interview
for ME Framework based test suites, which classes to extend, etc.

There are two typical ways of creating an interview for ME Framework
based test suite:

1. Much simple, but less customizeable. Works with ME FW 1.2 only.
Use com.sun.tck.j2me.interview.BasicTckInterview.
We have a sample in repository that follows this
approach (SimpleTestSuite). Take a look at:
SimpleTestSuite

In this sample you'll see how the TestSuite object creates
an Interview via Builder Pattern. The sample also shows
how to add your own questions to custom sub-interview.

2. More complex, but more flexible (used in many complex
Java ME TCKs from Sun).
Extend your test suite's interview from:
com.sun.tck.j2me.interview.MidpTckBaseInterview
You'll have to write some questions like "name",
"description", and override some base methods to make
it work.

We have a sample is the repository that follows this approach
(AdvancedTestSuite):
AdvancedTestSuite

In your case, I'd recommend to start with the first approach,
to get up and running quickly. When (and if) you would see
that your test suite requires some more advanced things,
then you could switch to the second approach. But in most
cases, the first approach will be enough, really.

Thanks,

--Vladimir

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

Hi Murali,

Just in case, I've created a detailed instructions on how to build ME Framework 1.2 on linux:

http://forums.java.net/jive/ann.jspa?annID=79

I've verifired that by following these instructions I can build ME Framework 1.2 from scratch on Ubuntu Linux 7.10. (You'll also need JDK 5 and Apache Ant).

Thanks,
--Vladimir

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

Hi Murali,

Just wanted to let you know that I filed an
ISSUE #255: Need better info/description on how to create and plug-in custom Interviews

https://cqme.dev.java.net/issues/show_bug.cgi?id=255

To make sure we track the problem and improve the documentation in the update release.

Thanks,
--Vladimir

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir...

Thank you very much for all ur suggestions...If i have any doubts i wil mail u

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir...

Actually i tried to use ME Framework 1.2 , but while building that code, i was getting so many errors.So i decided to use version 1.1.1 which i already have.Bcoz my work is getting delayed.

In this version, in J2meBaseTestSuite class, i was added the following statement

String customInterviewClass = getTestSuiteInfo("interview.custom.classname");

For this "interview.custom.classname" string, i had given my interview class path in testsuite.jtt file.

While building that code i am getting error at the following line in BasicTckInterview class constructor method

customInterview = (Interview)interviewConstructor.newInstance(argConstructor);

I am getting the following error " WARNING: missing resource: ts.errorInitInterview com.sun.javatest.util.I18NResourceBundle@1ee2c2c for com.sun.tck.j2me.javatest.i18n"

I was inherited my interview class from Interview class.

Plz help me as soon as possible

Thanks
Murali

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

> Actually i tried to use ME Framework 1.2 , but while
> building that code, i was getting so many errors.

This is really strange. One important thing to note here is that ME Framework requires JDK 1.5. Which JDK do you use? Once the JDK 1.5 is used, and the required dependencies specified in the build.properties file, there should be no problems compiling.

Would you mind sending me the error messages you had? That way, I could better say whether it's ME Framework's error or some misconfiguration. (And we could make sure that future users of ME Framework will not have that problem).

Also, in most cases, you don't even have to build the ME Framework yourself, you should use the official binaries, available at our download page:
http://download.java.net/mobileembedded/cqme/download.html

There is a "1.2 binary bundle" there.

I'll answer to the rest of your questions in the next message.

Thanks,
--Vladimir

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

Hi Murali,

Thanks for your interest. I just wanted to double check, you're creating an Interview to be used with ME Framework based test suite, to run in MIDP environment (this is the most typical scenario, I guess). Is that correct? Do you use ME Framework 1.2? In ME Framework 1.2 we significantly simplified the procedure to quickly adjust the interview.

What is the reason to go with customized interview in your case? Are you adding some new questions specific to your test suite?

(I'll post this message, and will work on more detailed response).

Thanks,
--Vladimir

murali_reddy219
Offline
Joined: 2007-10-25
Points: 0

Hi Vladimir
Thanks for your reply .
1. your correct .. i am trying to create Customized Interview to be used with ME Framework based test suite. Currently i am usinig meframework version 1.1.1 .

2. We are trying to use MEframework for testing JSR implementation, Some test cases require .. new Questions specific to the functionality ..So we require a way to automate it ,through interview framework.

Thanks
murali.

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

Hi Murali,

> 1. your correct .. i am trying to create Customized
> Interview to be used with ME Framework based test
> suite. Currently i am usinig meframework version
> 1.1.1 .

OK. In my earlier post I mentioned that we improved and simplified
the Interview creation in ME FW 1.2. Is there any blocking issue
for you not to use ME FW 1.2? We had fixed lots of issues there,
and implemented a lot of new features.

Take a look at my blog, if you're interested:
http://blog.emptyway.com/2007/06/14/whats-new-in-me-framework-12/

As for ME FW 1.1.1, we happened to have a sample for it as well, and
it shows exatly how to add the question to the interview, and how
propagate the values from interview down to the test level.

Take a look here:
https://cqme.dev.java.net/source/browse/cqme/trunk/samples/meframework/S...

As you see, there are few workarounds there for FW 1.1.1 bugs (in SampleTestSuite.java). We fixed them in FW 1.2.

> 2. We are trying to use MEframework for testing JSR
> implementation, Some test cases require .. new
> Questions specific to the functionality ..So we
> require a way to automate it ,through interview
> framework.

This is really cool! :) I would really like to know more about
your project, your needs and how we could help you.
If you don't feel like sharing this in the open (for various reasons),
feel free to send me a message privately. My email:
vsizikov [at] dev.java.net

Thanks,
--Vladimir