• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Junit-Ant Building

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi













My problem is.
While running the ant build, the "run-tests" target in my build file is taking **Test*.java files as input. Instead of that *.java files I want to give the jar which was generated as input. But am not successful.

Does anyone knows how to give it?
 
Ranch Hand
Posts: 65
IntelliJ IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Instead of that *.java files I want to give the jar which was generated as input. But am not successful. Does anyone knows how to give it?


Well, unfortunately it's impossible. You may take a look at the API documentation for BatchTest attribute of ant <junit> here As you see, in the comments for addFileSet method it's said "Add a new fileset instance to this batchtest. Whatever the fileset is, only filename that are .java or .class will be considered as 'candidates'." Furthermore, if you look at the source code for BatchTest class, you will find that it takes ResourceCollection as attribute (which could possibly be any file, even jar), but then it filters all resources by .java and .class extension. It kind of sucks, but if you need to use jar in your case, you can always create your own custom ant task and override standard functionality of <junit> task.
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic