Skip to content

Commit

Permalink
fix compilation errors in examples
Browse files Browse the repository at this point in the history
Signed-off-by: Deepak Mishra <[email protected]>
  • Loading branch information
deepak-swirlds committed Nov 9, 2023
1 parent 3c72b56 commit 3f5677a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,4 @@ public NetworkDeployment networkDeploymentById(String id) {
throw new NotImplementedException();
}

@Override
public CompletableFuture<Boolean> deleteNetworkDeployment(String id) {
throw new NotImplementedException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.hedera.fullstack.infrastructure.core.model.networknode.component.Node;

import java.nio.file.Path;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

Expand All @@ -48,26 +49,19 @@ public static void main(String[] args)

WorkloadReplica<NetworkNode> networkNode0 = nd.workloadByIndex(NetworkNode.class, 0);
WorkloadReplica<NetworkNode> networkNode1 = nd.workloadByIndex(NetworkNode.class, 1);
Node node0 = networkNode0.componentByType(Node.class);
Node node1 = networkNode1.componentByType(Node.class);
Optional<Node> node0 = networkNode0.componentByType(Node.class);
Optional<Node> node1 = networkNode1.componentByType(Node.class);

node0.stop();
// get config.txt from node0
node0.ifPresent(node-> {
node.start();

node0.retrieveFile(Path.of("/path/to/config.txt"));
node1.retrieveFile(Path.of("/path/to/config.txt"));

ExecutionAware.CommandResult commandResult0 = node0.exec("ls -l");
// consume output streams
commandResult0.stdout();
commandResult0.stderr();

ExecutionAware.CommandResult commandResult1 = node1.exec("ls -l");
// consume output streams
commandResult1.stdout();
commandResult1.stderr();
ExecutionAware.CommandResult commandResult0 = node.exec("ls -l");
// consume output streams
commandResult0.stdout();
commandResult0.stderr();
});

WorkloadReplica<MirrorNode> mirrorNode = nd.workloadByIndex(MirrorNode.class, 0);
Importer importer = mirrorNode.componentByType(Importer.class);
Optional<Importer> importer = mirrorNode.componentByType(Importer.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static void main(String[] args)
// - Junit can fill in more stuff in the builder the config builder
// - ip and names of the pods created
// Should contain sanitized version of ips and pod names, should not container k8s specific stuff
PlatformConfiguration.Builder platformConfigBuilder = networkDeployment.getPlatformConfigurationBuilder();
PlatformConfiguration.Builder platformConfigBuilder = networkDeployment.platformConfigurationBuilder();
// The Junit tests can add things in the platform config builder
platformConfigBuilder.addNodeDetail(new NodeDetails("abc", "127.0.0.1"));
platformConfigBuilder.addNodeDetail(new NodeDetails("abc", "127.0.0.1"));
Expand All @@ -81,11 +81,13 @@ public static void main(String[] args)
// Step 4.a may need to copy files to node

// Step 5. Delete the network
try {
testTookKit.deleteNetworkDeployments(networkDeployment.getId());
} catch (Exception e) {
throw new RuntimeException(e);
}
/*
try {
testTookKit.deleteNetworkDeployments(networkDeployment.id());
} catch (Exception e) {
throw new RuntimeException(e);
}
*/
}

/*
Expand Down Expand Up @@ -113,9 +115,9 @@ public void configure(NetworkDeployment networkDeployment) {
String version = null;

String platformConfig =
resourceUtils.getPlatformConfiguration(networkDeployment.getNetworkDeploymentConfiguration());
resourceUtils.getPlatformConfiguration(networkDeployment.configuration());
String platformSettings =
resourceUtils.getPlatformSettings(networkDeployment.getNetworkDeploymentConfiguration());
resourceUtils.getPlatformSettings(networkDeployment.configuration());
String buildZipURL = resourceUtils.getBuildZipURL(SemanticVersion.ZERO);

// Configuring the platform
Expand All @@ -140,8 +142,10 @@ public void startNetworkDeployment(NetworkDeployment networkDeployment) {
}
}

/*
public void deleteNetworkDeployments(String id) throws NetworkDeploymentNotFoundException {

Check notice on line 146 in fullstack-core/fullstack-infrastructure-core/src/test/java/com/hedera/fullstack/example/IntegrationExample.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-core/fullstack-infrastructure-core/src/test/java/com/hedera/fullstack/example/IntegrationExample.java#L146

Line is longer than 80 characters (found 99).
infraManager.deleteNetworkDeployment(id);
}
*/
}
}

0 comments on commit 3f5677a

Please sign in to comment.