Sync docs from master to gh-pages

This commit is contained in:
buildmaster
2018-09-12 11:30:53 +00:00
parent 31aff1625a
commit acb6f15b2f
5 changed files with 151 additions and 8 deletions

View File

@@ -3297,6 +3297,59 @@ or an environment variable.</simpara>
&lt;/pluginManagement&gt;
&lt;/build&gt;</programlisting>
</section>
<section xml:id="_maven_plugin_with_spock_tests">
<title>Maven Plugin with Spock Tests</title>
<simpara>You can select the <link xl:href="http://spockframework.org/">Spock Framework</link> for creating and executing the auto-generated contract
verification tests with both Maven and Gradle plugin. However, whereas with Gradle its really straightforward,
in Maven you will require some additional setup in order to make the tests compile and execute properly.</simpara>
<simpara>First of all, you will have to use a plugin, such as <link xl:href="https://github.com/groovy/GMavenPlus">GMavenPlus</link> plugin,
to add Groovy to your project. In GMavenPlus plugin, you will need to explicitly set test sources, including both the
path where your base test classes are defined and the path were the generated contract tests are added.
Please refer to the example below:</simpara>
<programlisting language="xml" linenumbering="unnumbered">&lt;plugin&gt;
&lt;groupId&gt;org.codehaus.gmavenplus&lt;/groupId&gt;
&lt;artifactId&gt;gmavenplus-plugin&lt;/artifactId&gt;
&lt;version&gt;1.6.1&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;goals&gt;
&lt;goal&gt;compileTests&lt;/goal&gt;
&lt;goal&gt;addTestSources&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;configuration&gt;
&lt;testSources&gt;
&lt;testSource&gt;
&lt;directory&gt;${project.basedir}/src/test/groovy&lt;/directory&gt;
&lt;includes&gt;
&lt;include&gt;**/*.groovy&lt;/include&gt;
&lt;/includes&gt;
&lt;/testSource&gt;
&lt;testSource&gt;
&lt;directory&gt;
${project.basedir}/target/generated-test-sources/contracts/com/example/beer
&lt;/directory&gt;
&lt;includes&gt;
&lt;include&gt;**/*.groovy&lt;/include&gt;
&lt;include&gt;**/*.gvy&lt;/include&gt;
&lt;/includes&gt;
&lt;/testSource&gt;
&lt;/testSources&gt;
&lt;/configuration&gt;
&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
&lt;artifactId&gt;groovy-all&lt;/artifactId&gt;
&lt;version&gt;2.4.15&lt;/version&gt;
&lt;scope&gt;runtime&lt;/scope&gt;
&lt;type&gt;pom&lt;/type&gt;
&lt;/dependency&gt;
&lt;/dependencies&gt;</programlisting>
<simpara>If you uphold to the Spock convention of ending the test class names with <literal>Spec</literal>, you will also need to adjust your Maven
Surefire plugin setup, like in the following example:</simpara>
<programlisting language="xml" linenumbering="unnumbered"></programlisting>
</section>
</section>
<section xml:id="_stubs_and_transitive_dependencies">
<title>Stubs and Transitive Dependencies</title>