annotate src/main/java/alice/test/topology/localTestTopology/LocalTestTopology.java @ 644:e0621f645e2e

add local topology test
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 31 Dec 2017 09:59:59 +0900
parents 74dbb8809c73
children cb16036404ba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
643
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 package alice.test.topology.localTestTopology;
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 import alice.daemon.AliceDaemon;
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 import alice.datasegment.DataSegment;
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 import alice.topology.manager.StartTopologyManager;
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 import alice.topology.manager.TopologyManagerConfig;
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 import java.util.LinkedList;
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 public class LocalTestTopology {
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 public static void main(String[] args) {
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 LinkedList<LocalTestTopologyConfig> configs = new LinkedList<LocalTestTopologyConfig>();
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 int port = 10000;
644
e0621f645e2e add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
15 int toplogyManagerPort = port++;
643
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 configs.add(new LocalTestTopologyConfig(args, port++, "remote1"));
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 configs.add(new LocalTestTopologyConfig(args, port++, "remote2"));
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 configs.add(new LocalTestTopologyConfig(args, port++, "remote3"));
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
644
e0621f645e2e add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
20 TopologyManagerConfig topologyManagerConfig = new TopologyManagerConfig(args);
e0621f645e2e add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
21 new AliceDaemon(topologyManagerConfig).listen();
e0621f645e2e add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
22 new StartTopologyManager(topologyManagerConfig).execute();
643
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 for (LocalTestTopologyConfig conf: configs ) {
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 new AliceDaemon(conf).listen();
644
e0621f645e2e add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
26 DataSegment.connect(conf.key, "rev" + conf.key, conf.hostname, toplogyManagerPort);
643
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 }
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 new LTopologyStartCodeSegment(configs).execute();
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 }
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 }