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 170793 - JMUnit test cannot be launched using generated setting
Summary: JMUnit test cannot be launched using generated setting
Status: NEW
Alias: None
Product: javame
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-24 11:34 UTC by pribyl
Modified: 2012-04-16 12:22 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pribyl 2009-08-24 11:34:36 UTC
Product Version: NetBeans IDE Dev (Build 200908221401)
Java: 1.6.0_15; Java HotSpot(TM) Client VM 14.1-b02
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

1, Create new Mobile Application project (leave all settings default)
2, Create new Java Class (e.g. NewClass) in the 'hello' package and write some method that can be tested
3, Select this Class and invoke Tools > Create JUnit Test from the menu
4, Leave all settings unchanged and create the test

Now when I run the application and select to launch the TestSuite in the emulator, there are no tests (Total: 0), the
'test' button does nothing and in the output there is "jmunit.framework.cldc10.AssertionFailedException: The test case
is a prototype."

The problem seems to be in adding wrong(?) MIDlet. If I open project properties - Application Descriptor - MIDlets,
there is "jmunit.framework.cldc10.TestSuite" used for the test suite.
When this is changed to the test file ("hello.NewClassTest"), the test works fine.

Please excuse me if this is not a NB problem, or if I am just doing it wrong.
Comment 1 pribyl 2009-08-24 11:37:17 UTC
Oops, sorry, I copied wrong Exception :-/

There is java.lang.SecurityException: MIDlet not constructed by createMIDlet.

Comment 2 Adam Sotona 2010-09-27 11:13:34 UTC
The issue comes from the security check that does not allow to construct a MIDlet from another MIDlet. IT is described here" http://sites.google.com/site/franciscobenitezleon/projects/jmunit-revised

Changing this bug to an RFE to support an alternative version of JMUnit that allows to run tests on the latest emulators (and real devices) with the security mentioned check.