Remove redundant ApiTestConfig options

This change removes three options: runArbNodeAsDesktop,
runAliceNodeAsDesktop, and runBobNodeAsDesktop, which should have
been deleted when the supportingApps option was added.  The comma
delimited list of apps passed with the supportingApps option
now determines whether arbitration / bob / alice nodes are started as
desktops or daemons.
This commit is contained in:
ghubstan 2020-08-25 12:35:57 -03:00
parent cb6166c65f
commit b9c1feba9a
No known key found for this signature in database
GPG key ID: E35592D6800A861E
2 changed files with 15 additions and 41 deletions

View file

@ -311,17 +311,25 @@ public class Scaffold {
bitcoinDaemon.verifyBitcoindRunning(); bitcoinDaemon.verifyBitcoindRunning();
} }
// Start Bisq apps defined by the supportingApps option, in the in proper order.
if (config.hasSupportingApp(seednode.name())) if (config.hasSupportingApp(seednode.name()))
startBisqApp(seednode, executor, countdownLatch); startBisqApp(seednode, executor, countdownLatch);
if (config.hasSupportingApp(arbdaemon.name(), arbdesktop.name())) if (config.hasSupportingApp(arbdaemon.name()))
startBisqApp(config.runArbNodeAsDesktop ? arbdesktop : arbdaemon, executor, countdownLatch); startBisqApp(arbdaemon, executor, countdownLatch);
else if (config.hasSupportingApp(arbdesktop.name()))
startBisqApp(arbdesktop, executor, countdownLatch);
if (config.hasSupportingApp(alicedaemon.name(), alicedesktop.name())) if (config.hasSupportingApp(alicedaemon.name()))
startBisqApp(config.runAliceNodeAsDesktop ? alicedesktop : alicedaemon, executor, countdownLatch); startBisqApp(alicedaemon, executor, countdownLatch);
else if (config.hasSupportingApp(alicedesktop.name()))
startBisqApp(alicedesktop, executor, countdownLatch);
if (config.hasSupportingApp(bobdaemon.name(), bobdesktop.name())) if (config.hasSupportingApp(bobdaemon.name()))
startBisqApp(config.runBobNodeAsDesktop ? bobdesktop : bobdaemon, executor, countdownLatch); startBisqApp(bobdaemon, executor, countdownLatch);
else if (config.hasSupportingApp(bobdesktop.name()))
startBisqApp(bobdesktop, executor, countdownLatch);
} }
private void startBisqApp(BisqAppConfig bisqAppConfig, private void startBisqApp(BisqAppConfig bisqAppConfig,
@ -329,28 +337,24 @@ public class Scaffold {
CountDownLatch countdownLatch) CountDownLatch countdownLatch)
throws IOException, InterruptedException { throws IOException, InterruptedException {
BisqApp bisqApp; BisqApp bisqApp = createBisqApp(bisqAppConfig);
switch (bisqAppConfig) { switch (bisqAppConfig) {
case seednode: case seednode:
bisqApp = createBisqApp(seednode);
seedNodeTask = new SetupTask(bisqApp, countdownLatch); seedNodeTask = new SetupTask(bisqApp, countdownLatch);
seedNodeTaskFuture = executor.submit(seedNodeTask); seedNodeTaskFuture = executor.submit(seedNodeTask);
break; break;
case arbdaemon: case arbdaemon:
case arbdesktop: case arbdesktop:
bisqApp = createBisqApp(config.runArbNodeAsDesktop ? arbdesktop : arbdaemon);
arbNodeTask = new SetupTask(bisqApp, countdownLatch); arbNodeTask = new SetupTask(bisqApp, countdownLatch);
arbNodeTaskFuture = executor.submit(arbNodeTask); arbNodeTaskFuture = executor.submit(arbNodeTask);
break; break;
case alicedaemon: case alicedaemon:
case alicedesktop: case alicedesktop:
bisqApp = createBisqApp(config.runAliceNodeAsDesktop ? alicedesktop : alicedaemon);
aliceNodeTask = new SetupTask(bisqApp, countdownLatch); aliceNodeTask = new SetupTask(bisqApp, countdownLatch);
aliceNodeTaskFuture = executor.submit(aliceNodeTask); aliceNodeTaskFuture = executor.submit(aliceNodeTask);
break; break;
case bobdaemon: case bobdaemon:
case bobdesktop: case bobdesktop:
bisqApp = createBisqApp(config.runBobNodeAsDesktop ? bobdesktop : bobdaemon);
bobNodeTask = new SetupTask(bisqApp, countdownLatch); bobNodeTask = new SetupTask(bisqApp, countdownLatch);
bobNodeTaskFuture = executor.submit(bobNodeTask); bobNodeTaskFuture = executor.submit(bobNodeTask);
break; break;

View file

@ -65,9 +65,6 @@ public class ApiTestConfig {
static final String ROOT_APP_DATA_DIR = "rootAppDataDir"; static final String ROOT_APP_DATA_DIR = "rootAppDataDir";
static final String API_PASSWORD = "apiPassword"; static final String API_PASSWORD = "apiPassword";
static final String RUN_SUBPROJECT_JARS = "runSubprojectJars"; static final String RUN_SUBPROJECT_JARS = "runSubprojectJars";
static final String RUN_ARB_NODE_AS_DESKTOP = "runArbNodeAsDesktop";
static final String RUN_ALICE_NODE_AS_DESKTOP = "runAliceNodeAsDesktop";
static final String RUN_BOB_NODE_AS_DESKTOP = "runBobNodeAsDesktop";
static final String BISQ_APP_INIT_TIME = "bisqAppInitTime"; static final String BISQ_APP_INIT_TIME = "bisqAppInitTime";
static final String SKIP_TESTS = "skipTests"; static final String SKIP_TESTS = "skipTests";
static final String SHUTDOWN_AFTER_TESTS = "shutdownAfterTests"; static final String SHUTDOWN_AFTER_TESTS = "shutdownAfterTests";
@ -98,9 +95,6 @@ public class ApiTestConfig {
// Daemon instances can use same gRPC password, but each needs a different apiPort. // Daemon instances can use same gRPC password, but each needs a different apiPort.
public final String apiPassword; public final String apiPassword;
public final boolean runSubprojectJars; public final boolean runSubprojectJars;
public final boolean runArbNodeAsDesktop;
public final boolean runAliceNodeAsDesktop;
public final boolean runBobNodeAsDesktop;
public final long bisqAppInitTime; public final long bisqAppInitTime;
public final boolean skipTests; public final boolean skipTests;
public final boolean shutdownAfterTests; public final boolean shutdownAfterTests;
@ -202,27 +196,6 @@ public class ApiTestConfig {
.ofType(Boolean.class) .ofType(Boolean.class)
.defaultsTo(false); .defaultsTo(false);
ArgumentAcceptingOptionSpec<Boolean> runArbNodeAsDesktopOpt =
parser.accepts(RUN_ARB_NODE_AS_DESKTOP,
"Run Arbitration node as desktop")
.withRequiredArg()
.ofType(Boolean.class)
.defaultsTo(false); // TODO how do I register mediator?
ArgumentAcceptingOptionSpec<Boolean> runAliceNodeAsDesktopOpt =
parser.accepts(RUN_ALICE_NODE_AS_DESKTOP,
"Run Alice node as desktop")
.withRequiredArg()
.ofType(Boolean.class)
.defaultsTo(false);
ArgumentAcceptingOptionSpec<Boolean> runBobNodeAsDesktopOpt =
parser.accepts(RUN_BOB_NODE_AS_DESKTOP,
"Run Bob node as desktop")
.withRequiredArg()
.ofType(Boolean.class)
.defaultsTo(false);
ArgumentAcceptingOptionSpec<Long> bisqAppInitTimeOpt = ArgumentAcceptingOptionSpec<Long> bisqAppInitTimeOpt =
parser.accepts(BISQ_APP_INIT_TIME, parser.accepts(BISQ_APP_INIT_TIME,
"Amount of time (ms) to wait on a Bisq instance's initialization") "Amount of time (ms) to wait on a Bisq instance's initialization")
@ -302,9 +275,6 @@ public class ApiTestConfig {
this.bitcoinRpcPassword = options.valueOf(bitcoinRpcPasswordOpt); this.bitcoinRpcPassword = options.valueOf(bitcoinRpcPasswordOpt);
this.apiPassword = options.valueOf(apiPasswordOpt); this.apiPassword = options.valueOf(apiPasswordOpt);
this.runSubprojectJars = options.valueOf(runSubprojectJarsOpt); this.runSubprojectJars = options.valueOf(runSubprojectJarsOpt);
this.runArbNodeAsDesktop = options.valueOf(runArbNodeAsDesktopOpt);
this.runAliceNodeAsDesktop = options.valueOf(runAliceNodeAsDesktopOpt);
this.runBobNodeAsDesktop = options.valueOf(runBobNodeAsDesktopOpt);
this.bisqAppInitTime = options.valueOf(bisqAppInitTimeOpt); this.bisqAppInitTime = options.valueOf(bisqAppInitTimeOpt);
this.skipTests = options.valueOf(skipTestsOpt); this.skipTests = options.valueOf(skipTestsOpt);
this.shutdownAfterTests = options.valueOf(shutdownAfterTestsOpt); this.shutdownAfterTests = options.valueOf(shutdownAfterTestsOpt);