-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create mock junit annotations (#104)
Signed-off-by: Nathan Klick <[email protected]>
- Loading branch information
1 parent
cd0e331
commit 752b2df
Showing
64 changed files
with
1,863 additions
and
89 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
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
64 changes: 64 additions & 0 deletions
64
...c/fullStackTest/java/com/hedera/fullstack/examples/signing/InvalidStateSignatureTest.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,64 @@ | ||
/* | ||
* Copyright (C) 2023 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.fullstack.examples.signing; | ||
|
||
import com.hedera.fullstack.examples.monitors.InvalidStateSignatureMonitor; | ||
import com.hedera.fullstack.examples.monitors.LogErrorMonitor; | ||
import com.hedera.fullstack.examples.monitors.NodeLivenessMonitor; | ||
import com.hedera.fullstack.examples.readiness.NodeActiveReadinessCheck; | ||
import com.hedera.fullstack.examples.validators.NodeStatisticHealthValidator; | ||
import com.hedera.fullstack.junit.support.annotations.application.ApplicationNodes; | ||
import com.hedera.fullstack.junit.support.annotations.application.PlatformApplication; | ||
import com.hedera.fullstack.junit.support.annotations.application.PlatformConfiguration; | ||
import com.hedera.fullstack.junit.support.annotations.core.ConfigurationValue; | ||
import com.hedera.fullstack.junit.support.annotations.core.FullStackSuite; | ||
import com.hedera.fullstack.junit.support.annotations.core.FullStackTest; | ||
import com.hedera.fullstack.junit.support.annotations.core.TestExecutionMode; | ||
import com.hedera.fullstack.junit.support.annotations.flow.MaxTestExecutionTime; | ||
import com.hedera.fullstack.junit.support.annotations.flow.WaitForDuration; | ||
import com.hedera.fullstack.junit.support.annotations.resource.ResourceShape; | ||
import com.hedera.fullstack.junit.support.annotations.validation.Monitors; | ||
import com.hedera.fullstack.junit.support.annotations.validation.ReadinessChecks; | ||
import com.hedera.fullstack.junit.support.annotations.validation.Validators; | ||
import java.util.concurrent.TimeUnit; | ||
import org.junit.jupiter.api.DisplayName; | ||
|
||
@FullStackSuite | ||
@ApplicationNodes(value = 4, shape = @ResourceShape(cpuInMillis = 8_000, memorySize = 8L)) | ||
@PlatformApplication(fileName = "ISSTestingTool.jar") | ||
@ReadinessChecks({NodeActiveReadinessCheck.class}) | ||
@Monitors({NodeLivenessMonitor.class, LogErrorMonitor.class, InvalidStateSignatureMonitor.class}) | ||
@Validators({NodeStatisticHealthValidator.class}) | ||
@PlatformConfiguration({ | ||
@ConfigurationValue(name = "state.dumpStateOnAnyISS", value = "false"), | ||
@ConfigurationValue(name = "state.automatedSelfIssRecovery", value = "true"), | ||
@ConfigurationValue(name = "state.haltOnCatastrophicIss", value = "true"), | ||
@ConfigurationValue(name = "event.preconsensus.enableReplay", value = "false"), | ||
@ConfigurationValue(name = "event.preconsensus.enableStorage", value = "false") | ||
}) | ||
@DisplayName("Invalid State Signature Testing Tool") | ||
class InvalidStateSignatureTest { | ||
|
||
@FullStackTest(mode = TestExecutionMode.TIMED_EXECUTION) | ||
@WaitForDuration(value = 5, unit = TimeUnit.MINUTES) | ||
@MaxTestExecutionTime(value = 15, unit = TimeUnit.MINUTES) | ||
@PlatformConfiguration({ | ||
@ConfigurationValue(name = "issTestingTool.plannedISSs", value = "180:0-1-2-3"), | ||
}) | ||
@DisplayName("ISS-catastrophic-1k-5m") | ||
void catastrophic_1k_5m() {} | ||
} |
66 changes: 66 additions & 0 deletions
66
...ackTest/java/com/hedera/fullstack/examples/signing/PlatformSignatureVerificationTest.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,66 @@ | ||
/* | ||
* Copyright (C) 2023 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.fullstack.examples.signing; | ||
|
||
import com.hedera.fullstack.base.api.units.StorageUnits; | ||
import com.hedera.fullstack.junit.support.annotations.application.ApplicationNodes; | ||
import com.hedera.fullstack.junit.support.annotations.application.NamedApplicationNode; | ||
import com.hedera.fullstack.junit.support.annotations.application.NamedApplicationNodes; | ||
import com.hedera.fullstack.junit.support.annotations.core.FullStackSuite; | ||
import com.hedera.fullstack.junit.support.annotations.core.FullStackTest; | ||
import com.hedera.fullstack.junit.support.annotations.core.ParameterizedFullStackTest; | ||
import com.hedera.fullstack.junit.support.annotations.flow.MaxTestExecutionTime; | ||
import com.hedera.fullstack.junit.support.annotations.resource.ResourceShape; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.stream.Stream; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Named; | ||
import org.junit.jupiter.params.provider.Arguments; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
|
||
@FullStackSuite | ||
public class PlatformSignatureVerificationTest { | ||
|
||
@FullStackTest | ||
void testBasicCase() {} | ||
|
||
@FullStackTest | ||
@ApplicationNodes( | ||
value = 4, | ||
shape = @ResourceShape(cpuInMillis = 10_000, memorySize = 64, memoryUnits = StorageUnits.GIGABYTES)) | ||
@DisplayName("SSTT: Basic Signatures - Mixed Algorithms - 4 Nodes - 10k TPS") | ||
void testBasicSignaturesMixedAlgorithms() {} | ||
|
||
@FullStackTest | ||
@DisplayName("SSTT: Quick Basic Signatures - 2 Nodes - 500 TPS") | ||
@MaxTestExecutionTime(value = 5, unit = TimeUnit.MINUTES) | ||
@NamedApplicationNodes({ | ||
@NamedApplicationNode("node1"), | ||
@NamedApplicationNode(value = "node2", shape = @ResourceShape(cpuInMillis = 2500)) | ||
}) | ||
void testQuickBasicSignatures() {} | ||
|
||
static Stream<Arguments> testScalingBasicSignatures() { | ||
return Stream.of(Arguments.of(Named.of("5k TPS", 5000)), Arguments.of(Named.of("10k TPS", 10000))); | ||
} | ||
|
||
@ParameterizedFullStackTest | ||
@DisplayName("SSTT: Scaling Basic Signatures - 4 Nodes") | ||
@ApplicationNodes(6) | ||
@MethodSource | ||
void testScalingBasicSignatures(int tps) {} | ||
} |
59 changes: 59 additions & 0 deletions
59
...amples/src/fullStackTest/java/com/hedera/fullstack/examples/signing/StatsSigningTest.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,59 @@ | ||
/* | ||
* Copyright (C) 2023 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.fullstack.examples.signing; | ||
|
||
import com.hedera.fullstack.examples.monitors.InvalidStateSignatureMonitor; | ||
import com.hedera.fullstack.examples.monitors.LogErrorMonitor; | ||
import com.hedera.fullstack.examples.monitors.NodeLivenessMonitor; | ||
import com.hedera.fullstack.examples.readiness.NodeActiveReadinessCheck; | ||
import com.hedera.fullstack.examples.validators.NodeStatisticHealthValidator; | ||
import com.hedera.fullstack.junit.support.annotations.application.ApplicationNodes; | ||
import com.hedera.fullstack.junit.support.annotations.application.PlatformApplication; | ||
import com.hedera.fullstack.junit.support.annotations.core.FullStackSuite; | ||
import com.hedera.fullstack.junit.support.annotations.core.FullStackTest; | ||
import com.hedera.fullstack.junit.support.annotations.core.TestExecutionMode; | ||
import com.hedera.fullstack.junit.support.annotations.flow.MaxTestExecutionTime; | ||
import com.hedera.fullstack.junit.support.annotations.flow.WaitForDuration; | ||
import com.hedera.fullstack.junit.support.annotations.resource.ResourceShape; | ||
import com.hedera.fullstack.junit.support.annotations.validation.Monitors; | ||
import com.hedera.fullstack.junit.support.annotations.validation.ReadinessChecks; | ||
import com.hedera.fullstack.junit.support.annotations.validation.Validators; | ||
import org.junit.jupiter.api.DisplayName; | ||
|
||
@FullStackSuite | ||
@DisplayName("Stats Signing Testing Tool") | ||
class StatsSigningTest { | ||
|
||
/** | ||
* Replaces the existing {@code Crypto-Basic-10k-4N} test. | ||
* This test will run the StatsSigningTestingTool.jar at 10k TPS for 20 minutes. | ||
*/ | ||
@FullStackTest(mode = TestExecutionMode.TIMED_EXECUTION) | ||
@ApplicationNodes(value = 4, shape = @ResourceShape(cpuInMillis = 32_000)) | ||
@WaitForDuration(value = 20, unit = java.util.concurrent.TimeUnit.MINUTES) | ||
@MaxTestExecutionTime(value = 30, unit = java.util.concurrent.TimeUnit.MINUTES) | ||
@PlatformApplication( | ||
fileName = "StatsSigningTestingTool.jar", | ||
parameters = {"1", "3000", "0", "100", "-1", "10000", "5000"}) | ||
@ReadinessChecks({ | ||
NodeActiveReadinessCheck.class, | ||
}) | ||
@Monitors({NodeLivenessMonitor.class, LogErrorMonitor.class, InvalidStateSignatureMonitor.class}) | ||
@Validators({NodeStatisticHealthValidator.class}) | ||
@DisplayName("Basic 10k TPS - 20 minutes") | ||
void basic() {} | ||
} |
11 changes: 11 additions & 0 deletions
11
fullstack-examples/src/fullStackTest/java/module-info.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,11 @@ | ||
module com.hedera.fullstack.examples.fullstacktest { | ||
exports com.hedera.fullstack.examples.signing to | ||
org.junit.platform.commons; | ||
|
||
opens com.hedera.fullstack.examples.signing to | ||
org.junit.platform.commons; | ||
|
||
requires com.hedera.fullstack.examples; | ||
requires com.hedera.fullstack.junit.support; | ||
requires org.junit.jupiter.api; | ||
} |
27 changes: 27 additions & 0 deletions
27
...es/src/main/java/com/hedera/fullstack/examples/monitors/InvalidStateSignatureMonitor.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,27 @@ | ||
/* | ||
* Copyright (C) 2023 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.fullstack.examples.monitors; | ||
|
||
import com.hedera.fullstack.monitoring.api.CheckOutcome; | ||
import com.hedera.fullstack.monitoring.api.Monitor; | ||
|
||
public class InvalidStateSignatureMonitor implements Monitor { | ||
@Override | ||
public CheckOutcome check() { | ||
return CheckOutcome.SUCCESS; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
fullstack-examples/src/main/java/com/hedera/fullstack/examples/monitors/LogErrorMonitor.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,27 @@ | ||
/* | ||
* Copyright (C) 2023 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.fullstack.examples.monitors; | ||
|
||
import com.hedera.fullstack.monitoring.api.CheckOutcome; | ||
import com.hedera.fullstack.monitoring.api.Monitor; | ||
|
||
public class LogErrorMonitor implements Monitor { | ||
@Override | ||
public CheckOutcome check() { | ||
return CheckOutcome.SUCCESS; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...ck-examples/src/main/java/com/hedera/fullstack/examples/monitors/NodeLivenessMonitor.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,27 @@ | ||
/* | ||
* Copyright (C) 2023 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.fullstack.examples.monitors; | ||
|
||
import com.hedera.fullstack.monitoring.api.CheckOutcome; | ||
import com.hedera.fullstack.monitoring.api.Monitor; | ||
|
||
public class NodeLivenessMonitor implements Monitor { | ||
@Override | ||
public CheckOutcome check() { | ||
return CheckOutcome.SUCCESS; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...mples/src/main/java/com/hedera/fullstack/examples/readiness/NodeActiveReadinessCheck.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,27 @@ | ||
/* | ||
* Copyright (C) 2023 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.fullstack.examples.readiness; | ||
|
||
import com.hedera.fullstack.readiness.api.ReadinessCheck; | ||
|
||
public class NodeActiveReadinessCheck implements ReadinessCheck { | ||
|
||
@Override | ||
public boolean ready() { | ||
return true; | ||
} | ||
} |
Oops, something went wrong.