summaryrefslogtreecommitdiffstats
path: root/sdnr/wireless-transport/code-Carbon-SR1/apps/devicemanager/impl/src/main/test/GeoConfigTest.java
blob: e1703aaa6a1e509c23541271fe74f279045fc45b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import org.opendaylight.mwtn.config.impl.GeoConfig;

public class GeoConfigTest {


	private static String getClusterGeoConfigContent()
	{
return "\n" +
		"lumina-geo-cluster {\n" +
		"    primary_roles = [\n" +
		"	\"member-1\",\"member-2\",\"member-3\"\n" +
		"    ]\n" +
		"    secondary_roles = [\n" +
		"	\"member-4\",\"member-5\",\"member-6\"\n" +
		"    ]\n" +
		"    ip_roles_table = [\n" +
		"\n" +
		"	{\n" +
		"role=\"member-1\"\n" +
		"ip=\"zltcmtn23arbc01.2f0377.mtn23a.tci.att.com\"\n" +
		"},\n" +
		"{\n" +
		"role=\"member-2\"\n" +
		"ip=\"zltcmtn23arbc02.2f0377.mtn23a.tci.att.com\"\n" +
		"},\n" +
		"{\n" +
		"role=\"member-3\"\n" +
		"ip=\"zltcmtn23arbc03.2f0377.mtn23a.tci.att.com\"\n" +
		"},\n" +
		"{\n" +
		"role=\"member-4\"\n" +
		"ip=\"zltcmtn23brbc01.f84e7a.mtn23b.tci.att.com\"\n" +
		"},\n" +
		"{\n" +
		"role=\"member-5\"\n" +
		"ip=\"zltcmtn23brbc02.f84e7a.mtn23b.tci.att.com\"\n" +
		"},\n" +
		"{\n" +
		"role=\"member-6\"\n" +
		"ip=\"zltcmtn23brbc03.f84e7a.mtn23b.tci.att.com\"\n" +
		"}\n" +
		"    \n" +
		"	]\n" +
		"}\n" +
		"\n" +
		"\n" +
		"\n" +
		"\n" +
		"";
	}
	public static void main(String[] args)
	{
		try {
			System.out.println("testing clusternode geo config1");
			System.out.println("===========================");
			GeoConfig config = GeoConfig.parse(getClusterGeoConfigContent());
			System.out.println("succeeded: ");
			System.out.println(config.toString());
			System.out.println("primary roles:");
			System.out.println(config.getPrimaryRoles().toString());
			System.out.println("secondary roles:");
			System.out.println(config.getSecondaryRoles().toString());

		} catch (Exception e) {
			System.out.println("failed: "+e.getMessage());
		}
	}
}