I'm writing unit tests for a custom operation. I have the test deployment and execution running; however there are WARN entries in the test execution log like this:
05 Mar 2014 08:58:12 WARN TransactionHelper - No user transaction
javax.naming.NamingException: UserTransaction not found in JNDI
at org.nuxeo.runtime.transaction.TransactionHelper.lookupUserTransaction(TransactionHelper.java:83)
at org.nuxeo.runtime.transaction.TransactionHelper.commitOrRollbackTransaction(TransactionHelper.java:278)
at org.nuxeo.ecm.core.work.AbstractWork.rollbackAndRetryTransaction(AbstractWork.java:462)
at org.nuxeo.ecm.core.work.AbstractWork.work(AbstractWork.java:301)
at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:65)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
My current test annotations look like this:
@RunWith(FeaturesRunner.class)
@Deploy({"my-studio-bundle", "my-custom-plugin-bundle",
"org.nuxeo.ecm.core.persistence",
"org.nuxeo.ecm.platform.uidgen.core", "org.nuxeo.runtime.datasource",
})
@LocalDeploy({"my-custom-plugin-bundle:OSGI-INF/test-uid-datasource.xml"})
@Features({AutomationFeature.class, RuntimeFeature.class,
TransactionalFeature.class, CoreFeature.class})
@RepositoryConfig(init = DefaultRepositoryInit.class, user = "Administrator")
Some more observations:
- The number of times this traceback occurs is variable. Sometimes it does not occur. Sometimes it occurs two or three times (I have four test methods). It usually occurs at least once.
- The tests behave correctly, but I think this is because I am not checking behavior specific to any transaction rollback or commit.
- I tried some
TransactionalFeature unit tests provided with the Nuxeo source and they did not exhibit this behavior, so I want to figure out why my tests are showing this behavior and if it is something I should ignore, or how to correct it. I did not see anything obvious in the nuxeo-csv test annotations or configuration.
EDIT: I am trying to get the minimal set of annotations needed. This same problem shows up with only @Features({AutomationFeature.class}) (I probably added the others in an attempt to fix the tracebacks).