First create a Java project. Than use the JPdfUnit Test Case wizard to create a new testcase class:

A new JUnit TestCase class and a new DocumentTester field will be created. If you select Inherit from DocumentTestCase a new DocumentTestCase class will be created and none DocumentTester field.
package de.oio.test;
import junit.framework.TestCase;
import de.oio.jpdfunit.DocumentTester;
public class OIOTestCase extends TestCase {
DocumentTester tester;
protected void setUp() throws Exception {
super.setUp();
tester = new DocumentTester("Document.pdf");
}
protected void tearDown() throws Exception {
super.tearDown();
tester.close();
}
}
If you select Inherit from DocumentTestCase a new DocumentTestCase class will be created and none DocumentTester field.
package de.oio.test;
import de.oio.jpdfunit.DocumentTestCase;
import de.oio.jpdfunit.document.util.DocumentDataSource;
import de.oio.jpdfunit.document.util.PdfDataSource;
public class OIOTest extends DocumentTestCase {
public OIOTest(String arg0) {
super(arg0);
}
protected DocumentDataSource getDataSource() {
DocumentDataSource datasource = new PdfDataSource("Document.pdf");
return datasource;
}
}
Now you are ready to run your first test.