@hashgraph/solo
Version:
An opinionated CLI tool to deploy and manage private Hedera Networks.
123 lines • 3.92 kB
JavaScript
// SPDX-License-Identifier: Apache-2.0
import { EndToEndTestSuite } from './end-to-end-test-suite.js';
import { NamespaceName } from '../../src/types/namespace/namespace-name.js';
export class EndToEndTestSuiteBuilder {
testName;
testSuiteName;
namespace;
deployment;
clusterCount;
consensusNodesCount;
loadBalancerEnabled;
pinger;
realm;
shard;
serviceMonitor;
podLog;
minimalSetup;
collectDiagnosticLogs = true; // Default to true
apiPermissionProperties;
applicationEnvironment;
applicationProperties;
bootstrapProperties;
logXml;
settingsTxt;
javaFlightRecorderConfiguration;
testSuiteCallback;
withTestName(testName) {
this.testName = testName;
return this;
}
withTestSuiteName(testSuiteName) {
this.testSuiteName = testSuiteName;
return this;
}
withNamespace(namespace) {
this.namespace = NamespaceName.of(namespace);
return this;
}
withDeployment(deployment) {
this.deployment = deployment;
return this;
}
withClusterCount(clusterCount) {
this.clusterCount = clusterCount;
return this;
}
withConsensusNodesCount(consensusNodesCount) {
this.consensusNodesCount = consensusNodesCount;
return this;
}
withLoadBalancerEnabled(loadBalancerEnabled) {
this.loadBalancerEnabled = loadBalancerEnabled;
return this;
}
withPinger(pinger) {
this.pinger = pinger;
return this;
}
withRealm(realm) {
this.realm = realm;
return this;
}
withShard(shard) {
this.shard = shard;
return this;
}
withServiceMonitor(serviceMonitor) {
this.serviceMonitor = serviceMonitor;
return this;
}
withPodLog(podLog) {
this.podLog = podLog;
return this;
}
withMinimalSetup(minimalSetup) {
this.minimalSetup = minimalSetup;
return this;
}
withTestSuiteCallback(testSuiteCallback) {
this.testSuiteCallback = testSuiteCallback;
return this;
}
withCollectDiagnosticLogs(collectDiagnosticLogs) {
this.collectDiagnosticLogs = collectDiagnosticLogs;
return this;
}
withApiPermissionProperties(fileName) {
this.apiPermissionProperties = fileName;
return this;
}
withApplicationEnvironment(fileName) {
this.applicationEnvironment = fileName;
return this;
}
withApplicationProperties(fileName) {
this.applicationProperties = fileName;
return this;
}
withBootstrapProperties(fileName) {
this.bootstrapProperties = fileName;
return this;
}
withLog4j2Xml(fileName) {
this.logXml = fileName;
return this;
}
withSettingsTxt(fileName) {
this.settingsTxt = fileName;
return this;
}
withJavaFlightRecorderConfiguration(jfc) {
this.javaFlightRecorderConfiguration = jfc;
return this;
}
build() {
if (!this.testName || !this.testSuiteName || !this.testSuiteCallback) {
throw new Error('Missing required properties to build EndToEndTestSuite');
}
return new EndToEndTestSuite(this.testName, this.testSuiteName, this.namespace, this.deployment, this.clusterCount || 1, // Default to 1 if not specified
this.consensusNodesCount || 1, this.loadBalancerEnabled || false, this.pinger || false, this.realm || 0, this.shard || 0, this.serviceMonitor || false, this.podLog || false, this.minimalSetup || false, this.collectDiagnosticLogs, this.apiPermissionProperties, this.applicationEnvironment, this.applicationProperties, this.bootstrapProperties, this.logXml, this.settingsTxt, this.javaFlightRecorderConfiguration, this.testSuiteCallback);
}
}
//# sourceMappingURL=end-to-end-test-suite-builder.js.map