• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Assignment submission file structure verification / ant build.xml  RSS feed

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Based on Jean's Tool, below an extended version of an assigment submission file structure verification utility.

Works on a folder that is to be jar'ed up for submission, or to be on the safe side, the un-jar'ed root folder of the submission jar file.

Simply edit the array of files/folders to be tested as required files (or non-existence, e.g. unit tests).

Handy to run as an ant java task after the submission dir is created, or the submission jar is jar'ed up, then un-jar'ed to a temporary directory for verification.


[ November 07, 2007: Message edited by: Chris Be ]
 
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that's nice! I'll use it.

My 2 cents... I would (and did) however rather use an ANT script that does the packaging like you need it, or raise an error:
- clean
- unit test (text or ui mode) + reports
- Compile
- javadoc
- version control
- packaging (only if no error occured before)
- checkstyle/PMD/cobertura reports
- ...

After using the script for a while during development, your level of confidence is just through the roof.

ANT is just not an option anymore.

since I've mentioned it... I'll post an old ant script I've used before.. I haven't use it for ages... My current SCJD is simpler, but this one has more options (so you can pick what you like)...



Among the last line caused me problems...
Had erros pasting it here.. fix the almost-last-line by removing the 2 obvious "--" :
: taskn--ame="JUnit" failoner--ror="true">


Property that goes with it...

[ November 07, 2007: Message edited by: Alex Turcot ]
 
Ranch Hand
Posts: 114
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good work guys �
Chris , your Junit test cases were fine , with a little customization and I could dig out a few missing things from my assignment
 
Chris Be
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here my two cents worth of ant build (note failoneror must be changed to failonerror due to problems in posting):


[ January 07, 2008: Message edited by: Chris Be ]
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Chris Be!

But there was an error in the "submission" target.
Instead of:

<pathelement location="${testClassesDir}/" />

the correct is:

<pathelement location="${classesDir}/" />
 
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Raphael A.", please check your private messages for an important administrative matter.
 
Chris Be
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Raphael A.:
Thanks, Chris Be!

But there was an error in the "submission" target.
Instead of:

<pathelement location="${testClassesDir}/" />

the correct is:

<pathelement location="${classesDir}/" />



I don't think you are right on this one, the submission test utility is in the test classes directory, not the classes dir containing classes for submission only.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!