File: plugin.jelly

package info (click to toggle)
testng 6.8.8-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 9,364 kB
  • ctags: 10,275
  • sloc: java: 52,394; xml: 2,984; php: 35; sh: 21; makefile: 5
file content (88 lines) | stat: -rwxr-xr-x 3,298 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<project xmlns:j="jelly:core"
    xmlns:ant="jelly:ant" 
    xmlns:doc="doc"
    xmlns:maven="jelly:maven"
    xmlns:util="jelly:util" >


  <!-- ================================================================== -->
  <!-- Registration                                                       -->
  <!-- ================================================================== -->
  <goal name="maven-testng-plugin:register">
      <doc:registerReport 
        name="TestNG Tests"
        pluginName="maven-testng-plugin"
        description="Report on the results of the TestNG framework tests."
        link="testng-report"/>
   </goal>

   <goal name="maven-testng-plugin:deregister">
      <doc:deregisterReport name="TestNG Tests"/>
   </goal>


   <goal name="testng-init">
	  <ant:taskdef classpath="${plugin.getDependencyClasspath()}" 
	               name="testng" 
	               classname="org.testng.TestNGAntTask" />
  </goal>

  <goal name="testng" prereqs="testng-init,test:compile">

      <ant:mkdir dir="${maven.testng.output.dir}"/>

      <testng fork="yes"
	          outputDir="${maven.testng.output.dir}"
	          sourceDir="${maven.testng.source.dir}"
	          classpath="${maven.build.dir}/test-classes/;${maven.build.dir}/classes/">
			
		  <xmlfileset dir="${maven.testng.suitexml.dir}" 
		              includes="${maven.testng.suitexml.name}"/>
	
		  <ant:classpath>
		      <ant:path refid="maven.dependency.classpath"/>
		  </ant:classpath>
      </testng>
  </goal>



	<!-- ================= TestNG JUnitreport Goal ======================== -->
	
	<goal name="maven-testng-junit-report" prereqs="testng">   
	    <ant:mkdir dir="${maven.testng.report.dir}"/>
            
	    <!-- There seems to be an issue with transformer properties- this forces the correct one -->
	    <!-- for Java 1.5 and others below it. This error should be avoided:  -->
	    <!-- Provider com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl not found  -->	    
	    <j:choose>
		    <j:when test="${systemScope['java.runtime.version'].startsWith('1.5')}">
			${systemScope.setProperty('javax.xml.transform.TransformerFactory','com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl')}	
		    </j:when>
		    <j:otherwise>
			${systemScope.setProperty('javax.xml.transform.TransformerFactory','org.apache.xalan.processor.TransformerFactoryImpl')}
		   </j:otherwise>
           </j:choose>

	    <junitreport todir="${maven.testng.report.dir}" tofile="TestNG-Suites.xml">
	        <fileset dir="${maven.testng.output.dir}">
	            <include name="*.xml"/>
	        </fileset>
	        <report format="noframes" todir="${maven.testng.report.dir}"/>
	        <ant:classpath>
	          <ant:path refid="maven.dependency.classpath"/>  
	          <ant:pathelement path="plugin.getDependencyClasspath()"/>
	        </ant:classpath>
	    </junitreport>
	</goal>

	<!-- ==== TestNG Stylize the JUnitReports to Maven Styles Goal ======= -->
	
	<goal name="testng:junit-report" prereqs="maven-testng-junit-report">
	    <doc:jsl input="${maven.testng.report.dir}/TestNG-Suites.xml"
	            output="testng-report.xml"
	            stylesheet="${plugin.resources}/junitRpt.jsl"
	            outputMode="xml"
	            prettyPrint="true"/>
	</goal>
</project>