From 7287e06e29acad03df02ec2e3da1d7a3a9b6cc18 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Wed, 27 Nov 2024 17:46:57 -0700 Subject: [PATCH] Misc Cleanup --- .../src/main/java/org/xrpl/xrpl4j/client/XrplClient.java | 2 +- .../test/java/org/xrpl/xrpl4j/tests/AccountDeleteIT.java | 2 +- .../src/test/java/org/xrpl/xrpl4j/tests/IsFinalIT.java | 2 +- .../test/java/org/xrpl/xrpl4j/tests/PriceOracleIT.java | 4 ++-- .../xrpl/xrpl4j/tests/environment/RippledContainer.java | 8 ++------ 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/xrpl4j-client/src/main/java/org/xrpl/xrpl4j/client/XrplClient.java b/xrpl4j-client/src/main/java/org/xrpl/xrpl4j/client/XrplClient.java index 4be95ab96..82fe47b38 100644 --- a/xrpl4j-client/src/main/java/org/xrpl/xrpl4j/client/XrplClient.java +++ b/xrpl4j-client/src/main/java/org/xrpl/xrpl4j/client/XrplClient.java @@ -307,7 +307,7 @@ protected boolean ledgerGapsExistBetween( return true; // Assume ledger gaps exist so this can be retried. } - // Clamp the lastLedgerSequence to be at least as large as submittedLedgerSequence + // Ensure the lastLedgerSequence is (at least) as large as submittedLedgerSequence if (FluentCompareTo.is(lastLedgerSequence).lessThan(submittedLedgerSequence)) { lastLedgerSequence = submittedLedgerSequence; } diff --git a/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/AccountDeleteIT.java b/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/AccountDeleteIT.java index cac57aff8..d2219a976 100644 --- a/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/AccountDeleteIT.java +++ b/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/AccountDeleteIT.java @@ -58,7 +58,7 @@ class AccountDeleteIT extends AbstractIT { /** - * If any "real" testnet is being used (i.e., the enviornment specified is not a local one) then this test should not + * If any "real" testnet is being used (i.e., the environment specified is not a local one) then this test should not * be run. * * @return {@code true} if test/dev/clio networks are the execution environment; {@code false} otherwise. diff --git a/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/IsFinalIT.java b/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/IsFinalIT.java index 32a4a6468..7de1934a5 100644 --- a/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/IsFinalIT.java +++ b/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/IsFinalIT.java @@ -54,7 +54,7 @@ public class IsFinalIT extends AbstractIT { /** - * If any "real" testnet is being used (i.e., the enviornment specified is not a local one) then this test should not + * If any "real" testnet is being used (i.e., the environment specified is not a local one) then this test should not * be run. * * @return {@code true} if test/dev/clio networks are the execution environment; {@code false} otherwise. diff --git a/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/PriceOracleIT.java b/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/PriceOracleIT.java index 02a7ea3f8..6933be7e6 100644 --- a/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/PriceOracleIT.java +++ b/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/PriceOracleIT.java @@ -42,11 +42,11 @@ import java.time.Instant; import java.util.Optional; -@EnabledIf(value = "shouldRun", disabledReason = "IsFinalIT only runs runs with local rippled nodes.") +@EnabledIf(value = "shouldRun", disabledReason = "PriceOracleIT only runs runs with local rippled nodes.") public class PriceOracleIT extends AbstractIT { /** - * If any "real" testnet is being used (i.e., the enviornment specified is not a local one) then this test should not + * If any "real" testnet is being used (i.e., the environment specified is not a local one) then this test should not * be run. * * @return {@code true} if test/dev/clio networks are the execution environment; {@code false} otherwise. diff --git a/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/environment/RippledContainer.java b/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/environment/RippledContainer.java index c888bc425..737779ace 100644 --- a/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/environment/RippledContainer.java +++ b/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/environment/RippledContainer.java @@ -225,17 +225,12 @@ public void startLedgerAcceptor(final Duration acceptIntervalMillis) { // rippled is run in standalone mode which means that ledgers won't automatically close. You have to manually // advance the ledger using the "ledger_accept" method on the admin API. To mimic the behavior of a networked // rippled, run a scheduled task to trigger the "ledger_accept" method. -// if (ledgerAcceptor.isTerminated()) { // <-- Some tests shutdown the acceptor, so don't check for that condition. ledgerAcceptor = Executors.newScheduledThreadPool(1); ledgerAcceptor.scheduleAtFixedRate(() -> LEDGER_ACCEPTOR.accept(this), acceptIntervalMillis.toMillis(), acceptIntervalMillis.toMillis(), TimeUnit.MILLISECONDS ); -// } - // else { - // Do nothing; ledgerAcceptor is running or not yet started. - // } waitForLedgerTimeToSync(); } @@ -243,10 +238,11 @@ public void startLedgerAcceptor(final Duration acceptIntervalMillis) { /** * Stops the automated Ledger Acceptor, for example to control an integration test more finely. */ + @SuppressWarnings({"all"}) public void stopLedgerAcceptor() { try { ledgerAcceptor.shutdown(); - boolean result = ledgerAcceptor.awaitTermination(5, TimeUnit.SECONDS); + ledgerAcceptor.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { throw new RuntimeException("Unable to stop ledger acceptor", e); }