You need to sign in to do that
Don't have an account?
Roy Luo
Invalid Interface name Queueable and System.enqueueJob Method is not implemented exception
I have a dev org working fine with the new Queueable interface. Then I need to setup a new org for QA and that org won't compile class implementing Queueable. Some dude suggested changing it to 'queueable' and that seems to fool the compiler, but codes never get run and workbench apex execute tells me this 'COMPILE ERROR: Method does not exist or incorrect signature: System.enqueue(new QTest())'. Is there any config setting I need to turn on in order to use Queueable? Class and codes are on api version 32.0.
Here is my superduper class:
public class QTest implements Queueable
{
public void execute(QueueableContext context)
{
System.debug('get here QTest.execute');
}
}
With 'Queueable' instead of 'queueable', the comipler erros out with this:
"Error: Compile Error: Invalid Interface name provided at line 1 column 14"
Codes at workbench:
QTest q = new QTest();
System.enqueueJob(q);
The error from workbench results:
COMPILE ERROR: Method does not exist or incorrect signature: System.enqueue(QTest)
LINE: 3 COLUMN: 1
Here is my superduper class:
public class QTest implements Queueable
{
public void execute(QueueableContext context)
{
System.debug('get here QTest.execute');
}
}
With 'Queueable' instead of 'queueable', the comipler erros out with this:
"Error: Compile Error: Invalid Interface name provided at line 1 column 14"
Codes at workbench:
QTest q = new QTest();
System.enqueueJob(q);
The error from workbench results:
COMPILE ERROR: Method does not exist or incorrect signature: System.enqueue(QTest)
LINE: 3 COLUMN: 1
All Answers
See the code below, without this line 'if(Test.isRunningTest()) return;', Test1 would pass, but Test2 and Test3 would throw exception on line Test.startTest complaining Test.startTest is only allowed in unit test, but it is in unit test method. Isn't it interesting? Hope this helps. It took me a long time to figure this out.