mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Add main function to run an individual network stress test
This commit is contained in:
parent
4b75235f33
commit
0fc8a1b5c0
@ -23,6 +23,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.JUnitCore;
|
||||
import org.junit.runner.Request;
|
||||
import org.junit.runner.Result;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -83,6 +86,16 @@ public class NetworkStressTest {
|
||||
/** Number of direct messages to be sent by each peer. */
|
||||
private int directCount = DIRECT_COUNT_DEFAULT;
|
||||
|
||||
// Inspired by <https://stackoverflow.com/a/9288513> by Marc Peters.
|
||||
public static void main(String[] args) {
|
||||
Request request = (args.length == 0)
|
||||
? Request.aClass(NetworkStressTest.class)
|
||||
: Request.method(NetworkStressTest.class, args[0]);
|
||||
|
||||
Result result = new JUnitCore().run(request);
|
||||
System.exit(result.wasSuccessful() ? 0 : 1);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
// Parse test parameter environment variables.
|
||||
|
Loading…
Reference in New Issue
Block a user