Mercurial > hg > Database > Christie
changeset 171:7e97f59a13fa
add PaxosTest
author | akahori |
---|---|
date | Tue, 22 Jan 2019 18:35:44 +0900 |
parents | f9f83bb213e8 |
children | 2068aa841a4d cdf604af6c12 |
files | src/test/java/christie/paxos/PaxosTest.java |
diffstat | 1 files changed, 31 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/java/christie/paxos/PaxosTest.java Tue Jan 22 18:35:44 2019 +0900 @@ -0,0 +1,31 @@ +package christie.paxos; + +import christie.test.topology.paxos.CheckMyName; +import christie.topology.manager.StartTopologyManager; +import christie.topology.manager.TopologyManagerConfig; +import christie.topology.node.StartTopologyNode; +import christie.topology.node.TopologyNodeConfig; + +public class PaxosTest { + + public static void main(String[] args) { + /* Local Test */ + int managerPort = 10000; + int nodeNum = 6; + String[] managerArg = {"--localPort", String.valueOf(managerPort), "--confFile", "scripts/Log/paxos.dot"}; + TopologyManagerConfig topologyManagerConfig = new TopologyManagerConfig(managerArg); + new StartTopologyManager(topologyManagerConfig); + + + for (int i = 1; i<=nodeNum; i++) { + + String[] nodeArg = {"--managerPort", String.valueOf(managerPort), + "--managerHost", "localhost", + "--localPort", String.valueOf(managerPort + i)}; + + TopologyNodeConfig topologyNodeConfig = new TopologyNodeConfig(nodeArg); + new StartTopologyNode(topologyNodeConfig, new CheckMyName()); + + } + } +}