<?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: unit test in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/unit-test/m-p/319239#M6240</link>
    <description>&lt;P&gt;Right above it in the same test method??? Document creation should be deterministic...&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2018 13:52:23 GMT</pubDate>
    <dc:creator>Florent_Guillau</dc:creator>
    <dc:date>2018-02-20T13:52:23Z</dc:date>
    <item>
      <title>unit test</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/unit-test/m-p/319238#M6239</link>
      <description>&lt;P&gt;This is a consistent behavior - a class contains several unit tests - each test inserts a few documents, then performs some manipulation on those documents. The class is declared thus:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;@Features({PlatformFeature.class, TransientStoreFeature.class})
@RepositoryConfig(init=DefaultRepositoryInit.class, cleanup=Granularity.METHOD)
@Deploy({ ... })
public class TestCaseX {
    CoreSession session;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The behavior is: when running the entire class, one particular test case - say test case #3 of 5 - will fail because a line of code &lt;CODE&gt;session.getDocument&lt;/CODE&gt; returns a null even though right above it the document was added to the repository. The test case fails from the command line using Maven, and within IntelliJ. If - in IntelliJ - I do nothing different other than put a break point on the test case statement that is returning a null - then let the test case proceed - the test succeeds. It seems like a timing issue related to how the repository is cleaned up between test cases. I have some of these working with @RandomBug.Repeat annotations. But in other cases - even this does not overcome the issue. Wondering if others have experienced this and there is a well-known practice to resolve... Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 19:15:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/unit-test/m-p/319238#M6239</guid>
      <dc:creator>Eric_Ace</dc:creator>
      <dc:date>2018-01-31T19:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: unit test</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/unit-test/m-p/319239#M6240</link>
      <description>&lt;P&gt;Right above it in the same test method??? Document creation should be deterministic...&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 13:52:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/unit-test/m-p/319239#M6240</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2018-02-20T13:52:23Z</dc:date>
    </item>
  </channel>
</rss>

