1
2
3
4
5
6
7 """ Application adapter table is a mechanism to match application and backend handlers.
8 """
9
13
14 - def add(self,application,backend,handler):
16
17 - def get(self,application,backend):
19
25
36
37 allHandlers = _ApplicationRuntimeHandlers()
38
39 if __name__ == '__main__':
40 a = _ApplicationRuntimeHandlers()
41 a.add('a','X',1)
42 a.add('a','Y',1)
43 a.add('b','X',1)
44 a.add('c','Z',1)
45
47 print alist,blist
48 alist.sort()
49 blist.sort()
50 assert(alist == blist)
51
52
53 compare(a.getAllBackends(),['X','Y','Z'])
54 compare(a.getAllApplications(), ['a','b','c'])
55
56 compare(a.getAllBackends('a'),['X','Y'])
57 compare(a.getAllBackends('b'),['X'])
58 compare(a.getAllBackends('c'),['Z'])
59
60 compare(a.getAllApplications('X'),['a','b'])
61 compare(a.getAllApplications('Y'),['a'])
62 compare(a.getAllApplications('Z'),['c'])
63