use of com.hazelcast.simulator.common.SimulatorProperties in project hazelcast-simulator by hazelcast.
the class WorkerTest method before.
@Before
public void before() {
setupFakeEnvironment();
Registry registry = new Registry();
AgentData agent = registry.addAgent(PUBLIC_ADDRESS, PUBLIC_ADDRESS);
SimulatorProperties properties = new SimulatorProperties().set("MANAGEMENT_CENTER_URL", "none");
VendorDriver driver = new HazelcastDriver().setAgents(registry.getAgents()).setAll(properties.asPublicMap()).set("CONFIG", fileAsText(localResourceDirectory() + "/hazelcast.xml"));
workerAddress = workerAddress(AGENT_INDEX, WORKER_INDEX);
parameters = driver.loadWorkerParameters("member", agent.getAddressIndex()).set("WORKER_ADDRESS", workerAddress).set("PUBLIC_ADDRESS", PUBLIC_ADDRESS);
for (Map.Entry<String, String> entry : parameters.entrySet()) {
String key = entry.getKey();
if (key.startsWith("file:")) {
FileUtils.writeText(entry.getValue(), new File(getUserDir(), key.substring(5, key.length())));
}
}
}
use of com.hazelcast.simulator.common.SimulatorProperties in project hazelcast-simulator by hazelcast.
the class WizardTest method before.
@Before
public void before() {
setupFakeEnvironment();
simulatorProperties = mock(SimulatorProperties.class);
when(simulatorProperties.getUser()).thenReturn(SSH_USERNAME);
when(simulatorProperties.getSshOptions()).thenReturn("");
bash = mock(Bash.class);
workDir = new File("wizardTestWorkDir").getAbsoluteFile();
testPropertiesFile = new File(workDir, "test.properties");
runScriptFile = new File(workDir, "run");
prepareScriptFile = new File(workDir, "prepare");
simulatorPropertiesFile = new File(workDir, SimulatorProperties.PROPERTIES_FILE_NAME);
agentsFile = new File(workDir, AgentsFile.NAME);
localSimulatorPropertiesFile = new File(SimulatorProperties.PROPERTIES_FILE_NAME).getAbsoluteFile();
profileFile = ensureExistingFile("wizardTest.txt");
wizard = new Wizard();
}
use of com.hazelcast.simulator.common.SimulatorProperties in project hazelcast-simulator by hazelcast.
the class WizardTest method testCompareSimulatorProperties.
@Test
public void testCompareSimulatorProperties() {
SimulatorProperties defaultProperties = new SimulatorProperties();
ensureExistingFile(localSimulatorPropertiesFile);
appendText("invalid=unknown" + NEW_LINE, localSimulatorPropertiesFile);
appendText(format("%s=changed%n", CLOUD_PROVIDER), localSimulatorPropertiesFile);
appendText(format("%s=%s%n", CLOUD_IDENTITY, defaultProperties.get(CLOUD_IDENTITY)), localSimulatorPropertiesFile);
wizard.compareSimulatorProperties();
}
use of com.hazelcast.simulator.common.SimulatorProperties in project hazelcast-simulator by hazelcast.
the class CoordinatorRunMonolithTest method setUp.
@Before
public void setUp() throws Exception {
setupFakeEnvironment();
File simulatorPropertiesFile = new File(getUserDir(), "simulator.properties");
appendText("CLOUD_PROVIDER=embedded\n", simulatorPropertiesFile);
SimulatorProperties simulatorProperties = loadSimulatorProperties();
CoordinatorParameters coordinatorParameters = new CoordinatorParameters().setSimulatorProperties(simulatorProperties).setSkipShutdownHook(true);
agent = new Agent(1, "127.0.0.1", simulatorProperties.getAgentPort(), 60, null);
agent.start();
registry = new Registry();
registry.addAgent(localIp(), localIp());
copy(new File(localResourceDirectory(), "hazelcast.xml"), new File(getUserDir(), "hazelcast.xml"));
hazelcastDriver = new HazelcastDriver().setAgents(registry.getAgents()).setAll(simulatorProperties.asPublicMap()).set("SESSION_ID", coordinatorParameters.getSessionId());
coordinator = new Coordinator(registry, coordinatorParameters);
coordinator.start();
run = new CoordinatorRunMonolith(coordinator, coordinatorParameters);
}
use of com.hazelcast.simulator.common.SimulatorProperties in project hazelcast-simulator by hazelcast.
the class ProvisionerUtilsTest method testEnsureIsCloudProviderSetup_withLocal.
@Test(expected = CommandLineExitException.class)
public void testEnsureIsCloudProviderSetup_withLocal() {
SimulatorProperties properties = mock(SimulatorProperties.class);
when(properties.getCloudProvider()).thenReturn(CloudProviderUtils.PROVIDER_LOCAL);
ensureIsCloudProviderSetup(properties, "terminate");
}
Aggregations