You need to sign in to do that
Don't have an account?
Haystack Certified
Test class for class using ApexTestQueueItem
I am using the AutomatedTestJobQueuer class mentioned in this article to execute all test classes via apex on a schedule.
http://developer.force.com/cookbook/recipe/automated-unit-test-execution
It uses ApexTestQueueItem object to execute each test class. I need to write a test class for AutomatedTestJobQueuer, but get this error on Line 63 where it tries to insert the test request:
"System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Apex tests cannot be enqueued during a test.: []"
Anyone know of a way to get around this?
http://developer.force.com/cookbook/recipe/automated-unit-test-execution
It uses ApexTestQueueItem object to execute each test class. I need to write a test class for AutomatedTestJobQueuer, but get this error on Line 63 where it tries to insert the test request:
"System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Apex tests cannot be enqueued during a test.: []"
Anyone know of a way to get around this?
You may need to use Test.isRuningTest() method.
Regards,
Mahesh
Mahesh, the code is the link.