<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: &amp;quot;No user transaction&amp;quot; warnings in FeaturesRunner unit test execution? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315514#M2515</link>
    <description>&lt;P&gt;I actually changed my logging output to add the thread name.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Mar 2014 16:21:02 GMT</pubDate>
    <dc:creator>Steven_Huwig1</dc:creator>
    <dc:date>2014-03-05T16:21:02Z</dc:date>
    <item>
      <title>"No user transaction" warnings in FeaturesRunner unit test execution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315511#M2512</link>
      <description>&lt;P&gt;I'm writing unit tests for a custom operation. I have the test deployment and execution running; however there are &lt;CODE&gt;WARN&lt;/CODE&gt; entries in the test execution log like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;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)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My current test annotations look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;@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")
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Some more observations:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;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.&lt;/LI&gt;
&lt;LI&gt;The tests behave correctly, but I think this is because I am not checking behavior specific to any transaction rollback or commit.&lt;/LI&gt;
&lt;LI&gt;I tried some &lt;CODE&gt;TransactionalFeature&lt;/CODE&gt; 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 &lt;A href="https://github.com/nuxeo/nuxeo-csv"&gt;nuxeo-csv&lt;/A&gt; test annotations or configuration.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt; I am trying to get the minimal set of annotations needed. This same problem shows up with only &lt;CODE&gt;@Features({AutomationFeature.class})&lt;/CODE&gt; (I probably added the others in an attempt to fix the tracebacks).&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 15:15:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315511#M2512</guid>
      <dc:creator>Steven_Huwig1</dc:creator>
      <dc:date>2014-03-05T15:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: "No user transaction" warnings in FeaturesRunner unit test execution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315512#M2513</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;First you should know that some of the test features include each other, typically &lt;CODE&gt;AutomationFeature&lt;/CODE&gt; includes &lt;CODE&gt;PlatformFeature&lt;/CODE&gt; which includes &lt;CODE&gt;CoreFeature&lt;/CODE&gt; which includes &lt;CODE&gt;RuntimeFeature&lt;/CODE&gt;.
So in your test you only need to include &lt;CODE&gt;AutomationFeature&lt;/CODE&gt; and &lt;CODE&gt;TransactionalFeature&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;Then there is a notion of order in the features (in fact in the order the annotations declared by the feature are processed, in this case the &lt;CODE&gt;@RepositoryConfig&lt;/CODE&gt; annotation of the &lt;CODE&gt;TransactionalFeature&lt;/CODE&gt; declaring the &lt;CODE&gt;PoolingRepositoryFactory&lt;/CODE&gt;), so the &lt;CODE&gt;TransactionalFeature&lt;/CODE&gt; should be included first:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;@Features({ TransactionalFeature.class, AutomationFeature.class })
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of course you only &lt;STRONG&gt;need&lt;/STRONG&gt; the &lt;CODE&gt;TransactionalFeature&lt;/CODE&gt; if you want to start / commit transactions within your test. But in this case you should remove the &lt;CODE&gt;@RepositoryConfig&lt;/CODE&gt; annotation of your test as you need it configured as it is done in the &lt;CODE&gt;TransactionalFeature&lt;/CODE&gt;, using the &lt;CODE&gt;PoolingRepositoryFactory&lt;/CODE&gt; (and 'Administrator' is the default user anyway).&lt;/P&gt;
&lt;P&gt;This might keep your test passing getitng rid of the warning.&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;PS: note that I just commmited in nuxeo-csv to remove the useless &lt;CODE&gt;@RepositoryConfig&lt;/CODE&gt; in &lt;CODE&gt;TestCSVImport&lt;/CODE&gt; as it was using the same parameters as in the &lt;CODE&gt;TransactionalFeature&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 15:57:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315512#M2513</guid>
      <dc:creator>ataillefer_</dc:creator>
      <dc:date>2014-03-05T15:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: "No user transaction" warnings in FeaturesRunner unit test execution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315513#M2514</link>
      <description>&lt;P&gt;Thanks for your help. I did realize that most of the features I have originally included were not needed. I removed everything except my &lt;CODE&gt;@Deploy&lt;/CODE&gt; and &lt;CODE&gt;@LocalDeploy&lt;/CODE&gt; and the &lt;CODE&gt;AutomationFeature&lt;/CODE&gt;, and I still get the tracebacks.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 16:14:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315513#M2514</guid>
      <dc:creator>Steven_Huwig1</dc:creator>
      <dc:date>2014-03-05T16:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: "No user transaction" warnings in FeaturesRunner unit test execution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315514#M2515</link>
      <description>&lt;P&gt;I actually changed my logging output to add the thread name.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 16:21:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315514#M2515</guid>
      <dc:creator>Steven_Huwig1</dc:creator>
      <dc:date>2014-03-05T16:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: "No user transaction" warnings in FeaturesRunner unit test execution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315515#M2516</link>
      <description>&lt;P&gt;Maybe you need the TransactionalFeature for the fulltextUpdater to not generate this warning. You can always disable listeners by injecting the EventServiceAdmin and using its API&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 16:30:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315515#M2516</guid>
      <dc:creator>ataillefer_</dc:creator>
      <dc:date>2014-03-05T16:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: "No user transaction" warnings in FeaturesRunner unit test execution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315516#M2517</link>
      <description>&lt;P&gt;I did notice the EventServiceAdmin class, but had trouble finding out what names to pass into setListenerEnabledFlag.  The handlers I want to disable for unit tests are in a bundle produced by Studio, and simply using the names defined in the UI did not seem to have an effect.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 17:17:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/quot-no-user-transaction-quot-warnings-in-featuresrunner-unit/m-p/315516#M2517</guid>
      <dc:creator>Steven_Huwig1</dc:creator>
      <dc:date>2014-03-05T17:17:10Z</dc:date>
    </item>
  </channel>
</rss>

