+ Start a Discussion

Testing in Eclipse: additional triggers included


I am writing a test script in an apex vf extension. when I run the tests in eclipse, the test also calls a trigger which I didn't select and which is absolutely not called from the script, since it covers a different object.


When I call the same test from the online development environment, the additional trigger is not mentioned and the test covers all coding.


Can anybody explain why this additional trigger might be included in the test?



Is the trigger really called, or does it show up as 0% covered or similar?


I've found that even when running the tests from a single class in eclipse, it produces full details on the coverage of all triggers/classes. 

Hi, the trigger is not really called and doesn't show up in the log. only in the list of warnings and the code coverage results (test coverage 0%). I have many more classes and triggers which are not included in the warnings list.

Are the triggers that aren't included in the Errors & Warnings list executed by your test (e.g. when creating test data etc) - you should be able to see if they are by expanding the Code Coverage Results list below the Errors & Warnings. The ones that appear in my list are those which aren't executed (directly or otherwise) by my test.



the unneeded triggers are mentioned both in the warnings list (<1% coverage) and in the code coverage results, stating 0% coverage. this is correct, since there is no test method for that trigger yet.it is not in the debug log. and remember, when I do the test from the online development environment, the additional triggers do not appear!

another trigger, which is correctly called since I insert a triggering object in my testmethod, is not metnioned in the error list and has 100% coverage in the code coverage results.


Message Edited by MarceldeB on 03-12-2010 07:02 AM

Sounds like the Eclipse version always produces a full report, while the online version only reports on classes/triggers that were actually reached from the test script.  That mirrors my experience, though I've not really thought about it before.


Maybe the Spring 10 Eclipse will be better at this, should it ever be released :)