<?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 mongo for key-value via maven profile in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/mongo-for-key-value-via-maven-profile/m-p/323182#M10183</link>
    <description>&lt;P&gt;Our unit tests use the use the in-memory key/value store. We would like to run the same tests from the command line via maven - but use Mongo as the key/value store. We've configured local servers via templates to use mongo as the key/value store to support functional testing. In concept, to do the same thing for unit testing, I would specify a maven profile and have that profile load those same templates. (In concept.) Can you offer general guidance on approach? (The goal is to use the same unit tests un-modified against either in-memory or mongo k/v...)&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;UPDATED: Current approach is to do the following:&lt;/EM&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Use a Maven profile to set a system property &lt;A href="https://github.com/nuxeo/nuxeo/blob/a363a807a54ddde48ada035cda27ef6859e02ee9/nuxeo-features/nuxeo-elasticsearch/nuxeo-elasticsearch-core/pom.xml"&gt;like this&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Implement a Feature - in the feature look for the property value&lt;/LI&gt;
&lt;LI&gt;Use hot deploy in the &lt;CODE&gt;start&lt;/CODE&gt; method of the Feature to load a contribution enabling mongo if the property indicates to do so&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Of course - I don't like to duplicate work - would rather use an existing Framework Feature if one exists. Looking through GitHib, so far, I do not see it. Nuxeo folks, guidance is appreciated. Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jul 2018 16:45:56 GMT</pubDate>
    <dc:creator>Eric_Ace</dc:creator>
    <dc:date>2018-07-16T16:45:56Z</dc:date>
    <item>
      <title>mongo for key-value via maven profile</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/mongo-for-key-value-via-maven-profile/m-p/323182#M10183</link>
      <description>&lt;P&gt;Our unit tests use the use the in-memory key/value store. We would like to run the same tests from the command line via maven - but use Mongo as the key/value store. We've configured local servers via templates to use mongo as the key/value store to support functional testing. In concept, to do the same thing for unit testing, I would specify a maven profile and have that profile load those same templates. (In concept.) Can you offer general guidance on approach? (The goal is to use the same unit tests un-modified against either in-memory or mongo k/v...)&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;UPDATED: Current approach is to do the following:&lt;/EM&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Use a Maven profile to set a system property &lt;A href="https://github.com/nuxeo/nuxeo/blob/a363a807a54ddde48ada035cda27ef6859e02ee9/nuxeo-features/nuxeo-elasticsearch/nuxeo-elasticsearch-core/pom.xml"&gt;like this&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Implement a Feature - in the feature look for the property value&lt;/LI&gt;
&lt;LI&gt;Use hot deploy in the &lt;CODE&gt;start&lt;/CODE&gt; method of the Feature to load a contribution enabling mongo if the property indicates to do so&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Of course - I don't like to duplicate work - would rather use an existing Framework Feature if one exists. Looking through GitHib, so far, I do not see it. Nuxeo folks, guidance is appreciated. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 16:45:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/mongo-for-key-value-via-maven-profile/m-p/323182#M10183</guid>
      <dc:creator>Eric_Ace</dc:creator>
      <dc:date>2018-07-16T16:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: mongo for key-value via maven profile</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/mongo-for-key-value-via-maven-profile/m-p/323183#M10184</link>
      <description>&lt;P&gt;Hello Eric,&lt;/P&gt;
&lt;P&gt;We don't have currently a test feature for K/V store. I just created &lt;A href="https://jira.nuxeo.com/browse/NXP-25420"&gt;NXP-25420&lt;/A&gt; for that.&lt;/P&gt;
&lt;P&gt;Using a Maven profile + Maven Surefire plugin to inject system properties is correct.&lt;/P&gt;
&lt;P&gt;Then you'll need a feature which is responsible to deploy the correct K/V implementation. Under your test resources, declare an OSGI bundle and a component owning your K/V configuration. In your feature &lt;CODE&gt;start&lt;/CODE&gt; method, you'll be able to get the runtime harness and deploy your component:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;public void start(FeaturesRunner runner) {
  try {
    RuntimeHarness harness = runner.getFeature(RuntimeFeature.class).getHarness();
    harness.deployContrib("org.nuxeo.kv.mongo.test", "OSGI-INF/kv-store-mongo-contrib.xml");
  } catch (Exception e) {
    throw new NuxeoException(e); 
  }
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This should configure the right K/V to use in tests just after Framework start and before the test run.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 09:43:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/mongo-for-key-value-via-maven-profile/m-p/323183#M10184</guid>
      <dc:creator>Kevin_Leturc</dc:creator>
      <dc:date>2018-07-17T09:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: mongo for key-value via maven profile</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/mongo-for-key-value-via-maven-profile/m-p/323184#M10185</link>
      <description>&lt;P&gt;Awesome - thank you. I have one follow-up... We also wish to do the same for the Stream Work Manager/Chronicle, as we transition to the Kafka Stream Work Manager. I can see a contribution&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 11:36:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/mongo-for-key-value-via-maven-profile/m-p/323184#M10185</guid>
      <dc:creator>Eric_Ace</dc:creator>
      <dc:date>2018-07-17T11:36:44Z</dc:date>
    </item>
  </channel>
</rss>

