I am building a JUnit test class for Google client endpoint. One of my test scenario is to run some tasks in the local task queue. I am stuck now, because I can't use ServletInvokingTaskCallback as documented in Google's documentation. Does anyone have any idea?
Here's my initiation statement:
private static final LocalServiceTestHelper helper =
new LocalServiceTestHelper(
new LocalDatastoreServiceTestConfig().setNoStorage(false).setApplyAllHighRepJobPolicy(),
new LocalTaskQueueTestConfig().setQueueXmlPath("src/main/webapp/WEB-INF/queue.xml).setCallbackClass(LocalTaskQueueTestConfig.ServletInvokingTaskCallback.class));
Here's the exception I am getting java.lang.RuntimeException: java.lang.InstantiationException
at com.google.appengine.api.taskqueue.dev.LocalTaskQueue.initializeCallback(LocalTaskQueue.java:159)
at com.google.appengine.api.taskqueue.dev.LocalTaskQueue.init(LocalTaskQueue.java:149)
at com.google.appengine.tools.development.ApiProxyLocalImpl.startServices(ApiProxyLocalImpl.java:623)
at com.google.appengine.tools.development.ApiProxyLocalImpl.access$700(ApiProxyLocalImpl.java:47)
at com.google.appengine.tools.development.ApiProxyLocalImpl$2.run(ApiProxyLocalImpl.java:604)
at com.google.appengine.tools.development.ApiProxyLocalImpl$2.run(ApiProxyLocalImpl.java:601)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.appengine.tools.development.ApiProxyLocalImpl.getService(ApiProxyLocalImpl.java:600)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.callInternal(ApiProxyLocalImpl.java:505)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:484)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:461)
at java.util.concurrent.Executors$PrivilegedCallable$1.run(Executors.java:533)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.concurrent.Executors$PrivilegedCallable.call(Executors.java:530)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
I am building a JUnit test class for Google client endpoint. One of my test scenario is to run some tasks in the local task queue. I am baffled, because the task writes its data to a different repository than the one used by the JUnit test.
Here's my initiation statement:
private static final LocalServiceTestHelper helper =
new LocalServiceTestHelper(
new LocalDatastoreServiceTestConfig().setNoStorage(false).setApplyAllHighRepJobPolicy(),
new LocalTaskQueueTestConfig().setQueueXmlPath("src/main/webapp/WEB-INF/queue.xml).setCallbackClass(LocalTaskQueueTestConfig.ServletInvokingTaskCallback.class));
Does anyone have any idea how I can make the task (queue) to run against the same repository? Thanks!