-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: georgi-l95 <[email protected]>
- Loading branch information
1 parent
ffead9a
commit 6ac8e9b
Showing
8 changed files
with
154 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
suites/src/main/java/com/hedera/block/suites/grpc/GrpcTestSuites.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* 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.grpc; | ||
|
||
import com.hedera.block.suites.grpc.negative.NegativeServerAvailabilityTests; | ||
import com.hedera.block.suites.grpc.positive.PositiveServerAvailabilityTests; | ||
import org.junit.platform.suite.api.SelectClasses; | ||
import org.junit.platform.suite.api.Suite; | ||
|
||
/** | ||
* Test suite for running gRPC server availability tests, including both positive and negative test | ||
* scenarios. | ||
* | ||
* <p>This suite aggregates the tests from {@link PositiveServerAvailabilityTests} and {@link | ||
* NegativeServerAvailabilityTests}. The {@code @Suite} annotation allows running all selected | ||
* classes in a single test run. | ||
*/ | ||
@Suite | ||
@SelectClasses({PositiveServerAvailabilityTests.class, NegativeServerAvailabilityTests.class}) | ||
public class GrpcTestSuites { | ||
|
||
/** | ||
* Default constructor for the {@link GrpcTestSuites} class. This constructor is empty as it | ||
* does not need to perform any initialization. | ||
*/ | ||
public GrpcTestSuites() {} | ||
} |
29 changes: 29 additions & 0 deletions
29
.../src/main/java/com/hedera/block/suites/grpc/negative/NegativeServerAvailabilityTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* 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.grpc.negative; | ||
|
||
import org.junit.jupiter.api.DisplayName; | ||
|
||
@DisplayName("Negative Server Availability Tests") | ||
public class NegativeServerAvailabilityTests { | ||
|
||
public NegativeServerAvailabilityTests() {} | ||
|
||
public void handleServerStartupWithMissingConfig() {} | ||
|
||
public void handleServerStartupWithTakenPort() {} | ||
} |
69 changes: 69 additions & 0 deletions
69
.../src/main/java/com/hedera/block/suites/grpc/positive/PositiveServerAvailabilityTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* 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.grpc.positive; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import com.hedera.block.suites.BaseSuite; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* Test class for verifying the positive scenarios for server availability, specifically related to | ||
* the gRPC server. This class contains tests to check that the gRPC server starts successfully and | ||
* listens on the correct port. | ||
* | ||
* <p>Inherits from {@link BaseSuite} to reuse the container setup and teardown logic for the Block | ||
* Node. | ||
*/ | ||
@DisplayName("Positive Server Availability Tests") | ||
public class PositiveServerAvailabilityTests extends BaseSuite { | ||
|
||
/** Default constructor for the {@link PositiveServerAvailabilityTests} class. */ | ||
public PositiveServerAvailabilityTests() {} | ||
|
||
/** | ||
* Test to verify that the gRPC server starts successfully. | ||
* | ||
* <p>The test checks if the Block Node container is running and marked as healthy. | ||
*/ | ||
@Test | ||
public void verifyGrpcServerStartsSuccessfully() { | ||
assertTrue(blockNodeContainer.isRunning(), "Block Node container should be running."); | ||
assertTrue(blockNodeContainer.isHealthy(), "Block Node container should be healthy."); | ||
} | ||
|
||
/** | ||
* Test to verify that the gRPC server is listening on the correct port. | ||
* | ||
* <p>The test asserts that the container is running, exposes exactly one port, and that the | ||
* exposed port matches the expected gRPC server port. | ||
*/ | ||
@Test | ||
public void verifyGrpcServerListeningOnCorrectPort() { | ||
assertTrue(blockNodeContainer.isRunning(), "Block Node container should be running."); | ||
assertEquals( | ||
1, | ||
blockNodeContainer.getExposedPorts().size(), | ||
"There should be exactly one exposed port."); | ||
assertEquals( | ||
blockNodePort, | ||
blockNodeContainer.getExposedPorts().getFirst(), | ||
"The exposed port should match the expected gRPC server port."); | ||
} | ||
} |
50 changes: 0 additions & 50 deletions
50
suites/src/main/java/com/hedera/block/suites/stream/StreamTestSuites.java
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
suites/src/main/java/com/hedera/block/suites/stream/negative/NegativeBlockStreamTests.java
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
suites/src/main/java/com/hedera/block/suites/stream/positive/PositiveBlockStreamTests.java
This file was deleted.
Oops, something went wrong.