JUnit is a unit testing framework for Java. It is integrated very well to maven and many IDE's (i.e. NetBeans). In OpenPTK v2.1, our first JUnit test was added, org.openptk.crypto.CryptoTest. The test was created based on JUnit 3.x. In OpenPTK v2.2, this test along with the maven dependencies will rely on JUnit 4.x. A good primer on setting up a JUnit test at: In order to add a JUnit test to OpenPTK, one simply needs to place the tests in the projects src/test/java directory. This directory is a sister directory to each projects src/java directory. As an example: Source Packages projects/OpenPTK/Base/src/java/org/openptk/crypto/... Test Packages projects/OpenPTK/Base/src/test/java/org/openptk/crypto/... $ mvn test ... ------------------------------------------------------- T E S T S ------------------------------------------------------- Running org.openptk.crypto.CryptoTest * CryptoTest: test AESCrypto * CryptoTest: test DESCrypto * CryptoTest: test KeyGenCrypto Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.219 sec Results : Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 ... $ |
Release 2.x > Development >