-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Managed Classes and Triggers causing NullPointerException #1
Comments
Thank you for your reporting the issue. I'm going to try to reproduce and resolve it. |
Thanks very much. Sooner the better! :P |
Hey, I have one question. How would I set up this project in eclipse to use JIT debugging? Maybe I can take a crack at it. |
I've resolved this issue. Regarding JIT debugging, I've never used it and have no idea. |
So looking through your code you basically did the same i did to get it to work (A couple of System.out.println showed me the root of the problem). Just one thing I want to mention though is that for the namespace you are only checking for null. I ran into a problem yesterday where I got an empty string for a namespace and null for the name of the class: <codeCoverageWarnings> So in your ternary check, i would also do empty strings as well. But thanks again for looking into this and creating this wonderful tool! Just one last question though, are you using the Metadata API call runTest or the Apex API call runTest? |
…esn't reach 75%, that was introduced by the previous fix for Issue #1.
Good catch!
This software fully depends on classes that Force.com Migration Tool provides when it sends any request. |
I recently downloaded ApexTestPlus. It is great...thanks you! I am however running into Null Pointer exceptions with certain classes (same as the issue above). Were there any updates applied to get around this issue? I am using version 30.0 (Spring 14). Thanks |
Hi @meramo64 , Thank you for your feedback. |
Hi @yebihara, [apextestplus:runTest] java.lang.NullPointerException BTW this tool looks really helpful and I hope to be able to test it further. Thanks! |
Hey. I really like this tool. I think it is very useful for automating testmethods and seeing code coverage. There is only one problem I see with it so far. Managed Classes and Trigger from Managed Packages.
A test I ran to confirm this was to create a dev account and create some classes with some testmethods and no installed Packages. Your tool ran perfectly. However, when i installed "EasyDescibe", a managed package with no visibility to classes or triggers, when i ran the tool again i got a null pointer exception:
BUILD FAILED
build.xml:86: java.lang.NullPointerException
at com.force.jp.ant.apextestplus.TestResult.genCoverageResultsHtml(Unknown Source)
at com.force.jp.ant.apextestplus.TestResult.visualizeCoverageResults(Unknown Source)
at com.force.jp.ant.apextestplus.RunTestTask.execute(Unknown Source)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
What i think maybe happening is this. When I ran the metadata API call to Salesforce to runAllTests, it kicked back a portion of XML that was referring to one of the managed classes and telling where exact lines were skipped:
01pE0000001fPVhIAM 0 75 0 -1.0 0 77 0 -1.0 0 88 0 -1.0 0 89 0 -1.0 0 90 0 -1.0 DescribeObjectCon EasyDescribe 50 5 ClassHowever, when you look at the actual class that was downloaded, the only thing inside of it was:
(hidden)
So i think the problem is when you are trying to highlight the missing Line number and you dont see it, it throws a null pointer exception.
The way Salesforce handles this in there UI is to not let the user see the Line missing Hit UI, they do not create a Hyperlink for the Code Coverage Percentage for managed classes or triggers.
I think if you just create a condition where if the class is managed or has "(hidden)" as its content, just report its code coverage percentage and not show the associated Debug log for it and not show the Line Graph thing, then you are in business.
Thanks I hope you can get this done soon!
The text was updated successfully, but these errors were encountered: