File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Assignment submission file structure verification / ant build.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Assignment submission file structure verification / ant build.xml" Watch "Assignment submission file structure verification / ant build.xml" New topic
Author

Assignment submission file structure verification / ant build.xml

Chris Be
Ranch Hand

Joined: Sep 11, 2006
Posts: 36
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 ]

ChrisBe<br />-------<br />SCJP, SCJD, SCEA in the making
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
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 ]
Naveen Narayanan
Ranch Hand

Joined: Sep 11, 2007
Posts: 114

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


SCJP 5.0, SCJD, SCWCD
Chris Be
Ranch Hand

Joined: Sep 11, 2006
Posts: 36
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 ]
Raphael Soturno
Greenhorn

Joined: Sep 02, 2008
Posts: 3
Thanks, Chris Be!

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

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

the correct is:

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


SCJP 1.4 (98%)<br />SCWCD 1.4 (85%)<br />SCJA 1.0 (88%)<br />SCBCD 5 (86%)<br />SCJD (370/400)<br />SCEA 5 - Part 1: 78%
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60975
    
  65

"Raphael A.", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Chris Be
Ranch Hand

Joined: Sep 11, 2006
Posts: 36
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Assignment submission file structure verification / ant build.xml