This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 80623

Summary: Unable to create MIDlet j2meunit.midletui.TestRunner - Only one MIDlet instance allowed!
Product: javame Reporter: Lukas Hasik <lhasik>
Component: JUnitAssignee: Karol Harezlak <kharezlak>
Status: RESOLVED WORKSFORME    
Severity: blocker CC: sean
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 151901, 77184    

Description Lukas Hasik 2006-07-19 15:08:39 UTC
when you finish the TestRunner midlet by pressing of hang button and you want to
start the TestRunner again then 

Unable to create MIDlet j2meunit.midletui.TestRunner
java.lang.RuntimeException: Only one MIDlet instance allowed!
        at j2meunit.midletui.TestRunner.<init>(+36)
        at java.lang.Class.runCustomCode(+0)
        at com.sun.midp.midlet.MIDletState.createMIDlet(+19)
        at com.sun.midp.midlet.Selector.run(Selector.java:151)
Comment 1 Jiri Prazak 2006-07-20 12:13:52 UTC
this is a problem/bug in the j2me unit framework itself, it has nothing to do
with the ide.  if we decide to stick with this framework, i will fix it for the
55 release, if not we will close this bug.
Comment 2 Lukas Hasik 2006-08-31 14:28:57 UTC
solved by change of library to JMUnit
Comment 3 Lukas Hasik 2006-09-19 21:12:50 UTC
x
Comment 4 Lukas Hasik 2006-09-19 21:13:29 UTC
x
Comment 5 Lukas Hasik 2006-10-05 14:04:08 UTC
v
Comment 6 sean 2008-10-30 20:14:14 UTC
Greetings,
I am using NB 6.1 and am having this same problem.  It is not possible to use JMUnit on MIDP2 emulators or devices because:

- Your tests must appear in a class that extends TestCase
- One of TestCase's parents (TestRunner) extends MIDlet
- When you instantiate your test class to run your tests, you are instantiating a MIDlet
- A platform that observes this MIDP2 rule will halt the instantiation

This pretty much makes JMUnit unusable for unit testing.  We have had to abandon it, and Netbeans' built-in support for
unit testing, and manually employ J2MEUnit as an alternative (whose parents of TestCase do not extend MIDlet.)

This is pretty clearly a major flaw of JMUnit, and my suggestion is that an investment be made in fixing JMUnit, if
using that test platform is still a priority.
Comment 7 Denis Anisimov 2008-12-18 14:55:10 UTC
sean , I'm sorry but I don't understand you.

Could you please provide me more information ?
First of all I don't understand your problems with JMUnit .
1) Please provide exact projects and source code that doesn't work for you .
2) As I understand you suggest to use J2MEUnit as test framework for NetBeans 
or change  JMUnit ?
In the latter case it is request for JMUnit library that is not NB related project.
So I really don't understand what you talking about.
Comment 8 Denis Anisimov 2008-12-29 09:52:13 UTC
There is no information from user that report about problems with JMUnit.
I suppose the problem is not in Netbeans JMUnit support but in JMUnit itself.
I close this issue because there is no clear information about issue.