Junit testing result by Ant

Hello Experts,

i'm working with Jdeveloper Orace 10g, i try to writing testcase (JUnit) and report the results to files by Ant. And my questions :
         
. How can i export the results to file with Unicode (Vietnamese) ?
. How can i export to other file different .txt  or .xml ?

I need the answer step-by-step, clear  and i can config Ant to do that.

 Thanks
  Khacduyst
khacduystAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mick BarryJava DeveloperCommented:
yes you can achieve both using a formatter
there are examples at the bottom of the following link

http://ant.apache.org/manual/OptionalTasks/junit.html
0
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
0
khacduystAuthor Commented:
1. with your link i can't export to other file type ( different .txt .xml ).
2. pls give me some code config file build.xml to export the result file format UTF-8.


and my config error is....

     <target name="test-html">
           <junit fork="yes" printsummary="on" haltonfailure="false"  >
           <batchtest fork="yes" todir="reports" >
              <fileset  dir="classes">
                   <include name="**/*Test*.class" />
               </fileset>
            </batchtest>
       <formatter type="plain" usefile="true" />      
       <formatter type="xml" usefile="true" />
            <classpath refid="classpath" />
           </junit>
line 189 :  <junitreport>
            <fileset dir=".">
               <include name="**/*TEST-*.xml" />
            </fileset>
          <report format="noframes" />  
       </junitreport>
    </target>


Target 'test-html' failed with message 'Could not find a valid processor version implementation from oracle.xml.jaxp.JXSAXTransformerFactory'.
BUILD FAILED
localhost:\jsfGuess\Test\Client\build.xml:189: Could not find a valid processor version implementation from oracle.xml.jaxp.JXSAXTransformerFactory


what 's the error mean ? How can i fix it ?

Thanks
Khacduyst
 
0
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

khacduystAuthor Commented:
oh Mr.shivaspk you see your link is my old question...????
Thanks
0
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
oh i am sorry.
0
Mick BarryJava DeveloperCommented:
> 1. with your link i can't export to other file type ( different .txt .xml ).

sorry, thought they were the formats you wanted to ouptu to
you'll nbeed to write your own formatter class to use different format

> localhost:\jsfGuess\Test\Client\build.xml:189: Could not find a valid processor version implementation from oracle.xml.jaxp.JXSAXTransformerFactory

believe thats an oracle problem, is it possible to try running ant using J2SE (making sure xalan is available to ant)
 
0
khacduystAuthor Commented:
1. Ant can't export to other file ? Just xml and txt .(yes/no)

2. believe thats an oracle problem, is it possible to try running ant using J2SE (making sure xalan is available to ant)
    Can you help me to fix this error ?

i working with Jdeveloper Oracle 10g, test with JUnit 3.8.1, export result file with Ant 1.6.5.
 
Thanks so much. Mr.Objects
Khacduyst
0
Mick BarryJava DeveloperCommented:
1. they are the only two formats supported by default.
To output to other formats you would need to write your own formatter class

2. running ant with J2SE instead of the JDK supplied with oracle should fix it.
Not sure how to fix it with the Oracle JDK, are you using the latest version?
0
khacduystAuthor Commented:
Java Platform 1.5.0
Oracle IDE 10.1.3.34.12
JUnit 3.8.1
Ant 1.6.5

Thanks
Khacduyst

0
Mick BarryJava DeveloperCommented:
whats JAVA_HOME set to?
0
khacduystAuthor Commented:
<junit fork="yes" printsummary="on" haltonfailure="on"  >
this is the error line.

Target 'test-html' failed with message 'Test test.Carom.client.AllTests failed'.

BUILD FAILED
D:\Ghi CD\jsfGuess\Application3\Test\Client\build.xml:179: Test test.Carom.client.AllTests failed

pls help me, thanks

0
Mick BarryJava DeveloperCommented:
that appears to be saying that AllTests failed.
Check the results of that unit test.
0
khacduystAuthor Commented:
:d
file Alltests.java run ok !
but file build.xml

target name="test-html">
           <junit fork="yes" printsummary="on" haltonfailure="false"  >
           <batchtest fork="yes" todir="reports" >
              <fileset  dir="classes">
                   <include name="**/*Test*.class" />
               </fileset>
            </batchtest>
       <formatter type="plain" usefile="true" />      
       <formatter type="xml" usefile="true" />
            <classpath refid="classpath" />
           </junit>
       <junitreport>
            <fileset dir=".">
               <include name="**/*TEST-*.xml" />
            </fileset>
          <report format="noframes" />  
       </junitreport>
    </target>

if not have tag <junitreport>  it run Ok
if have tag <junitreport>  it warn error but result file still export OK



0
khacduystAuthor Commented:
my english is too bad, :D
0
khacduystAuthor Commented:
Mr.  any idea else ?
0
Mick BarryJava DeveloperCommented:
Is it the same error you were getting above?

The only mention I can find about this error is here, which says it is a known problem

http://forums.oracle.com/forums/message.jspa?messageID=1102803
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
khacduystAuthor Commented:
Thanks very much  Mr.Objects
Khacduyst
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.