summaryrefslogtreecommitdiff
path: root/src/YalpClients/EflClient/corba_test.py
diff options
context:
space:
mode:
authorManuel Traut <manut@vogone.traut>2009-12-30 20:27:42 +0100
committerManuel Traut <manut@vogone.traut>2009-12-30 20:27:42 +0100
commit81ccb90fb30cb07b2c6941ce52c20a5029037a2c (patch)
treede5d5d151887fc06cf4e37fed6b365fe32cd1538 /src/YalpClients/EflClient/corba_test.py
parent30df095df63b3b101076f7ac64949b9f4d0481b3 (diff)
parent0933267609a286b96daeea91c8eee2a4f231f261 (diff)
Merge branch 'damba' of ssh://mecka.net/home/git/yalp into damba
Diffstat (limited to 'src/YalpClients/EflClient/corba_test.py')
-rw-r--r--src/YalpClients/EflClient/corba_test.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/YalpClients/EflClient/corba_test.py b/src/YalpClients/EflClient/corba_test.py
new file mode 100644
index 0000000..095062c
--- /dev/null
+++ b/src/YalpClients/EflClient/corba_test.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+
+import sys
+from omniORB import CORBA, PortableServer
+import Example
+import CosNaming, YalpInterfaces YalpInterfaces__POA
+
+orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
+poa = orb.resolve_initial_references("RootPOA")
+
+obj = orb.resolve_initial_references("NameService")
+root_context = obj._narrow(CosNaming.NamingContext)
+
+if root_context is None:
+ print "Failed to narrow the root naming context"
+ sys.exit(1)
+
+name = "YALP_Server"
+
+try:
+ yalp = root_context.resolve(name)
+ print "new aptd:apt object bound"
+
+except CosNaming.NamingContext.NotFound, ex:
+ print "Name not found"
+ sys.exit(1)
+
+if yalp is None:
+ print "Object reference is not an Example::Echo"
+ sys.exit(1)
+
+message = "Hello from Python"
+
+result = yalp.ping(err)
+
+poaManager = poa._get_the_POAManager()
+poaManager.activate()
+
+orb.run()
+