diff --git a/buildSrc/src/main/kotlin/com.hedera.block.jpms-modules.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.jpms-modules.gradle.kts index b6374db6f..14ae2e6c5 100644 --- a/buildSrc/src/main/kotlin/com.hedera.block.jpms-modules.gradle.kts +++ b/buildSrc/src/main/kotlin/com.hedera.block.jpms-modules.gradle.kts @@ -191,7 +191,6 @@ extraJavaModuleInfo { "com.github.docker-java:docker-java-transport-zerodep", "com.github.dockerjava.transport.zerodep" ) - module("org.slf4j:slf4j-api", "org.slf4j") { patchRealModule() } module("io.github.cdimascio:java-dotenv", "io.github.cdimascio") module("com.google.protobuf:protobuf-java-util", "com.google.protobuf.util") module("com.squareup:javapoet", "com.squareup.javapoet") { diff --git a/simulator/src/main/java/com/hedera/block/simulator/BlockStreamSimulator.java b/simulator/src/main/java/com/hedera/block/simulator/BlockStreamSimulator.java index f9b21a4c2..4c5d2861e 100644 --- a/simulator/src/main/java/com/hedera/block/simulator/BlockStreamSimulator.java +++ b/simulator/src/main/java/com/hedera/block/simulator/BlockStreamSimulator.java @@ -18,7 +18,7 @@ import static java.lang.System.Logger.Level.INFO; -import com.hedera.pbj.runtime.ParseException; +import com.hedera.block.simulator.exception.BlockSimulatorParsingException; import com.swirlds.config.api.Configuration; import com.swirlds.config.api.ConfigurationBuilder; import com.swirlds.config.extensions.sources.ClasspathFileConfigSource; @@ -41,10 +41,10 @@ private BlockStreamSimulator() {} * @param args the arguments to be passed to the block stream simulator * @throws IOException if an I/O error occurs * @throws InterruptedException if the thread is interrupted - * @throws ParseException if a parse error occurs + * @throws BlockSimulatorParsingException if a parse error occurs */ public static void main(String[] args) - throws IOException, InterruptedException, ParseException { + throws IOException, InterruptedException, BlockSimulatorParsingException { LOGGER.log(INFO, "Starting Block Stream Simulator"); diff --git a/simulator/src/main/java/com/hedera/block/simulator/BlockStreamSimulatorApp.java b/simulator/src/main/java/com/hedera/block/simulator/BlockStreamSimulatorApp.java index 391380fc3..7e7859d37 100644 --- a/simulator/src/main/java/com/hedera/block/simulator/BlockStreamSimulatorApp.java +++ b/simulator/src/main/java/com/hedera/block/simulator/BlockStreamSimulatorApp.java @@ -17,13 +17,14 @@ package com.hedera.block.simulator; import com.hedera.block.simulator.config.data.BlockStreamConfig; +import com.hedera.block.simulator.exception.BlockSimulatorParsingException; import com.hedera.block.simulator.generator.BlockStreamManager; import com.hedera.block.simulator.grpc.PublishStreamGrpcClient; import com.hedera.hapi.block.stream.BlockItem; -import com.hedera.pbj.runtime.ParseException; import com.swirlds.config.api.Configuration; import edu.umd.cs.findbugs.annotations.NonNull; import java.io.IOException; +import java.util.concurrent.atomic.AtomicBoolean; import javax.inject.Inject; /** BlockStream Simulator App */ @@ -39,7 +40,7 @@ public class BlockStreamSimulatorApp { private final int delayBetweenBlockItems; - boolean isRunning = false; + private final AtomicBoolean isRunning = new AtomicBoolean(false); /** * Creates a new BlockStreamSimulatorApp instance. @@ -66,14 +67,14 @@ public BlockStreamSimulatorApp( * Starts the block stream simulator. * * @throws InterruptedException if the thread is interrupted - * @throws ParseException if a parse error occurs + * @throws BlockSimulatorParsingException if a parse error occurs * @throws IOException if an I/O error occurs */ - public void start() throws InterruptedException, ParseException, IOException { + public void start() throws InterruptedException, BlockSimulatorParsingException, IOException { int delayMSBetweenBlockItems = delayBetweenBlockItems / 1_000_000; int delayNSBetweenBlockItems = delayBetweenBlockItems % 1_000_000; - isRunning = true; + isRunning.set(true); LOGGER.log(System.Logger.Level.INFO, "Block Stream Simulator has started"); boolean streamBlockItem = true; @@ -113,12 +114,12 @@ public void start() throws InterruptedException, ParseException, IOException { * @return true if the block stream simulator is running, false otherwise */ public boolean isRunning() { - return isRunning; + return isRunning.get(); } /** Stops the block stream simulator. */ public void stop() { - isRunning = false; + isRunning.set(false); LOGGER.log(System.Logger.Level.INFO, "Block Stream Simulator has stopped"); } } diff --git a/simulator/src/main/java/com/hedera/block/simulator/exception/BlockSimulatorParsingException.java b/simulator/src/main/java/com/hedera/block/simulator/exception/BlockSimulatorParsingException.java new file mode 100644 index 000000000..7f755b27d --- /dev/null +++ b/simulator/src/main/java/com/hedera/block/simulator/exception/BlockSimulatorParsingException.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hedera.block.simulator.exception; + +/** Use this checked exception to represent a Block Simulator parsing exception. */ +public class BlockSimulatorParsingException extends Exception { + /** + * Constructs a new parsing exception with the specified detail message. + * + * @param message the detail message + */ + public BlockSimulatorParsingException(String message) { + super(message); + } +} diff --git a/simulator/src/main/java/com/hedera/block/simulator/generator/BlockAsFileLargeDataSets.java b/simulator/src/main/java/com/hedera/block/simulator/generator/BlockAsFileLargeDataSets.java index c0c02a6b2..0e7c493c8 100644 --- a/simulator/src/main/java/com/hedera/block/simulator/generator/BlockAsFileLargeDataSets.java +++ b/simulator/src/main/java/com/hedera/block/simulator/generator/BlockAsFileLargeDataSets.java @@ -21,6 +21,7 @@ import com.hedera.block.simulator.config.data.BlockStreamConfig; import com.hedera.block.simulator.config.types.GenerationMode; +import com.hedera.block.simulator.exception.BlockSimulatorParsingException; import com.hedera.hapi.block.stream.Block; import com.hedera.hapi.block.stream.BlockItem; import com.hedera.pbj.runtime.ParseException; @@ -59,7 +60,7 @@ public GenerationMode getGenerationMode() { } @Override - public BlockItem getNextBlockItem() throws IOException, ParseException { + public BlockItem getNextBlockItem() throws IOException, BlockSimulatorParsingException { if (currentBlock != null && currentBlock.items().size() > currentBlockItemIndex) { return currentBlock.items().get(currentBlockItemIndex++); } else { @@ -74,13 +75,17 @@ public BlockItem getNextBlockItem() throws IOException, ParseException { } @Override - public Block getNextBlock() throws IOException, ParseException { + public Block getNextBlock() throws IOException, BlockSimulatorParsingException { currentBlockIndex++; String nextBlockFileName = String.format(formatString, currentBlockIndex); File blockFile = new File(blockstreamPath, nextBlockFileName); - if (blockFile.exists()) { + if (!blockFile.exists()) { + return null; + } + + try { byte[] blockBytes = readFileBytes(blockFile.toPath()); LOGGER.log(INFO, "Loading block: " + blockFile.getName()); @@ -88,8 +93,8 @@ public Block getNextBlock() throws IOException, ParseException { Block block = Block.PROTOBUF.parse(Bytes.wrap(blockBytes)); LOGGER.log(INFO, "block loaded with items size= " + block.items().size()); return block; + } catch (ParseException e) { + throw new BlockSimulatorParsingException(e.getMessage()); } - - return null; // No more blocks found } } diff --git a/simulator/src/main/java/com/hedera/block/simulator/generator/BlockStreamManager.java b/simulator/src/main/java/com/hedera/block/simulator/generator/BlockStreamManager.java index b9d7cdba2..550f83421 100644 --- a/simulator/src/main/java/com/hedera/block/simulator/generator/BlockStreamManager.java +++ b/simulator/src/main/java/com/hedera/block/simulator/generator/BlockStreamManager.java @@ -17,9 +17,9 @@ package com.hedera.block.simulator.generator; import com.hedera.block.simulator.config.types.GenerationMode; +import com.hedera.block.simulator.exception.BlockSimulatorParsingException; import com.hedera.hapi.block.stream.Block; import com.hedera.hapi.block.stream.BlockItem; -import com.hedera.pbj.runtime.ParseException; import java.io.IOException; /** The block stream manager interface. */ @@ -36,17 +36,17 @@ public interface BlockStreamManager { * Get the next block item. * * @return the next block item - * @throws IOException if an I/O error occurs - * @throws ParseException if a parse error occurs + * @throws IOException if a I/O error occurs + * @throws BlockSimulatorParsingException if a parse error occurs */ - BlockItem getNextBlockItem() throws IOException, ParseException; + BlockItem getNextBlockItem() throws IOException, BlockSimulatorParsingException; /** * Get the next block. * * @return the next block - * @throws IOException if an I/O error occurs - * @throws ParseException if a parse error occurs + * @throws IOException if a I/O error occurs + * @throws BlockSimulatorParsingException if a parse error occurs */ - Block getNextBlock() throws IOException, ParseException; + Block getNextBlock() throws IOException, BlockSimulatorParsingException; } diff --git a/simulator/src/main/java/module-info.java b/simulator/src/main/java/module-info.java index 9750258d5..ddca45813 100644 --- a/simulator/src/main/java/module-info.java +++ b/simulator/src/main/java/module-info.java @@ -3,6 +3,8 @@ /** Runtime module of the simulator. */ module com.hedera.block.simulator { exports com.hedera.block.simulator.config.data; + exports com.hedera.block.simulator.exception; + exports com.hedera.block.simulator; requires static com.github.spotbugs.annotations; requires static com.google.auto.service; diff --git a/simulator/src/test/java/com/hedera/block/simulator/BlockStreamSimulatorTest.java b/simulator/src/test/java/com/hedera/block/simulator/BlockStreamSimulatorTest.java index 37de86ff8..24ba07053 100644 --- a/simulator/src/test/java/com/hedera/block/simulator/BlockStreamSimulatorTest.java +++ b/simulator/src/test/java/com/hedera/block/simulator/BlockStreamSimulatorTest.java @@ -19,10 +19,10 @@ import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.when; +import com.hedera.block.simulator.exception.BlockSimulatorParsingException; import com.hedera.block.simulator.generator.BlockStreamManager; import com.hedera.block.simulator.grpc.PublishStreamGrpcClient; import com.hedera.hapi.block.stream.BlockItem; -import com.hedera.pbj.runtime.ParseException; import com.swirlds.config.api.Configuration; import java.io.IOException; import java.nio.file.Paths; @@ -63,13 +63,15 @@ void tearDown() { } @Test - void start_logsStartedMessage() throws InterruptedException, ParseException, IOException { + void start_logsStartedMessage() + throws InterruptedException, BlockSimulatorParsingException, IOException { blockStreamSimulator.start(); assertTrue(blockStreamSimulator.isRunning()); } @Test - void start_exitByBlockNull() throws InterruptedException, ParseException, IOException { + void start_exitByBlockNull() + throws InterruptedException, BlockSimulatorParsingException, IOException { BlockStreamManager blockStreamManager = Mockito.mock(BlockStreamManager.class); when(blockStreamManager.getNextBlockItem()).thenReturn(BlockItem.newBuilder().build()); diff --git a/simulator/src/test/java/com/hedera/block/simulator/generator/BlockAsDirBlockStreamManagerTest.java b/simulator/src/test/java/com/hedera/block/simulator/generator/BlockAsDirBlockStreamManagerTest.java index 1c391fea7..6ea25a542 100644 --- a/simulator/src/test/java/com/hedera/block/simulator/generator/BlockAsDirBlockStreamManagerTest.java +++ b/simulator/src/test/java/com/hedera/block/simulator/generator/BlockAsDirBlockStreamManagerTest.java @@ -22,7 +22,7 @@ import com.hedera.block.simulator.config.data.BlockStreamConfig; import com.hedera.block.simulator.config.types.GenerationMode; -import com.hedera.pbj.runtime.ParseException; +import com.hedera.block.simulator.exception.BlockSimulatorParsingException; import java.io.IOException; import java.nio.file.Paths; import org.junit.jupiter.api.Test; @@ -45,7 +45,7 @@ void getGenerationMode() { } @Test - void getNextBlockItem() throws IOException, ParseException { + void getNextBlockItem() throws IOException, BlockSimulatorParsingException { BlockStreamManager blockStreamManager = getBlockAsDirBlockStreamManager(getAbsoluteFolder(rootFolder)); @@ -55,7 +55,7 @@ void getNextBlockItem() throws IOException, ParseException { } @Test - void getNextBlock() throws IOException, ParseException { + void getNextBlock() throws IOException, BlockSimulatorParsingException { BlockStreamManager blockStreamManager = getBlockAsDirBlockStreamManager(getAbsoluteFolder(rootFolder)); diff --git a/simulator/src/test/java/com/hedera/block/simulator/generator/BlockAsFileBlockStreamManagerTest.java b/simulator/src/test/java/com/hedera/block/simulator/generator/BlockAsFileBlockStreamManagerTest.java index 9c207f117..b833a57d9 100644 --- a/simulator/src/test/java/com/hedera/block/simulator/generator/BlockAsFileBlockStreamManagerTest.java +++ b/simulator/src/test/java/com/hedera/block/simulator/generator/BlockAsFileBlockStreamManagerTest.java @@ -20,7 +20,7 @@ import com.hedera.block.simulator.config.data.BlockStreamConfig; import com.hedera.block.simulator.config.types.GenerationMode; -import com.hedera.pbj.runtime.ParseException; +import com.hedera.block.simulator.exception.BlockSimulatorParsingException; import java.io.IOException; import java.nio.file.Paths; import org.junit.jupiter.api.Test; @@ -41,7 +41,7 @@ void getGenerationMode() { } @Test - void getNextBlock() throws IOException, ParseException { + void getNextBlock() throws IOException, BlockSimulatorParsingException { BlockStreamManager blockStreamManager = getBlockAsFileBlockStreamManager(getAbsoluteFolder(gzRootFolder)); for (int i = 0; i < 3000; i++) { @@ -50,7 +50,7 @@ void getNextBlock() throws IOException, ParseException { } @Test - void getNextBlockItem() throws IOException, ParseException { + void getNextBlockItem() throws IOException, BlockSimulatorParsingException { BlockStreamManager blockStreamManager = getBlockAsFileBlockStreamManager(getAbsoluteFolder(gzRootFolder)); for (int i = 0; i < 35000; i++) { @@ -59,7 +59,7 @@ void getNextBlockItem() throws IOException, ParseException { } @Test - void loadBlockBlk() throws IOException, ParseException { + void loadBlockBlk() throws IOException, BlockSimulatorParsingException { String blkRootFolder = "src/test/resources/block-0.0.3-blk/"; BlockStreamManager blockStreamManager = getBlockAsFileBlockStreamManager(getAbsoluteFolder(blkRootFolder)); diff --git a/simulator/src/test/java/com/hedera/block/simulator/generator/BlockAsFileLargeDataSetsTest.java b/simulator/src/test/java/com/hedera/block/simulator/generator/BlockAsFileLargeDataSetsTest.java index 87639a0e4..01b3006b8 100644 --- a/simulator/src/test/java/com/hedera/block/simulator/generator/BlockAsFileLargeDataSetsTest.java +++ b/simulator/src/test/java/com/hedera/block/simulator/generator/BlockAsFileLargeDataSetsTest.java @@ -20,14 +20,17 @@ import com.hedera.block.simulator.config.data.BlockStreamConfig; import com.hedera.block.simulator.config.types.GenerationMode; +import com.hedera.block.simulator.exception.BlockSimulatorParsingException; import com.hedera.hapi.block.stream.BlockItem; -import com.hedera.pbj.runtime.ParseException; import java.io.File; import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; class BlockAsFileLargeDataSetsTest { @@ -51,7 +54,7 @@ void getGenerationMode() { } @Test - void getNextBlock() throws IOException, ParseException { + void getNextBlock() throws IOException, BlockSimulatorParsingException { BlockStreamManager blockStreamManager = getBlockAsFileLargeDatasetsBlockStreamManager(getAbsoluteFolder(rootFolder)); for (int i = 0; i < filesInFolder; i++) { @@ -62,7 +65,7 @@ void getNextBlock() throws IOException, ParseException { } @Test - void getNextBlockItem() throws IOException, ParseException { + void getNextBlockItem() throws IOException, BlockSimulatorParsingException { BlockStreamManager blockStreamManager = getBlockAsFileLargeDatasetsBlockStreamManager(getAbsoluteFolder(rootFolder)); @@ -75,6 +78,41 @@ void getNextBlockItem() throws IOException, ParseException { } } + @Test + void gettingNextBlockItemThrowsParsingException(@TempDir Path tempDir) throws IOException { + String blockFolderName = "block-0.0.3-blk"; + Path blockDirPath = tempDir.resolve(blockFolderName); + Files.createDirectories(blockDirPath); + + int nextBlockIndex = 1; + int paddedLength = 36; + String fileExtension = ".blk"; + String formatString = "%0" + paddedLength + "d" + fileExtension; + + String currentBlockFileName = String.format(formatString, nextBlockIndex); + Path currentBlockFilePath = blockDirPath.resolve(currentBlockFileName); + + byte[] invalidData = "invalid block data".getBytes(); + Files.write(currentBlockFilePath, invalidData); + + BlockStreamConfig blockStreamConfig = + new BlockStreamConfig( + GenerationMode.DIR, + blockDirPath.toString(), + 1_500_000, + "BlockAsFileBlockStreamManager", + 10_000, + 36, + ".blk"); + BlockAsFileLargeDataSets blockStreamManager = + new BlockAsFileLargeDataSets(blockStreamConfig); + + assertThrows( + BlockSimulatorParsingException.class, + blockStreamManager::getNextBlock, + "Expected getNextBlock() to throw BlockSimulatorParsingException"); + } + private BlockAsFileLargeDataSets getBlockAsFileLargeDatasetsBlockStreamManager( String rootFolder) { BlockStreamConfig blockStreamConfig = diff --git a/suites/build.gradle.kts b/suites/build.gradle.kts index 4ed80e300..d5d5534ee 100644 --- a/suites/build.gradle.kts +++ b/suites/build.gradle.kts @@ -21,20 +21,23 @@ plugins { description = "Hedera Block Node E2E Suites" +dependencies { implementation(project(":simulator")) } + application { mainModule = "com.hedera.block.suites" mainClass = "com.hedera.block.suites.BaseSuite" } mainModuleInfo { - requires("org.junit.jupiter.api") - requires("org.junit.platform.suite.api") - requires("org.testcontainers") - requires("io.github.cdimascio") runtimeOnly("org.testcontainers.junit-jupiter") runtimeOnly("org.junit.jupiter.engine") + runtimeOnly("org.testcontainers") + runtimeOnly("com.swirlds.config.impl") } +// workaround until https://github.com/hashgraph/hedera-block-node/pull/216 is integrated +dependencies.constraints { implementation("org.slf4j:slf4j-api:2.0.6") } + val updateDockerEnv = tasks.register("updateDockerEnv") { description = @@ -58,6 +61,7 @@ tasks.register("createDockerImage") { tasks.register("runSuites") { description = "Runs E2E Test Suites" group = "suites" + modularity.inferModulePath = false dependsOn("createDockerImage") useJUnitPlatform() diff --git a/suites/src/main/java/com/hedera/block/suites/BaseSuite.java b/suites/src/main/java/com/hedera/block/suites/BaseSuite.java index 9e976be6e..5c226bc0f 100644 --- a/suites/src/main/java/com/hedera/block/suites/BaseSuite.java +++ b/suites/src/main/java/com/hedera/block/suites/BaseSuite.java @@ -16,7 +16,17 @@ package com.hedera.block.suites; +import com.hedera.block.simulator.BlockStreamSimulatorApp; +import com.hedera.block.simulator.BlockStreamSimulatorInjectionComponent; +import com.hedera.block.simulator.DaggerBlockStreamSimulatorInjectionComponent; +import com.swirlds.config.api.Configuration; +import com.swirlds.config.api.ConfigurationBuilder; +import com.swirlds.config.extensions.sources.ClasspathFileConfigSource; +import com.swirlds.config.extensions.sources.SystemEnvironmentConfigSource; +import com.swirlds.config.extensions.sources.SystemPropertiesConfigSource; import io.github.cdimascio.dotenv.Dotenv; +import java.io.IOException; +import java.nio.file.Path; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.testcontainers.containers.GenericContainer; @@ -44,6 +54,9 @@ public abstract class BaseSuite { /** Port that is used by the Block Node Application */ protected static int blockNodePort; + /** Block Simulator Application instance */ + protected static BlockStreamSimulatorApp blockStreamSimulatorApp; + /** * Default constructor for the BaseSuite class. * @@ -60,9 +73,16 @@ public BaseSuite() { *

This method initializes the Block Node server container using Testcontainers. */ @BeforeAll - public static void setup() { + public static void setup() throws IOException { blockNodeContainer = getConfiguration(); blockNodeContainer.start(); + + // TODO remove in the next PR which adds tests + BlockStreamSimulatorInjectionComponent DIComponent = + DaggerBlockStreamSimulatorInjectionComponent.factory() + .create(loadDefaultConfiguration()); + + BlockStreamSimulatorApp blockStreamSimulatorApp = DIComponent.getBlockStreamSimulatorApp(); } /** @@ -107,6 +127,23 @@ public static GenericContainer getConfiguration() { return blockNodeContainer; } + /** + * Builds the default block simulator configuration + * + * @return default block simulator configuration + * @throws IOException if an I/O error occurs + */ + protected static Configuration loadDefaultConfiguration() throws IOException { + ConfigurationBuilder configurationBuilder = + ConfigurationBuilder.create() + .withSource(SystemEnvironmentConfigSource.getInstance()) + .withSource(SystemPropertiesConfigSource.getInstance()) + .withSource(new ClasspathFileConfigSource(Path.of("app.properties"))) + .autoDiscoverExtensions(); + + return configurationBuilder.build(); + } + /** * Retrieves the Block Node server version from the .env file. * diff --git a/suites/src/main/java/com/hedera/block/suites/persistence/DataPersistenceTestSuites.java b/suites/src/main/java/com/hedera/block/suites/persistence/DataPersistenceTestSuites.java new file mode 100644 index 000000000..283d98549 --- /dev/null +++ b/suites/src/main/java/com/hedera/block/suites/persistence/DataPersistenceTestSuites.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hedera.block.suites.persistence; + +import com.hedera.block.suites.persistence.positive.PositiveDataPersistenceTests; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; + +/** + * Test suite for running data persistence tests, including both positive and negative test + * scenarios. + * + *

This suite aggregates the tests from {@link PositiveDataPersistenceTests}. The {@code @Suite} + * annotation allows running all selected classes in a single test run. + */ +@Suite +@SelectClasses({PositiveDataPersistenceTests.class}) +public class DataPersistenceTestSuites { + + /** + * Default constructor for the {@link DataPersistenceTestSuites} class. This constructor is + * empty as it does not need to perform any initialization. + */ + public DataPersistenceTestSuites() {} +} diff --git a/suites/src/main/java/com/hedera/block/suites/persistence/positive/PositiveDataPersistenceTests.java b/suites/src/main/java/com/hedera/block/suites/persistence/positive/PositiveDataPersistenceTests.java new file mode 100644 index 000000000..1e4ffba16 --- /dev/null +++ b/suites/src/main/java/com/hedera/block/suites/persistence/positive/PositiveDataPersistenceTests.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hedera.block.suites.persistence.positive; + +import com.hedera.block.suites.BaseSuite; +import org.junit.jupiter.api.DisplayName; + +@DisplayName("Positive Data Persistence Tests") +public class PositiveDataPersistenceTests extends BaseSuite { + /** Default constructor for the {@link PositiveDataPersistenceTests} class. */ + public PositiveDataPersistenceTests() {} +} diff --git a/suites/src/main/java/module-info.java b/suites/src/main/java/module-info.java new file mode 100644 index 000000000..513183446 --- /dev/null +++ b/suites/src/main/java/module-info.java @@ -0,0 +1,15 @@ +/** Runtime module of the suites. */ +module com.hedera.block.node.suites { + requires com.hedera.block.simulator; + requires com.swirlds.config.api; + requires com.swirlds.config.extensions; + + // Require testing libraries + requires io.github.cdimascio; + requires org.junit.jupiter.api; + requires org.junit.platform.suite.api; + requires org.testcontainers; + + exports com.hedera.block.suites to + org.junit.platform.commons; +} diff --git a/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000001.blk.gz b/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000001.blk.gz new file mode 100644 index 000000000..06b71e837 Binary files /dev/null and b/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000001.blk.gz differ diff --git a/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000002.blk.gz b/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000002.blk.gz new file mode 100644 index 000000000..2a999fd88 Binary files /dev/null and b/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000002.blk.gz differ diff --git a/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000003.blk.gz b/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000003.blk.gz new file mode 100644 index 000000000..547b96753 Binary files /dev/null and b/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000003.blk.gz differ diff --git a/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000004.blk.gz b/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000004.blk.gz new file mode 100644 index 000000000..365bd1a78 Binary files /dev/null and b/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000004.blk.gz differ diff --git a/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000005.blk.gz b/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000005.blk.gz new file mode 100644 index 000000000..9da769f0b Binary files /dev/null and b/suites/src/main/resources/block-0.0.3/000000000000000000000000000000000005.blk.gz differ