-----Original Message-----
From: David Zeleznik [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 18, 2003 10:08 AM
To: Turbine Maven Users List
Subject: RE: integrationUnitTest


> I've looked a bit more at our situation. Currently, we have all
> our unit and
> integration tests for a particular project stored in the same directory
> tree. This is a holdover from Ant when we simply ran all the
> tests at night
> via a cron job. So, our unit tests can be considered as a strict subset of
> the integration tests. So, what I am now thinking is that our project.xml
> would contain the <unitTest> fileset definition for all the tests, ie. the
> integration tests. Then we could define a project property that
> contains an
> additional exclude pattern that will refine the integration tests into the
> unit tests. I am not sure if it is possible to modify the pom
> programmaticly, but I am going to try doing something like:
>
>   <j:set var="dummy"
> value="pom.build.unitTest.addExclude(myExcludePatternProp)" />
>
> in a test pregoal. This might serve my needs adequately for now.

FYI, I have managed to get the following to work in my test pregoal:

    <j:set var="includeProp" value="${test.mode}.includes" />
    <echo>Include var: ${includeVar}</echo>
    <j:if test="${context.getVariable(includeProp) != null}">
      <u:tokenize var="patterns"
delim=",">${context.getVariable(includeProp)}</u:tokenize>
      <j:forEach var="pattern" items="${patterns}">
        <j:set var="dummy" value="${pom.build.unitTest.addInclude(pattern)}"
/>
      </j:forEach>
    </j:if>
    <j:set var="excludeProp" value="${test.mode}.excludes" />
    <j:if test="${context.getVariable(excludeProp) != null}">
      <u:tokenize var="patterns"
delim=",">${context.getVariable(excludeProp)}</u:tokenize>
      <j:forEach var="pattern" items="${patterns}">
        <j:set var="dummy" value="${pom.build.unitTest.addExclude(pattern)}"
/>
      </j:forEach>
    </j:if>

Therefore, based on the value of test.mode I will use the corresponding
${test.mode}.includes and ${test.mode}.excludes project properties to modify
the jUnit fileset. Right now, we will support just the 2 test "modes", but
this allows flexibility to define additional named test subsets.

--------------------------------------
David Zeleznik
ILOG - Changing the rules of business
mailto:[EMAIL PROTECTED]
http://www.ilog.com
--------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to