cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r1004243 - in /websites/staging/cayenne/trunk/content: ./ dev/running-unit-tests.html
Date Fri, 06 Jan 2017 11:04:48 GMT
Author: buildbot
Date: Fri Jan  6 11:04:48 2017
New Revision: 1004243

Log:
Staging update by buildbot for cayenne

Modified:
    websites/staging/cayenne/trunk/content/   (props changed)
    websites/staging/cayenne/trunk/content/dev/running-unit-tests.html

Propchange: websites/staging/cayenne/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Jan  6 11:04:48 2017
@@ -1 +1 @@
-1776377
+1777589

Modified: websites/staging/cayenne/trunk/content/dev/running-unit-tests.html
==============================================================================
--- websites/staging/cayenne/trunk/content/dev/running-unit-tests.html (original)
+++ websites/staging/cayenne/trunk/content/dev/running-unit-tests.html Fri Jan  6 11:04:48
2017
@@ -113,7 +113,35 @@ $ <span class="n">mvn</span> <span class
 </pre></div>
 
 
+<h3 id="running-against-in-memory-database">Running Against In-memory Database<a
class="headerlink" href="#running-against-in-memory-database" title="Permanent link">&para;</a></h3>
+<p>Besides HSQLDB mentioned above Cayenne has preconfigured connection information
for 
+following databases that support in-memory mode:</p>
+<ul>
+<li>derby</li>
+<li>h2</li>
+<li>sqlite</li>
+</ul>
+<p>For this databases you can run tests without any additional configuration by only
specifying
+<em>cayenneTestConnection</em> property that will activate required Maven profile:</p>
+<div class="codehilite"><pre>$ <span class="n">mvn</span> <span
class="n">test</span> <span class="o">-</span><span class="n">DcayenneTestConnection</span><span
class="p">=</span><span class="n">derby</span>
+</pre></div>
+
+
+<h3 id="running-against-database-in-docker-only-on-linux">Running Against Database
in Docker (only on Linux)<a class="headerlink" href="#running-against-database-in-docker-only-on-linux"
title="Permanent link">&para;</a></h3>
+<p>Another handy option to run Cayenne tests is with preconfigured docker profiles.
+The only thing you need is to install Docker.</p>
+<p>You can run tests with following <em>cayenneTestConnection</em> properties:</p>
+<div class="codehilite"><pre>$ <span class="n">mvn</span> <span
class="n">test</span> <span class="o">-</span><span class="n">DcayenneTestConnection</span><span
class="p">=</span><span class="n">mysql</span><span class="o">-</span><span
class="n">docker</span>
+</pre></div>
+
+
+<p>or</p>
+<div class="codehilite"><pre>$ <span class="n">mvn</span> <span
class="n">test</span> <span class="o">-</span><span class="n">DcayenneTestConnection</span><span
class="p">=</span><span class="n">postgres</span><span class="o">-</span><span
class="n">docker</span>
+</pre></div>
+
+
 <h3 id="running-against-a-specific-database">Running Against a Specific Database<a
class="headerlink" href="#running-against-a-specific-database" title="Permanent link">&para;</a></h3>
+<p>Final option to run tests against any supported database is with manual configuration.
</p>
 <h4 id="step-1-install-jdbc-driver-jars-in-a-local-maven-repo">Step 1. Install JDBC
Driver Jars in a Local Maven Repo<a class="headerlink" href="#step-1-install-jdbc-driver-jars-in-a-local-maven-repo"
title="Permanent link">&para;</a></h4>
 <p>Most commercial drivers are not present in the public Maven repositories.
 So they have to be installed by the tester locally. The group and artifact
@@ -137,12 +165,6 @@ the POM or the examples below.</p>
 </pre></div>
 
 
-<p><strong>SQLite:</strong></p>
-<div class="codehilite"><pre>$ <span class="n">mvn</span> <span
class="n">install</span><span class="p">:</span><span class="n">install</span><span
class="o">-</span><span class="n">file</span> <span class="o">-</span><span
class="n">Dfile</span><span class="p">=</span><span class="n">sqlitejdbc</span><span
class="o">-</span><span class="n">v056</span><span class="p">.</span><span
class="n">jar</span> <span class="o">-</span><span class="n">DgroupId</span><span
class="p">=</span><span class="n">org</span><span class="p">.</span><span
class="n">sqlite</span> <span class="o">\</span>
-       <span class="o">-</span><span class="n">DartifactId</span><span
class="p">=</span><span class="n">sqlite</span><span class="o">-</span><span
class="n">driver</span> <span class="o">-</span><span class="n">Dversion</span><span
class="p">=</span>0<span class="p">.</span>56 <span class="o">-</span><span
class="n">Dpackaging</span><span class="p">=</span><span class="n">jar</span>
<span class="o">-</span><span class="n">DgeneratePom</span><span
class="p">=</span><span class="n">true</span>
-</pre></div>
-
-
 <p><strong>SQLServer:</strong></p>
 <div class="codehilite"><pre>$ <span class="n">mvn</span> <span
class="n">install</span><span class="p">:</span><span class="n">install</span><span
class="o">-</span><span class="n">file</span> <span class="o">-</span><span
class="n">Dfile</span><span class="p">=</span><span class="n">sqljdbc4</span><span
class="p">.</span><span class="n">jar</span> <span class="o">-</span><span
class="n">DgroupId</span><span class="p">=</span><span class="n">com</span><span
class="p">.</span><span class="n">microsoft</span> <span class="o">\</span>
        <span class="o">-</span><span class="n">DartifactId</span><span
class="p">=</span><span class="n">sqlserver</span><span class="o">-</span><span
class="n">driver</span> <span class="o">-</span><span class="n">Dversion</span><span
class="p">=</span>4<span class="p">.</span>0 <span class="o">-</span><span
class="n">Dpackaging</span><span class="p">=</span><span class="n">jar</span>
<span class="o">-</span><span class="n">DgeneratePom</span><span
class="p">=</span><span class="n">true</span>
@@ -171,9 +193,12 @@ line options:</p>
 <p><em>cayenneTestConnection</em> is a property activating a DB-specific
Maven
 profile. <em><profile_name></em> can be one of:</p>
 <ul>
+<li>db2</li>
 <li>derby</li>
-<li>h2</li>
+<li>firebird</li>
 <li>frontbase</li>
+<li>h2</li>
+<li>ingres</li>
 <li>mysql</li>
 <li>openbase</li>
 <li>oracle</li>
@@ -189,21 +214,33 @@ similar to this example:</p>
 <div class="codehilite"><pre><span class="n">mysql</span><span
class="p">.</span><span class="n">cayenne</span><span class="p">.</span><span
class="n">adapter</span> <span class="p">=</span> <span class="n">org</span><span
class="p">.</span><span class="n">apache</span><span class="p">.</span><span
class="n">cayenne</span><span class="p">.</span><span class="n">dba</span><span
class="p">.</span><span class="n">mysql</span><span class="p">.</span><span
class="n">MySQLAdapter</span>
 <span class="n">mysql</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">username</span> <span class="p">=</span>
<span class="n">someuser</span>
 <span class="n">mysql</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">password</span> <span class="p">=</span>
<span class="n">somepasswd</span>
-<span class="n">mysql</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">url</span> <span class="p">=</span>
<span class="n">jdbc</span><span class="p">:</span><span class="n">someurl1</span>
-<span class="n">mysql</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">driver</span> <span class="p">=</span>
<span class="n">com</span><span class="p">.</span><span class="n">xyz</span><span
class="p">.</span><span class="n">MyDriverClass</span>
+<span class="n">mysql</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">url</span> <span class="p">=</span>
<span class="n">jdbc</span><span class="p">:</span><span class="n">mysql</span><span
class="p">:</span><span class="o">//</span><span class="n">mysql</span><span
class="p">.</span><span class="n">host</span><span class="p">:</span>3306<span
class="o">/</span><span class="n">test_db</span>?<span class="n">useUnicode</span><span
class="p">=</span><span class="n">true</span><span class="o">&amp;</span><span
class="n">characterEncoding</span><span class="p">=</span><span class="n">UTF</span><span
class="o">-</span>8<span class="o">&amp;</span><span class="n">generateSimpleParameterMetadata</span><span
class="p">=</span><span class="n">true</span>
+<span class="n">mysql</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">driver</span> <span class="p">=</span>
<span class="n">com</span><span class="p">.</span><span class="n">mysql</span><span
class="p">.</span><span class="n">jdbc</span><span class="p">.</span><span
class="n">Driver</span>
 
 <span class="n">oracle</span><span class="p">.</span><span class="n">cayenne</span><span
class="p">.</span><span class="n">adapter</span> <span class="p">=</span>
<span class="n">org</span><span class="p">.</span><span class="n">apache</span><span
class="p">.</span><span class="n">cayenne</span><span class="p">.</span><span
class="n">dba</span><span class="p">.</span><span class="n">oracle</span><span
class="p">.</span><span class="n">OracleAdapter</span>
 <span class="n">oracle</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">username</span> <span class="p">=</span>
<span class="n">someuser</span>
 <span class="n">oracle</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">password</span> <span class="p">=</span>
<span class="n">somepasswd</span>
-<span class="n">oracle</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">url</span> <span class="p">=</span>
<span class="n">jdbc</span><span class="p">:</span><span class="n">someurl2</span>
-<span class="n">oracle</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">driver</span> <span class="p">=</span>
<span class="n">com</span><span class="p">.</span><span class="n">xyz</span><span
class="p">.</span><span class="n">MyDriverClass</span>
+<span class="n">oracle</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">url</span> <span class="p">=</span>
<span class="n">jdbc</span><span class="p">:</span><span class="n">oracle</span><span
class="p">:</span><span class="n">thin</span><span class="p">:@</span><span
class="o">//</span><span class="n">oracle</span><span class="p">.</span><span
class="n">host</span><span class="p">:</span>1521<span class="o">/</span><span
class="n">XE</span>
+<span class="n">oracle</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">driver</span> <span class="p">=</span>
<span class="n">oracle</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">driver</span><span class="p">.</span><span
class="n">OracleDriver</span>
+
+<span class="n">postgres</span><span class="p">.</span><span class="n">adapter</span>
<span class="p">=</span> <span class="n">org</span><span class="p">.</span><span
class="n">apache</span><span class="p">.</span><span class="n">cayenne</span><span
class="p">.</span><span class="n">dba</span><span class="p">.</span><span
class="n">postgres</span><span class="p">.</span><span class="n">PostgresAdapter</span>
+<span class="n">postgres</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">username</span> <span class="p">=</span>
<span class="n">someuser</span>
+<span class="n">postgres</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">password</span> <span class="p">=</span>
<span class="n">somepasswd</span>
+<span class="n">postgres</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">url</span> <span class="p">=</span>
<span class="n">jdbc</span><span class="p">:</span><span class="n">postgresql</span><span
class="p">:</span><span class="o">//</span><span class="n">postgresql</span><span
class="p">.</span><span class="n">host</span><span class="p">:</span>5432<span
class="o">/</span><span class="n">test_db</span>
+<span class="n">postgres</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">driver</span> <span class="p">=</span>
<span class="n">org</span><span class="p">.</span><span class="n">postgresql</span><span
class="p">.</span><span class="n">Driver</span>
+
+<span class="n">db2</span><span class="p">.</span><span class="n">adapter</span>
<span class="p">=</span> <span class="n">org</span><span class="p">.</span><span
class="n">apache</span><span class="p">.</span><span class="n">cayenne</span><span
class="p">.</span><span class="n">dba</span><span class="p">.</span><span
class="n">db2</span><span class="p">.</span><span class="n">DB2Adapter</span>
+<span class="n">db2</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">username</span> <span class="p">=</span>
<span class="n">someuser</span>
+<span class="n">db2</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">password</span> <span class="p">=</span>
<span class="n">somepasswd</span>
+<span class="n">db2</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">url</span> <span class="p">=</span>
<span class="n">jdbc</span><span class="p">:</span><span class="n">db2</span><span
class="p">:</span><span class="o">//</span><span class="n">db2</span><span
class="p">.</span><span class="n">host</span><span class="p">:</span>50000<span
class="o">/</span><span class="n">test_db</span>
+<span class="n">db2</span><span class="p">.</span><span class="n">jdbc</span><span
class="p">.</span><span class="n">driver</span> <span class="p">=</span>
<span class="n">com</span><span class="p">.</span><span class="n">ibm</span><span
class="p">.</span><span class="n">db2</span><span class="p">.</span><span
class="n">jcc</span><span class="p">.</span><span class="n">DB2Driver</span>
 </pre></div>
 
 
 <p>Each property starts with the Maven profile name ("mysql" and "oracle" in
 the example above). Note that in this case you should still use
 <em>cayenneTestConnection</em>. E.g.:</p>
-<div class="codehilite"><pre>$ <span class="n">mvn</span> <span
class="n">test</span> <span class="o">-</span><span class="n">DcayenneTestConnection</span><span
class="p">=</span><span class="n">derby</span>
+<div class="codehilite"><pre>$ <span class="n">mvn</span> <span
class="n">test</span> <span class="o">-</span><span class="n">DcayenneTestConnection</span><span
class="p">=</span><span class="n">mysql</span>
 </pre></div>
        <hr>
        <p id="footer">Copyright &#169; 2001-2016 Apache Software Foundation. Apache
Cayenne, Cayenne, Apache, the Apache feather logo, and the Apache Cayenne project logo are
trademarks of The Apache Software Foundation. <a href="/privacy-policy.html">Privacy
policy</a>.



Mime
View raw message