Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Create XML from Junit Testing

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jelle Klap wrote:Hmm, strange. What happens when you disable JVM forking for the JUnit task?



Same error..
 
Sheriff
Posts: 22563
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22563
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22563
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic