Skip to content

Commit

Permalink
chore:Removed Dupicate AcceptanceTestBase (#7815)
Browse files Browse the repository at this point in the history
* chore:Removed Dupicate AcceptanceTestBase

Signed-off-by: Preeti <[email protected]>

* formatting

Signed-off-by: Sally MacFarlane <[email protected]>

---------

Signed-off-by: Preeti <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
Co-authored-by: Sally MacFarlane <[email protected]>
  • Loading branch information
pr9t and macfarla authored Oct 28, 2024
1 parent ee69279 commit 8ed4a90
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 226 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.ProcessBuilder.Redirect;
import java.math.BigInteger;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.junit.After;
import org.apache.logging.log4j.ThreadContext;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -125,7 +127,15 @@ protected AcceptanceTestBase() {
exitedSuccessfully = new ExitedWithCode(0);
}

@After
@BeforeEach
public void setUp(final TestInfo testInfo) {
// log4j is configured to create a file per test
// build/acceptanceTestLogs/${ctx:class}.${ctx:test}.log
ThreadContext.put("class", this.getClass().getSimpleName());
ThreadContext.put("test", testInfo.getTestMethod().get().getName());
}

@AfterEach
public void tearDownAcceptanceTestBase() {
reportMemory();
cluster.close();
Expand All @@ -143,7 +153,9 @@ public void reportMemory() {
if (command != null) {
LOG.info("Memory usage at end of test:");
final ProcessBuilder processBuilder =
new ProcessBuilder(command).redirectErrorStream(true).redirectInput(Redirect.INHERIT);
new ProcessBuilder(command)
.redirectErrorStream(true)
.redirectInput(ProcessBuilder.Redirect.INHERIT);
try {
final Process memInfoProcess = processBuilder.start();
outputProcessorExecutor.execute(() -> printOutput(memInfoProcess));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
*/
package org.hyperledger.besu.tests.acceptance.bft;

import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBaseJunit5;
import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase;

import java.util.stream.Stream;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.params.provider.Arguments;

@Disabled("This is not a test class, it offers BFT parameterization only.")
public abstract class ParameterizedBftTestBase extends AcceptanceTestBaseJunit5 {
public abstract class ParameterizedBftTestBase extends AcceptanceTestBase {
protected String bftType;
protected BftAcceptanceTestParameterization nodeFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
*/
package org.hyperledger.besu.tests.acceptance.bft.qbft;

import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBaseJunit5;
import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase;
import org.hyperledger.besu.tests.acceptance.dsl.account.Account;
import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;

import org.junit.jupiter.api.Test;

public class QbftContractAcceptanceTest extends AcceptanceTestBaseJunit5 {
public class QbftContractAcceptanceTest extends AcceptanceTestBase {

@Test
public void shouldMineOnMultipleNodesEvenWhenClusterContainsNonValidator() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
*/
package org.hyperledger.besu.tests.acceptance.clique;

import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBaseJunit5;
import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase;
import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;

import java.io.IOException;

import org.junit.jupiter.api.Test;

public class CliqueDiscardRpcAcceptanceTest extends AcceptanceTestBaseJunit5 {
public class CliqueDiscardRpcAcceptanceTest extends AcceptanceTestBase {

@Test
public void shouldDiscardVotes() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

import static org.hyperledger.besu.tests.acceptance.dsl.transaction.clique.CliqueTransactions.LATEST;

import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBaseJunit5;
import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase;
import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

@Disabled("flaky test due to hardcoded block numbers")
public class CliqueGetSignersRpcAcceptanceTest extends AcceptanceTestBaseJunit5 {
public class CliqueGetSignersRpcAcceptanceTest extends AcceptanceTestBase {
private BesuNode minerNode1;
private BesuNode minerNode2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.data.Percentage.withPercentage;

import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBaseJunit5;
import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase;
import org.hyperledger.besu.tests.acceptance.dsl.account.Account;
import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;
import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationFactory.CliqueOptions;
Expand All @@ -32,7 +32,7 @@
import org.junit.jupiter.api.Test;
import org.web3j.protocol.core.DefaultBlockParameter;

public class CliqueMiningAcceptanceTest extends AcceptanceTestBaseJunit5 {
public class CliqueMiningAcceptanceTest extends AcceptanceTestBase {

@Test
public void shouldMineTransactionsOnSingleNode() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
*/
package org.hyperledger.besu.tests.acceptance.clique;

import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBaseJunit5;
import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase;
import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;

import java.io.IOException;

import org.junit.jupiter.api.Test;

public class CliqueProposalRpcAcceptanceTest extends AcceptanceTestBaseJunit5 {
public class CliqueProposalRpcAcceptanceTest extends AcceptanceTestBase {

@Test
public void shouldReturnProposals() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
package org.hyperledger.besu.tests.acceptance.clique;

import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBaseJunit5;
import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase;
import org.hyperledger.besu.tests.acceptance.dsl.condition.Condition;
import org.hyperledger.besu.tests.acceptance.dsl.condition.clique.ExpectNonceVote.CLIQUE_NONCE_VOTE;
import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;
Expand All @@ -23,7 +23,7 @@

import org.junit.jupiter.api.Test;

public class CliqueProposeRpcAcceptanceTest extends AcceptanceTestBaseJunit5 {
public class CliqueProposeRpcAcceptanceTest extends AcceptanceTestBase {

@Test
public void shouldAddValidators() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
*/
package org.hyperledger.besu.tests.acceptance.clique;

import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBaseJunit5;
import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase;
import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;

import java.io.IOException;

import org.junit.jupiter.api.Test;

public class CliqueZeroValidatorsAcceptanceTest extends AcceptanceTestBaseJunit5 {
public class CliqueZeroValidatorsAcceptanceTest extends AcceptanceTestBase {

@Test
public void zeroValidatorsFormValidCluster() throws IOException {
Expand Down
Loading

0 comments on commit 8ed4a90

Please sign in to comment.