| <html><head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>7.6 Automatically running the tests</title><link rel="stylesheet" href="css/stylesheet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="Creating an application with EclipseRT Virgo Web Server"><link rel="up" href="ch07.html" title="7. Automated Build"><link rel="prev" href="ch07s05.html" title="7.5 Adding the dependency plugin"><link rel="next" href="ch07s07.html" title="7.7 Deploying the application"><!--Begin Google Analytics code--><script type="text/javascript"> |
| var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
| document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
| </script><script type="text/javascript"> |
| var pageTracker = _gat._getTracker("UA-2728886-3"); |
| pageTracker._setDomainName("none"); |
| pageTracker._setAllowLinker(true); |
| pageTracker._trackPageview(); |
| </script><!--End Google Analytics code--></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7.6 Automatically running the tests</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch07s05.html">Prev</a> </td><th width="60%" align="center">7. Automated Build</th><td width="20%" align="right"> <a accesskey="n" href="ch07s07.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="running.tests"></a>7.6 Automatically running the tests</h2></div></div></div><p> |
| Although the application is built, and dependencies produced for separate deployment, the tests |
| are not run as part of that build. |
| </p><p> |
| Add (or replace) the following plug-in entry in the <code class="literal">pom.xml</code> file in the <code class="literal">parent</code> |
| directory under <code class="literal">start</code>: |
| </p><pre class="programlisting"><<span class="hl-tag">plugin</span>> |
| <<span class="hl-tag">groupId</span>>org.apache.maven.plugins<<span class="hl-tag">/groupId</span>> |
| <<span class="hl-tag">artifactId</span>>maven-surefire-plugin<<span class="hl-tag">/artifactId</span>> |
| <<span class="hl-tag">configuration</span>> |
| <<span class="hl-tag">includes</span>> |
| <<span class="hl-tag">include</span>>**/*Tests.java<<span class="hl-tag">/include</span>> |
| <<span class="hl-tag">/includes</span>> |
| <<span class="hl-tag">excludes</span>> |
| <<span class="hl-tag">exclude</span>>**/Abstract*.java<<span class="hl-tag">/exclude</span>> |
| <<span class="hl-tag">/excludes</span>> |
| <<span class="hl-tag">junitArtifactName</span>>org.junit:com.springsource.org.junit<<span class="hl-tag">/junitArtifactName</span>> |
| <<span class="hl-tag">argLine</span>>-javaagent:${user.home}/.m2/repository/org/springframework/org.springframework.instrument/3.0.0.M3/org.springframework.instrument-3.0.0.M3.jar<<span class="hl-tag">/argLine</span>> |
| <<span class="hl-tag">/configuration</span>> |
| <<span class="hl-tag">/plugin</span>></pre><p> |
| where the location of the user Maven repository is hard-coded. |
| </p><p> |
| Now run <code class="literal">mvn clean install</code> from the <code class="literal">start</code> directory. |
| Observe that the tests we constructed before are now run. |
| </p></div><!--Begin LoopFuse code--><script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript"></script><script type="text/javascript"> |
| _lf_cid = "LF_48be82fa"; |
| _lf_remora(); |
| </script><!--End LoopFuse code--><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch07s05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch07.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch07s07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">7.5 Adding the dependency plugin </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 7.7 Deploying the application</td></tr></table></div></body></html> |