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 77182 - J2MEUNIT - NPE when generating tests for package with visual midlet
Summary: J2MEUNIT - NPE when generating tests for package with visual midlet
Status: VERIFIED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jiri Prazak
URL:
Keywords:
Depends on:
Blocks: 77184
  Show dependency tree
 
Reported: 2006-05-31 20:28 UTC by Lukas Hasik
Modified: 2007-05-31 13:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Hasik 2006-05-31 20:28:42 UTC
060531
-create new project with HelloMidlet
-Create Junit tests from popup menu on the hello package

-the output in console:

inspecting fileobject: HelloMidlet
Adding classes from HelloMidlet to test generation que.
inspecting fileobject: HelloMidlet
null
INFO [stderr]: java.lang.NullPointerException
INFO [stderr]:  at
org.netbeans.modules.kjava.j2meunit.TestUtils.getAllClassesFromFile(TestUtils.java:76)
INFO [stderr]:  at
org.netbeans.modules.kjava.j2meunit.TestCreator.generateTests(TestCreator.java:141)
INFO [stderr]:  at
org.netbeans.modules.kjava.j2meunit.J2MEUnitPlugin.createTests(J2MEUnitPlugin.java:69)
INFO [stderr]:  at
org.netbeans.modules.junit.plugin.JUnitPlugin$1.createTests(JUnitPlugin.java:46)
INFO [stderr]:  at
org.netbeans.modules.junit.CreateTestAction.performAction(CreateTestAction.java:181)
INFO [stderr]:  at
org.openide.util.actions.NodeAction$DelegateAction$1.run(NodeAction.java:531)
INFO [stderr]:  at
org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.actionPerformed(ActionsBridge.java:81)

INFO [stderr]:  at
org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:75)
INFO [stderr]:  at
org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:24)
INFO [stderr]:  at
org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.doRun(ActionsBridge.java:72)
INFO [stderr]:  at
org.netbeans.modules.openide.util.ActionsBridge$1.run(ActionsBridge.java:41)
INFO [stderr]:  at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:516)
INFO [stderr]:  at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:949)
SEVERE [org.openide.util.RequestProcessor]
java.lang.NullPointerException
        at
org.netbeans.modules.kjava.j2meunit.TestCreator.generateTests(TestCreator.java:160)
        at
org.netbeans.modules.kjava.j2meunit.J2MEUnitPlugin.createTests(J2MEUnitPlugin.java:69)
        at
org.netbeans.modules.junit.plugin.JUnitPlugin$1.createTests(JUnitPlugin.java:46)
        at
org.netbeans.modules.junit.CreateTestAction.performAction(CreateTestAction.java:181)
        at
org.openide.util.actions.NodeAction$DelegateAction$1.run(NodeAction.java:531)
        at
org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.actionPerformed(ActionsBridge.java:81)
        at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:75)
        at
org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:24)
        at
org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.doRun(ActionsBridge.java:72)
        at
org.netbeans.modules.openide.util.ActionsBridge$1.run(ActionsBridge.java:41)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:516)
        at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:949)



*It seems that the root cause is the visual midlet because generating of tests
for a package without a visual midlet works*
Comment 1 Lukas Hasik 2006-05-31 20:31:49 UTC
generating of tests for visual midlet work when it's invoked from popup menu on
the visual midlet
Comment 2 Lukas Hasik 2006-06-23 15:09:25 UTC
moving to mobility component
Comment 3 Jiri Prazak 2006-06-26 16:58:03 UTC
fixed.  the problem was that when you iterate through all data files returned on
a package, the test generator was trying to get a resource on such data files as
mvd and the resource returned was null because you can only get resource on
valid java files.  added filter to make only java files testable.
Comment 4 Lukas Hasik 2006-06-28 14:15:26 UTC
verified in jars from 0627, no NPE
Comment 5 Lukas Hasik 2006-07-12 14:14:35 UTC
verified in 5.5 Beta2 candidate