You can see the full JUnit Testing CBT Video here:
http://www.thebookonhibernate.com/j2ee/sunjavasamplecodetutorialsmockexams.js...
Download the Completed Solution: 04JavaBeanJUnit.ear.
http://www.thebookonhibernate.com/j2ee/vangogh/04javabeanjunit.ear
The junit.jar file must be on your classpath for you to bring this ear file in and have the JUnit tests compile - just so you know.
Scroll to the bottom of the page for pertinent code snippets.
Running JUnit Test on JavaBeans
This free, multimedia tutorial shows you how to use IBM's Rational Application Developer (IRAD) 6.0 to create and run a JUnit test on a simple JavaBean.
If you found something helpful here, please do your part and help support the site. Link to us, buy some books, support our sponsors, tell your developer friends about us, and remember: Happy Java!
package com.examscam.common.test;
import com.examscam.common.Timer;
import junit.framework.TestCase;
public class TimerTest extends TestCase {
Timer t;
protected void setUp() throws Exception {
super.setUp();
t = new Timer();
t.start();
}
protected void tearDown() throws Exception {
super.tearDown();
t = null;
}
public void testStart() {
assertTrue("Timer isn't staring properly.",
t.getStartTime() <= System.currentTimeMillis());
}
public void testGetElapsedTime() {
assertTrue("Time Travel is not allowed", t.getElapsedTime() >= 0);
}
public void testReset() {
long originalStartTime = t.getStartTime();
t.reset();
assertTrue("Problem with reset", originalStartTime <= t.getStartTime());
}
}
Please check out my SCJA Java Certification Mock Exam website: http://www.scja.com/associate/ And for Hibernate and JPA tutorials, check out: http://www.thebookonhibernate.com http://www.thebookonhibernate.com/j2ee/index.jsp?link=03httpsessionswf
Wow dude, your hibernate book was awesome !
am so glad i looked at your Junit video now..so much in so less time !
yaniv191983 1 year ago
Noisy typekey simulation sounds mars an otherwise good video...
gimmeshelter1969 1 year ago
Is this guy using an actual typewriter? It's soooo loud!
biffta 1 year ago
interesting
EnavSounds 1 year ago