jQuery in Action, 3rd edition
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes junit and requirements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "junit and requirements" Watch "junit and requirements" New topic

junit and requirements

Lara McCarver
Ranch Hand

Joined: Dec 09, 2003
Posts: 118
My exam has the following line:

The final program must have no dependencies on any libraries other than those of the Java 2 Platform.

Does this mean that I can't turn in a project which includes junit modules for testing? Of course it is possible to put all my junit tests in separate packages and then not include those packages in the code that I give to Sun. Though normally people recommend that you keep the tests with the classes. So your data package includes:


By the way, Reza ( Hi ) I have figured out how to use junit for some of the multi-threaded testing I am going to do. You have your junit test method create a monitoring thread which can receive notification of important events, then you create and start the threads you need for your test. Each thread does its thing while notifying the monitor of its events. The monitor thread waits for the other threads to complete all of their expected events, then evaluates whether everything happened correctly, and finally notifies the test method that its done. The test method which created all these threads waits for notification of completion from the monitor thread.

So far, I only have 1 small test, mostly as proof of concept. I create 2 threads. Each thread does a lock() on record 2, goes to sleep for 1 second and then does an unlock() on record 2.
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
Does this mean that I can't turn in a project which includes junit modules for testing?

That would be risky. The assessor may want to compile your code, and he/she may not have junit.jar. Even if you include it with your submission, I think it would be unreasonable to expect him/her to put it in the classpath. Keep the tests for yourself, give 'em what they want.
I agree. Here's the link: http://aspose.com/file-tools
subject: junit and requirements
It's not a secret anymore!