JUnit report does not show executed tests - ant

I am trying to generate JUnit report using Ant. I have created the build.xml given below:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. --><project basedir="." default="build" name="myWebApp">
<property environment="env"/>
<property name="M2_REPO" value="C:/Users/samprity.kashyap/.m2/repository"/>
<property name="ECLIPSE_HOME" value="C:/install/eclipse-jee-juno-win32/eclipse"/>
<property name="junit.output.dir" value="junit"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.7"/>
<property name="source" value="1.7"/>
<path id="Apache Tomcat v7.0 [Apache Tomcat v7.0].libraryclasspath">
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/annotations-api.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/antlr-2.7.7.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/catalina-ant.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/catalina-ha.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/catalina-tribes.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/catalina.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/commons-logging-1.1.1.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/dom4j-1.6.1.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/ecj-3.7.2.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/el-api.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/hibernate-commons-annotations-4.0.1.Final.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/hibernate-core-4.1.8.Final.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/jasper-el.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/jasper.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/javassist-3.15.0-GA.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/jboss-logging-3.1.0.GA.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/jsp-api.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/junit-4.8.2.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/mybatis-3.0.3.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/mysql-connector-java-5.1.12-bin.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.aop-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.asm-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.aspects-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.beans-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.context-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.context.support-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.core-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.expression-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.instrument-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.instrument.tomcat-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.jdbc-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.jms-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.orm-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.oxm-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.test-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.transaction-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.web-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.web.portlet-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.web.servlet-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/org.springframework.web.struts-3.1.2.RELEASE.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/servlet-api.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-api.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-coyote.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-dbcp.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-i18n-es.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-i18n-fr.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-i18n-ja.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-jdbc.jar"/>
<pathelement location="../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-util.jar"/>
</path>
<path id="myWebApp.classpath">
<pathelement location="target/classes"/>
<pathelement location="${M2_REPO}/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar"/>
<pathelement location="${M2_REPO}/junit/junit/4.5/junit-4.5.jar"/>
<pathelement location="${M2_REPO}/org/springframework/spring-core/3.2.0.RELEASE/spring-core-3.2.0.RELEASE.jar"/>
<pathelement location="${M2_REPO}/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
<pathelement location="${M2_REPO}/log4j/log4j/1.2.14/log4j-1.2.14.jar"/>
<pathelement location="${M2_REPO}/org/springframework/spring-web/3.2.0.RELEASE/spring-web-3.2.0.RELEASE.jar"/>
<pathelement location="${M2_REPO}/org/springframework/spring-context/3.2.0.RELEASE/spring-context-3.2.0.RELEASE.jar"/>
<pathelement location="${M2_REPO}/org/springframework/spring-aop/3.2.0.RELEASE/spring-aop-3.2.0.RELEASE.jar"/>
<pathelement location="${M2_REPO}/aopalliance/aopalliance/1.0/aopalliance-1.0.jar"/>
<pathelement location="${M2_REPO}/org/springframework/spring-beans/3.2.0.RELEASE/spring-beans-3.2.0.RELEASE.jar"/>
<pathelement location="${M2_REPO}/org/springframework/spring-expression/3.2.0.RELEASE/spring-expression-3.2.0.RELEASE.jar"/>
<pathelement location="${M2_REPO}/org/springframework/spring-webmvc/3.2.0.RELEASE/spring-webmvc-3.2.0.RELEASE.jar"/>
<pathelement location="${M2_REPO}/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar"/>
<pathelement location="${M2_REPO}/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar"/>
<pathelement location="${M2_REPO}/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar"/>
<pathelement location="${M2_REPO}/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar"/>
<pathelement location="${M2_REPO}/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar"/>
<pathelement location="${M2_REPO}/antlr/antlr/2.7.6/antlr-2.7.6.jar"/>
<pathelement location="${M2_REPO}/cglib/cglib/2.1_3/cglib-2.1_3.jar"/>
<pathelement location="${M2_REPO}/asm/asm/1.5.3/asm-1.5.3.jar"/>
<pathelement location="${M2_REPO}/org/hibernate/hibernate-annotations/3.3.1.GA/hibernate-annotations-3.3.1.GA.jar"/>
<pathelement location="${M2_REPO}/org/hibernate/hibernate-commons-annotations/3.0.0.ga/hibernate-commons-annotations-3.0.0.ga.jar"/>
<pathelement location="${M2_REPO}/org/hibernate/ejb3-persistence/1.0.1.GA/ejb3-persistence-1.0.1.GA.jar"/>
<pathelement location="${M2_REPO}/mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1.6.jar"/>
<pathelement location="${M2_REPO}/org/springframework/flex/spring-flex-core/1.5.0.BUILD-SNAPSHOT/spring-flex-core-1.5.0.BUILD-SNAPSHOT.jar"/>
<pathelement location="${M2_REPO}/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
<pathelement location="${M2_REPO}/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/>
<pathelement location="${M2_REPO}/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar"/>
<pathelement location="${M2_REPO}/org/springframework/spring-context-support/3.0.5.RELEASE/spring-context-support-3.0.5.RELEASE.jar"/>
<pathelement location="${M2_REPO}/com/adobe/blazeds/blazeds-core/4.0.0.14931/blazeds-core-4.0.0.14931.jar"/>
<pathelement location="${M2_REPO}/com/adobe/blazeds/blazeds-common/4.0.0.14931/blazeds-common-4.0.0.14931.jar"/>
<pathelement location="${M2_REPO}/com/adobe/blazeds/blazeds-proxy/4.0.0.14931/blazeds-proxy-4.0.0.14931.jar"/>
<pathelement location="${M2_REPO}/com/adobe/blazeds/blazeds-remoting/4.0.0.14931/blazeds-remoting-4.0.0.14931.jar"/>
<pathelement location="${M2_REPO}/org/springframework/spring-test/3.2.0.RELEASE/spring-test-3.2.0.RELEASE.jar"/>
<path refid="Apache Tomcat v7.0 [Apache Tomcat v7.0].libraryclasspath"/>
</path>
<target name="init">
<mkdir dir="target/classes"/>
<copy includeemptydirs="false" todir="target/classes">
<fileset dir="src/main/java">
<include name="**/*.java"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy includeemptydirs="false" todir="target/classes">
<fileset dir="src/main/resources">
<exclude name="**/*.java"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="target/classes"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="target/classes" includeantruntime="false" source="${source}" target="${target}">
<src path="src/main/java"/>
<src path="src/main/resources"/>
<include name="**/*.java"/>
<exclude name="**/*.java"/>
<classpath refid="myWebApp.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
<target name="MapManagerTest">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="com.sample.application.MapManagerTest" todir="${junit.output.dir}"/>
<classpath refid="myWebApp.classpath"/>
</junit>
</target>
<target name="MapManagerTest.testCheckUser">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="com.sample.application.MapManagerTest" todir="${junit.output.dir}"/>
<classpath refid="myWebApp.classpath"/>
</junit>
</target>
<junitreport todir="./junit">
<fileset dir="./junit">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="./junit/html"/>
</junitreport>
</project>
But the reports generated do not show any value. I have created a folder called junit where the html pages are generated. the overall-summary.html shows:
Tests Failures Errors Success rate Time
0 0 0 NaN 0.000
Console output:
Hibernate:
select
user0_.id as id0_,
user0_.password as password0_,
user0_.username as username0_
from
USER user0_
where
user0_.username=?
Hibernate:
select
userdetail0_.id as id1_0_,
userdetail0_.firstname as firstname1_0_
from
USERDETAILS userdetail0_
where
userdetail0_.id=?
User [id=4, userName=xyz, password=abc]
and the test case
#Test
public void testCheckUser() {
User user=new User();
user.setId(4);
user.setUserName("xyz");
user.setPassword("abc");
UserDetails userDetails= new UserDetails();
user.setUserDetails(userDetails);
user1=mapManager.checkUser(user);
equals(user1.equals(user));
}
this is the console output on running build.xml
Buildfile: D:\Users\samprity.kashyap\workspace\myWebApp\build.xml
build-subprojects:
init:
build-project:
[echo] myWebApp: D:\Users\samprity.kashyap\workspace\myWebApp\build.xml
build:
junitreport:
[junitreport] Processing D:\Users\samprity.kashyap\workspace\myWebApp\junit\TESTS-TestSuites.xml to C:\Users\SAMPRI~1.KAS\AppData\Local\Temp\null1323106157
[junitreport] Loading stylesheet jar:file:/C:/install/eclipse-jee-juno-win32/eclipse/plugins/org.apache.ant_1.8.3.v20120321-1730/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 232ms
[junitreport] Deleting: C:\Users\SAMPRI~1.KAS\AppData\Local\Temp\null1323106157
build-subprojects:
init:
build-project:
[echo] myWebApp: D:\Users\samprity.kashyap\workspace\myWebApp\build.xml
build-refprojects:
init-eclipse-compiler:
[unzip] Expanding: C:\install\eclipse-jee-juno-win32\eclipse\plugins\org.eclipse.jdt.core_3.8.1.v20120531-0637.jar into C:\install\eclipse-jee-juno-win32\eclipse\plugins\org.apache.ant_1.8.3.v20120321-1730\lib
[unzip] Expanding: C:\install\eclipse-jee-juno-win32\eclipse\plugins\org.eclipse.jdt.core_3.8.2.v20120814-155456.jar into C:\install\eclipse-jee-juno-win32\eclipse\plugins\org.apache.ant_1.8.3.v20120321-1730\lib
BUILD SUCCESSFUL
Total time: 2 seconds

Related

Not able to execute testNG xml from ANT build.xml

I am using below build.xml to execute my testng xml. This build.xml is working fine for me when I required only Selenium standalone jar.
<project name="TestNGTest" default="test" basedir=".">
<!-- Define <testng> task -->
<taskdef name="testng" classname="org.testng.TestNGAntTask">
<classpath>
<pathelement location="SupportFiles/JarFiles/commons-cli-1.0.jar" />
<pathelement location="SupportFiles/JarFiles/commons-logging.jar" />
<pathelement location="SupportFiles/JarFiles/crimson.jar" />
<pathelement location="SupportFiles/JarFiles/hsqldb.jar" />
<pathelement location="SupportFiles/JarFiles/jaxp.jar" />
<pathelement location="SupportFiles/JarFiles/jconfig.jar" />
<pathelement location="SupportFiles/JarFiles/jmxri.jar" />
<pathelement location="SupportFiles/JarFiles/jxl.jar" />
<pathelement location="SupportFiles/JarFiles/mysql-connector-java-5.1.6-bin.jar" />
<pathelement location="SupportFiles/JarFiles/selenium-server-standalone-2.45.0.jar" />
<pathelement location="SupportFiles/JarFiles/xlSQL_Y8.jar" />
</classpath>
</taskdef>
<property name="testdir" location="bin" />
<property name="srcdir" location="src" />
<property name="libdir" location="SupportFiles" />
<property name="subdir" location="JarFiles" />
<property name="full-compile" value="true" />
<path id="classpath.base" />
<path id="classpath.test">
<!--pathelement location="${libdir}/testng-6.8.5.jar" /-->
<!--pathelement location="${subdir}/SeleniumTestNG.jar" /-->
<pathelement location="${subdir}/selenium-server-standalone-2.45.0.jar" />
<pathelement location="${subdir}/commons-cli-1.0.jar" />
<pathelement location="${subdir}/commons-logging.jar" />
<pathelement location="${subdir}/crimson.jar" />
<pathelement location="${subdir}/hsqldb.jar" />
<pathelement location="${subdir}/jaxp.jar" />
<pathelement location="${subdir}/jconfig.jar" />
<pathelement location="${subdir}/jmxri.jar" />
<pathelement location="${subdir}/jxl.jar" />
<pathelement location="${subdir}/mysql-connector-java-5.1.6-bin.jar" />
<pathelement location="${subdir}/xlSQL_Y8.jar" />
<!-- pathelement location="${libdir}/jxl-2.6.12.jar"/-->
<pathelement location="${testdir}" />
<fileset dir="${testdir}" includes="*.jar" />
<fileset dir="${libdir}">
<include name="**/*.jar" />
</fileset>
<pathelement location="${testdir}" />
<pathelement location="${srcdir}" />
<path refid="classpath.base" />
</path>
<target name="clean">
<delete verbose="${full-compile}">
<fileset dir="${testdir}" includes="**/*.class" />
</delete>
</target>
<target name="compile" depends="clean">
<javac srcdir="${srcdir}" destdir="${testdir}" verbose="${full-compile}" fork="yes" includeantruntime="false">
<classpath refid="classpath.test" />
</javac>
</target>
<target name="test" depends="compile">
<testng outputdir="C:\Users\A592013\.jenkins\jobs\Jenkins - Selenium\workspace\test-output" classpathref="classpath.test">
<xmlfileset dir="." includes="TestNG_Sanity.xml" />
</testng>
</target>
</project>
It is giving below message as BUILD SUCCESSFUL, however not executing the scripts. Below is the detail warning message:
[javac] C:\DurgeshProjectWork\Workspace\SeleniumWorkspace\DevOps_DIT\src\net\atos\selenium\common\XML.java:835: warning: OutputFormat is internal proprietary API and may be removed in a future release
[javac] OutputFormat format = new OutputFormat(document);
[javac] ^
[javac] C:\DurgeshProjectWork\Workspace\SeleniumWorkspace\DevOps_DIT\src\net\atos\selenium\common\XML.java:835: warning: OutputFormat is internal proprietary API and may be removed in a future release
[javac] OutputFormat format = new OutputFormat(document);
[javac]
Can anyone please tell what is wrong in my build.xml
Thanks a lit for your help on this. Just a FYI. I am reading excel data with the help of XLSQL 8 so required all these jars to execute this.
Thanks a lot for your help on this.
^

ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception

I have performed a Junit test successfully from eclipse.
So i wanted to execute the same test cases from Jenkins.
For that i have written the build.xml (ant build).
<path id="classpath">
<pathelement location="lib\junit-4.12-javadoc.jar" />
<pathelement location="lib\junit-4.12-sources.jar" />
<pathelement location="lib\junit-4.12.jar" />
<pathelement location="lib\ojdbc14.jar" />
<pathelement location="lib\oraclejdbc.jar" />
<pathelement location="lib\testng-6.8.5.jar" />
<pathelement location="bin" />
</path>
<target name="compile">
<javac classpath="classpath" includeantruntime="false" srcdir="./src" destdir="bin" includes="**/*.java" verbose="true">
</javac>
</target>
<target name="run_tests" depends="compile">
<junit printsummary="on" haltonfailure="false" showoutput="yes">
<formatter type="xml" usefile="false" />
<test name="om.wipro.TestDbUpdates" />
<test name="om.wipro.TestExample" />
<classpath>
<pathelement location="lib\junit-4.12-javadoc.jar" />
<pathelement location="lib\junit-4.12-sources.jar" />
<pathelement location="lib\junit-4.12.jar" />
<pathelement location="lib\ojdbc14.jar" />
<pathelement location="lib\oraclejdbc.jar" />
<pathelement location="lib\testng-6.8.5.jar" />
<pathelement location="bin" />
</classpath>
</junit>
</target>
My problem is that, the execution from Jenkins is not successful. Build is successful(from both eclipse and Jenkins) though test cases are failing.
How to get rid of the following error?
ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception
hudson.AbortException:
Regards,
Sharon M P
There is a ticket about this error:
https://issues.jenkins-ci.org/browse/JENKINS-24946
If you are using Jenkins version "V1.582", they recommend to upgrade to the latest version to solve this issue.
You can check your jenkins version at the bottom/right of the web page.

BUILD FAILED and didn't generate report when executing junit test cases through ANT

I am trying to use ant to run junit tests and generate reports. Its give the error "BUILD FAILED" and didn't generate the report. the junit report folder is empty.
What am I doing wrong ?
This is my build.xml :
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. --><project basedir="." default="build" name="SeleniumProject">
<property environment="env"/>
<property name="ECLIPSE_HOME" value="../../../../eclipse-jee-indigo-SR2-win32-x86_64/eclipse"/>
<property name="junit.output.dir" value="junit"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.7"/>
<property name="source" value="1.7"/>
<path id="JUnit 4.libraryclasspath">
<pathelement location="${ECLIPSE_HOME}/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/junit.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.hamcrest.core_1.1.0.v20090501071000.jar"/>
</path>
<path id="SeleniumProject.classpath">
<pathelement location="bin"/>
<path refid="JUnit 4.libraryclasspath"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/selenium-java-2.41.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/selenium-java-2.41.0-srcs.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/selenium-server-standalone-2.41.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/apache-mime4j-0.6.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/bsh-1.3.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/cglib-nodep-2.1_3.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-codec-1.8.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-collections-3.2.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-exec-1.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-io-2.2.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-jxpath-1.3.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-lang3-3.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/commons-logging-1.1.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/cssparser-0.9.11.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/guava-15.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/hamcrest-core-1.3.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/hamcrest-library-1.3.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/htmlunit-2.13.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/htmlunit-core-js-2.13.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/httpclient-4.3.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/httpcore-4.3.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/httpmime-4.3.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/ini4j-0.5.2.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/jcommander-1.29.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/jetty-websocket-8.1.8.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/jna-3.4.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/jna-platform-3.4.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/json-20080701.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/junit-dep-4.11.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/nekohtml-1.9.19.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/netty-3.5.7.Final.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/operadriver-1.5.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/phantomjsdriver-1.1.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/protobuf-java-2.4.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/sac-1.3.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/serializer-2.7.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/testng-6.8.5.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/xalan-2.7.1.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/xercesImpl-2.10.0.jar"/>
<pathelement location="../../../../selenium-java-2.41.0/selenium-2.41.0/libs/xml-apis-1.4.01.jar"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="SeleniumProject.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
<target name="absolutexpath (1)">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="absolutexpath" todir="${junit.output.dir}"/>
<classpath refid="SeleniumProject.classpath"/>
</junit>
</target>
<target name="dropdown">
<java classname="DropDown" failonerror="true" fork="yes">
<classpath refid="SeleniumProject.classpath"/>
</java>
</target>
<target name="relativexpath (1)">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="relativexpath" todir="${junit.output.dir}"/>
<classpath refid="SeleniumProject.classpath"/>
</junit>
</target>
<target name="verifytextbycss">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="Verifytextbycss" todir="${junit.output.dir}"/>
<classpath refid="SeleniumProject.classpath"/>
</junit>
</target>
<target name="Verifytextbyid (1)">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="Verifytextbyid" todir="${junit.output.dir}"/>
<classpath refid="SeleniumProject.classpath"/>
</junit>
</target>
<target name="verifytitle (1)">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="verifytitle" todir="${junit.output.dir}"/>
<classpath refid="SeleniumProject.classpath"/>
</junit>
</target>
<target name="junitreport">
<junitreport todir="${junit.output.dir}">
<fileset dir="${junit.output.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${junit.output.dir}"/>
</junitreport>
</target>
AND THIS IS THE OUTPUT OF THE CONSOLE:
Buildfile: C:\Users\Roshan\workspace\SeleniumProject\build.xml
build-subprojects:
init:
build-project:
[echo] SeleniumProject: C:\Users\Roshan\workspace\SeleniumProject\build.xml
[javac] C:\Users\Roshan\workspace\SeleniumProject\build.xml:78: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
build:
junitreport:
[junitreport] Processing C:\Users\Roshan\workspace\SeleniumProject\junit\TESTS-TestSuites.xml to C:\Windows\null231041511
[junitreport] Loading stylesheet jar:file:/C:/apache-ant-1.9.4-bin/apache-ant-1.9.4/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Failed to process C:\Users\Roshan\workspace\SeleniumProject\junit\TESTS-TestSuites.xml
BUILD FAILED
C:\Users\Roshan\workspace\SeleniumProject\build.xml:143: Errors while applying transformations: java.io.FileNotFoundException: C:\Windows\null231041511 (Access is denied)
Total time: 942 milliseconds
The Junit tests are run in the absolutexpath and relativexpath targets. i don't see either of those in "depends" attributes. Your output implies they aren't run either.
Also, you get the message:
C:\Windows\null231041511 (Access is denied)
Can you point to a directory that you have read and write access to like c:\temp?

svnantlib.xml could not be found

I have ant file like..
<?xml version="1.0"?>
<project name="antSVN" default="build" basedir=".">
<path id="path.svnant">
<pathelement location="svnant.jar"/>
<pathelement location="svnClientAdapter.jar"/>
<pathelement location="svnjavahl.jar"></pathelement>
<!-- <pathelement location="/home/ezdi/apache_ant/svnant-1.3.1/lib/svnant.jar"/>
<pathelement location="/home/ezdi/apache_ant/svnant-1.3.1/lib/svnClientAdapter.jar" />
<pathelement location="/home/ezdi/apache_ant/svnant-1.3.1/lib/svnjavahl.jar" /> -->
</path>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpath="path.svnant"/>
<target name="checkout">
<svn username="charvee" password="charvee123">
<checkout url="svn+ssh://charvee#192.168.1.210/home/EZCAC/source/ezCACWeb" revision="HEAD" destpath="src" />
</svn>
</target>
<target name="update-codebase">
<svn username="${svn.username}" password="${svn.password}">
<update revision="HEAD" recurse="true" dir="${project.code}" />
</svn>
</target>
<target name="build" depends="checkout">
<description>Main target</description>
</target>
it gives me error like:
Buildfile: /home/charvee/ANT_WS/antSVN/build.xml
[typedef] Could not load definitions from resource org/tigris/subversion/svnant/svnantlib.xml. It could not be found.
checkout:
what to do now??
You should make sure the following jars are in your %ANT_HOME%\lib:
svnant.jar
svnClientAdapter.jar
svnjavahl.jar
And then re-try. Hope that make sense.

Groovy-TestNG-Ant running error

I've faced with next problem.
Trying to create pilot test-project using Groovy, TestNG, ant.
If I run tests from my IDE (Eclipse) - all is ok.
But when I try run tests using ant - not easy for me problem. Could you help me?
build.xml is present below.
Compile target - pass ok, but on runTest target I see problem:
"Exception in thread "main" java.lang.NoClassDefFoundError: groovy/lang/GroovyObject"
<project basedir="." default="runTest" name="Ant file for TestNG">
<property name="src" location="src" />
<property name="build" location="build" />
<property name="libs" location="lib" />
<path id="class.path">
<pathelement location="${libs}/testng.jar" />
<pathelement location="lib/testng.jar"/>
<pathelement location="${build}" />
</path>
<taskdef name="testng" classname="org.testng.TestNGAntTask">
<classpath>
<pathelement location="lib/groovy-all.jar"/>
<pathelement location="lib/testng.jar"/>
</classpath>
</taskdef>
<target name="runTest" depends="compile">
<mkdir dir="testng_output"/><!-- Create the output directory. -->
<testng outputdir="testng_output" classpathref="class.path">
<xmlfileset dir="." includes="testng.xml"/>
</testng>
</target>
<target name="compile">
<delete dir="build"/>
<mkdir dir="build"/>
<taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="lib/groovy-all.jar"/>
<groovyc srcdir="src" destdir="./build">
<classpath>
<pathelement path="lib/groovy-all.jar"/>
<pathelement path="lib/testng.jar"/>
</classpath>
<javac source="1.7" target="1.7" debug="off" />
</groovyc>
</target>
</project>
And this is testng.xml
<suite name="My Test Suite" parallel="methods" thread-count="5">
<test name="My Test">
<classes>
<class name="test1" />
</classes>
</test>
</suite>

Resources