Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create XML from Junit Testing

 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is wrong with my build.xml file?



When i'm running this, I get this as result:



Somebody knows whats going wrong? Sorry for the big error trace, but I hope someone can find the error faster..
 
Jelle Klap
Bartender
Posts: 1951
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, strange. What happens when you disable JVM forking for the JUnit task?
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jelle Klap wrote:Hmm, strange. What happens when you disable JVM forking for the JUnit task?


Same error..
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gynnad Paullussen wrote:

That's the main issue - the file can't be written to. Since this exception is thrown when creating a FileOutputStream, the issue is not caused by the XML file not existing. That leaves the following options:
1) Folder C:\CMSdot2\plugins\CustomLogin\testreport does not exist yet. However, it should have been created by the makedir target which is triggered by the compile script.
2) You (read: the user running ANT) don't have enough rights to write to this folder. The exception message isn't always telling the truth.
3) You (read: the user running ANT) don't have enough rights to write to this file.
4) The file is still in use by some process.
5) ?? (I can't think of any more reasons).
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The strange thing is, the file exists, this is the output:



Sorry it is a big and long file!
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps this file has been created by a previous test run, and now you don't have access to modify it anymore. One reason could be some process still having an open handle to the file.
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is not the problem, Now I changed it to this:



But I get this error:


But when I'm going to the C:/Program Files (x86)/Apache Ant/lib/junit.jar path it is correct. Or what do I need to fill in in this: <classpath refid="test.classpath" />
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your original ANT file you used Later on you had a refid to this "junit.class.path". So all you need to do to get that classpath tag to work is to add a path element with the same ID.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic