Skip to content

Commit ce19409

Browse files
committed
Added static main() to TweetNaclTest.java and TweetNaclFastTest.java to easily run the tests from the command line, and added explanation to the README.md about how to run those tests.
(maybe generating a proper jar and run standard tests by maven'izing the project is more elegant (?))
1 parent e134b14 commit ce19409

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ TweetNacl in Java
4444
* you can always use the library to generate key, or use a Crypto Random like java.security.SecureRandom
4545

4646

47+
### Testing
48+
49+
In top directory:
50+
51+
$ mkdir out
52+
$ javac -d out src/com/iwebpp/crypto/*.java src/com/iwebpp/crypto/tests/*.java
53+
$ java -cp out com.iwebpp.crypto.tests.TweetNaclTest
54+
$ java -cp out com.iwebpp.crypto.tests.TweetNaclFastTest
55+
56+
4757
### License MIT
4858

4959
* Copyright(2014-2015) by tom zhou, [email protected]

src/com/iwebpp/crypto/tests/TweetNaclFastTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,10 @@ public void run() {
286286

287287
}
288288

289+
public static void main(String[] args) {
290+
TweetNaclFastTest t = new TweetNaclFastTest();
291+
t.start();
292+
}
293+
294+
289295
}

src/com/iwebpp/crypto/tests/TweetNaclTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,5 +288,9 @@ public void run() {
288288

289289
}
290290

291+
public static void main(String[] args) {
292+
TweetNaclTest t = new TweetNaclTest();
293+
t.start();
294+
}
291295

292296
}

0 commit comments

Comments
 (0)