-
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: Adding topology model classes and junit annotation processing (#…
…383) Signed-off-by: Deepak Mishra <deepak@swirldslabs.com>
- Loading branch information
1 parent
b69dd99
commit 9c6930e
Showing
8 changed files
with
308 additions
and
1 deletion.
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
Binary file added
BIN
+32.3 KB
.../com/hedera/fullstack/junit/support/extensions/annotation-processing.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions
39
...unit-support/src/main/java/com/hedera/fullstack/junit/support/model/ApplicationNodes.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,39 @@ | ||
/* | ||
* 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.junit.support.model; | ||
|
||
public record ApplicationNodes(int values, ResourceShape shape) { | ||
|
||
public static class Builder { | ||
private int value; | ||
private ResourceShape shape; | ||
|
||
public Builder value(int value) { | ||
this.value = value; | ||
return this; | ||
} | ||
|
||
public Builder shape(ResourceShape shape) { | ||
this.shape = shape; | ||
return this; | ||
} | ||
|
||
public ApplicationNodes build() { | ||
return new ApplicationNodes(value, shape); | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...it-support/src/main/java/com/hedera/fullstack/junit/support/model/ConfigurationValue.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,39 @@ | ||
/* | ||
* 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.junit.support.model; | ||
|
||
public record ConfigurationValue(String name, String value) { | ||
|
||
public static class Builder { | ||
private String name; | ||
private String value; | ||
|
||
public Builder name(String name) { | ||
this.name = name; | ||
return this; | ||
} | ||
|
||
public Builder value(String value) { | ||
this.value = value; | ||
return this; | ||
} | ||
|
||
public ConfigurationValue build() { | ||
return new ConfigurationValue(name, value); | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...rc/main/java/com/hedera/fullstack/junit/support/model/NetworkDeploymentConfiguration.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,48 @@ | ||
/* | ||
* 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.junit.support.model; | ||
|
||
public record NetworkDeploymentConfiguration( | ||
ApplicationNodes applicationNodes, | ||
PlatformConfiguration platformConfiguration, | ||
PlatformApplication platformApplication) { | ||
|
||
public static class Builder { | ||
private ApplicationNodes applicationNodes; | ||
private PlatformConfiguration platformConfiguration; | ||
private PlatformApplication platformApplication; | ||
|
||
public Builder applicationNodes(ApplicationNodes applicationNodes) { | ||
this.applicationNodes = applicationNodes; | ||
return this; | ||
} | ||
|
||
public Builder platformConfiguration(PlatformConfiguration platformConfiguration) { | ||
this.platformConfiguration = platformConfiguration; | ||
return this; | ||
} | ||
|
||
public Builder platformApplication(PlatformApplication platformApplication) { | ||
this.platformApplication = platformApplication; | ||
return this; | ||
} | ||
|
||
public NetworkDeploymentConfiguration build() { | ||
return new NetworkDeploymentConfiguration(applicationNodes, platformConfiguration, platformApplication); | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...t-support/src/main/java/com/hedera/fullstack/junit/support/model/PlatformApplication.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,47 @@ | ||
/* | ||
* 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.junit.support.model; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public record PlatformApplication(String fileName, List<String> parameters) { | ||
|
||
public static class Builder { | ||
private String fileName; | ||
private List<String> parameters = new ArrayList<>(); | ||
|
||
public Builder fileName(String fileName) { | ||
this.fileName = fileName; | ||
return this; | ||
} | ||
|
||
public Builder parameters(List<String> parameters) { | ||
this.parameters = parameters; | ||
return this; | ||
} | ||
|
||
public Builder addParameter(String parameter) { | ||
this.parameters.add(parameter); | ||
return this; | ||
} | ||
|
||
public PlatformApplication build() { | ||
return new PlatformApplication(fileName, parameters); | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...support/src/main/java/com/hedera/fullstack/junit/support/model/PlatformConfiguration.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) 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.junit.support.model; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public record PlatformConfiguration(List<ConfigurationValue> configurationValues) { | ||
|
||
public static class Builder { | ||
private List<ConfigurationValue> configurationValues = new ArrayList<>(); | ||
|
||
public Builder configurationValues(List<ConfigurationValue> configurationValues) { | ||
this.configurationValues = configurationValues; | ||
return this; | ||
} | ||
|
||
public Builder addConfigurationValue(ConfigurationValue configurationValue) { | ||
this.configurationValues.add(configurationValue); | ||
return this; | ||
} | ||
|
||
public PlatformConfiguration build() { | ||
return new PlatformConfiguration(configurationValues); | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...k-junit-support/src/main/java/com/hedera/fullstack/junit/support/model/ResourceShape.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,33 @@ | ||
/* | ||
* 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.junit.support.model; | ||
|
||
public record ResourceShape(float cpuInMillis) { | ||
|
||
public static class Builder { | ||
private float cpuInMillis; | ||
|
||
public Builder cpuInMillis(float cpuInMillis) { | ||
this.cpuInMillis = cpuInMillis; | ||
return this; | ||
} | ||
|
||
public ResourceShape build() { | ||
return new ResourceShape(cpuInMillis); | ||
} | ||
} | ||
} |