Skip to content

Commit

Permalink
ros#610: updated package.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrrx committed May 31, 2016
1 parent 4136451 commit 5783def
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@
import time
import unittest
try:
from xmlrpc.client import Fault, ServerProxy
from xmlrpc.client import Fault
except ImportError:
from xmlrpclib import Fault, ServerProxy
from xmlrpclib import Fault

import rosunit
import rosgraph
import rosgraph.xmlrpc

TCPROS = 'TCPROS'

Expand Down Expand Up @@ -126,7 +127,7 @@ def setUp(self):
self.fail("master did not return XML-RPC API for [%s, %s]"%(self.caller_id, self.test_node))
print "[%s] API = %s"%(self.test_node, self.node_api)
self.assert_(self.node_api.startswith('http'))
self.node = ServerProxy(self.node_api)
self.node = rosgraph.xmlrpc.ServerProxy(self.node_api)

# hack: sleep for a couple seconds just in case the node is
# still registering with the master.
Expand Down
7 changes: 2 additions & 5 deletions test/test_rosmaster/test/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@
import sys
import string
import time
try:
from xmlrpc.client import ServerProxy
except ImportError:
from xmlrpclib import ServerProxy

import rospy
import rosgraph
import rosgraph.xmlrpc

from rosclient import *

Expand Down Expand Up @@ -75,7 +72,7 @@ def setUp(self):
super(_MasterTestCase, self).setUp()
self.master_uri = os.environ.get(rosgraph.ROS_MASTER_URI, None)
self._checkUri(self.master_uri)
self.master = ServerProxy(self.master_uri)
self.master = rosgraph.xmlrpc.ServerProxy(self.master_uri)

## validates a URI as being http(s)
def _checkUri(self, uri):
Expand Down
7 changes: 2 additions & 5 deletions test/test_rosmaster/test/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@
import sys
import string
import time
try:
from xmlrpc.client import ServerProxy
except ImportError:
from xmlrpclib import ServerProxy

import rospy
import rosgraph
import rosgraph.xmlrpc

from rosclient import *

Expand Down Expand Up @@ -114,7 +111,7 @@ def setUp(self):
self.fail("master did not return XML-RPC API for [%s, %s]"%(self.caller_id, self.test_node))
print("[%s] API = %s" %(self.test_node, self.node_api))
self.assert_(self.node_api.startswith('http'))
self.node = ServerProxy(self.node_api)
self.node = rosgraph.xmlrpc.ServerProxy(self.node_api)

## validates a URI as being http(s)
def _checkUri(self, uri):
Expand Down
7 changes: 2 additions & 5 deletions test/test_rosmaster/test/rosclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,17 @@
# Revision $Id: test_embed_msg.py 1986 2008-08-26 23:57:56Z sfkwc $

import unittest
try:
from xmlrpc.client import ServerProxy
except ImportError:
from xmlrpclib import ServerProxy

import rosgraph
import rosgraph.xmlrpc

class TestRosClient(unittest.TestCase):

def setUp(self):
self.last_code = None
self.last_msg = None
self.last_val = None
self.master = ServerProxy(rosgraph.get_master_uri())
self.master = rosgraph.xmlrpc.ServerProxy(rosgraph.get_master_uri())

def tearDown(self):
self.master = None
Expand Down
9 changes: 5 additions & 4 deletions test/test_rosmaster/test/testMaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@
import os, sys, getopt, traceback, logging, socket
import datetime, math, random
try:
from xmlrpc.client import DateTime, ServerProxy
from xmlrpc.client import DateTime
except ImportError:
from xmlrpclib import DateTime, ServerProxy
from xmlrpclib import DateTime
import unittest
import rospy
import rosgraph.xmlrpc
from rostest import *
from testSlave import msMain

Expand Down Expand Up @@ -75,7 +76,7 @@ def verifyNodeAddress(master, callerId, name, machine, addr, port):
raddrinfo = socket.getaddrinfo(raddr, 0, 0, 0, socket.SOL_TCP)
assert raddrinfo == addrinfo, "%s!=%s" % (raddrinfo, addrinfo)
#ping the node
apiSuccess(ServerProxy("http://%s:%s/"%(raddr, rport)).getPid(''))
apiSuccess(rosgraph.xmlrpc.ServerProxy("http://%s:%s/"%(raddr, rport)).getPid(''))

def testGraphState(master, graphNodes, graphFlows):
graph = apiSuccess(master.getGraph(''))
Expand Down Expand Up @@ -572,7 +573,7 @@ def validate(val, callerId, name, port):
def _verifyNodeDead(self, port):
testUri = "http://localhost:%s/"%port
try:
ServerProxy(testUri).getPid('node')
rosgraph.xmlrpc.ServerProxy(testUri).getPid('node')
self.fail("test node is still running")
except:
pass
Expand Down
13 changes: 5 additions & 8 deletions test/test_rosmaster/test/testSlave.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@
import os
import sys
import string
try:
from xmlrpc.client import ServerProxy
except ImportError:
from xmlrpclib import ServerProxy

import rospy
import rosgraph.xmlrpc
from rostest import *

singletest = None
Expand Down Expand Up @@ -73,7 +70,7 @@ def setUp(self):
self.caller_id = rospy.get_caller_id()
self.node_api = self.apiSuccess(self.master.lookupNode(self.caller_id, 'test_node'))
self.assert_(self.node_api.startswith('http'))
self.node = ServerProxy(self.node_api)
self.node = rosgraph.xmlrpc.ServerProxy(self.node_api)

def testGetPid(self):
pid = self.apiSuccess(self.node.getPid(self.caller_id))
Expand Down Expand Up @@ -107,7 +104,7 @@ def _subTestSourceRequestFlow(self, testName, protocols, testEval):
port = apiSuccess(master.addNode('', '', sourceName, pkg, node, TEST_MACHINE, 0))
apiSuccess(master.addNode('', '', sinkName, pkg, node, TEST_MACHINE, 0))
sourceUri = 'http://%s:%s/'%(testNodeAddr[0], port)
sources[sourceName] = ServerProxy(sourceUri)
sources[sourceName] = rosgraph.xmlrpc.ServerProxy(sourceUri)

for test in tests:
sourceName, sinkName = [val%testName for val in test[0]]
Expand Down Expand Up @@ -186,7 +183,7 @@ def testSourceKillFlow(self):
port = apiSuccess(master.addNode('', '', sourceName, pkg, node, TEST_MACHINE, 0))
apiSuccess(master.addNode('', '', sinkName, pkg, node, TEST_MACHINE, 0))
sourceUri = 'http://%s:%s/'%(testNodeAddr[0], port)
sources[sourceName] = ServerProxy(sourceUri)
sources[sourceName] = rosgraph.xmlrpc.ServerProxy(sourceUri)
# - start the flow
callerId, sourceLocator, sinkLocator = test[1]
apiSuccess(master.connectFlow(callerId, sourceLocator, sinkLocator, 1))
Expand Down Expand Up @@ -257,7 +254,7 @@ def _sink_StartNodes(self, tests):
sourceUri = 'http://%s:%s/'%(testNodeAddr[0], sourcePort)
sinkUri = 'http://%s:%s/'%(testNodeAddr[0], sinkPort)
sourceUris[sourceName] = sourceUri
sinks[sinkName] = ServerProxy(sinkUri)
sinks[sinkName] = rosgraph.xmlrpc.ServerProxy(sinkUri)
return sourceUris, sinks

def _sink_StartFlows(self, tests, sourceUris, sinks):
Expand Down
9 changes: 3 additions & 6 deletions test/test_rospy/test/rostest/test_deregister.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

import rospy
import rostest
import rosgraph.xmlrpc
from std_msgs.msg import String
from test_rospy.srv import EmptySrv

Expand All @@ -61,15 +62,11 @@ def callback(data):
print("message received", data.data)
_last_callback = data

try:
from xmlrpc.client import ServerProxy
except ImportError:
from xmlrpclib import ServerProxy

class TestDeregister(unittest.TestCase):

def test_unpublish(self):
node_proxy = ServerProxy(rospy.get_node_uri())
node_proxy = rosgraph.xmlrpc.ServerProxy(rospy.get_node_uri())

_, _, pubs = node_proxy.getPublications('/foo')
pubs = [p for p in pubs if p[0] != '/rosout']
Expand Down Expand Up @@ -112,7 +109,7 @@ def test_unsubscribe(self):
global _last_callback

uri = rospy.get_node_uri()
node_proxy = ServerProxy(uri)
node_proxy = rosgraph.xmlrpc.ServerProxy(uri)
_, _, subscriptions = node_proxy.getSubscriptions('/foo')
self.assert_(not subscriptions, 'subscriptions present: %s'%str(subscriptions))

Expand Down
7 changes: 2 additions & 5 deletions test/test_rospy/test/rostest/test_sub_to_multiple_pubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,9 @@
import sys
import time
import unittest
try:
from xmlrpc.client import ServerProxy
except ImportError:
from xmlrpclib import ServerProxy

import rosgraph
import rosgraph.xmlrpc
import rospy
import rostest

Expand Down Expand Up @@ -84,7 +81,7 @@ def test_subscribe_to_multiple_publishers(self):
self.assert_(False, 'cannot contact [%s]: unknown node' % LISTENER_NODE)

socket.setdefaulttimeout(5.0)
node = ServerProxy(node_api)
node = rosgraph.xmlrpc.ServerProxy(node_api)
code, _, businfo = node.getBusInfo(NAME)
if code != 1:
self.assert_(False, 'cannot get node information')
Expand Down
5 changes: 1 addition & 4 deletions test/test_rospy/test/unit/test_rospy_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,7 @@ def test_xmlrpcapi(self):
self.assert_(rospy.core.xmlrpcapi('http://') is None)
api = rospy.core.xmlrpcapi('http://localhost:1234')
self.assert_(api is not None)
try:
from xmlrpc.client import ServerProxy
except ImportError:
from xmlrpclib import ServerProxy
from rosgraph.xmlrpc import ServerProxy
self.assert_(isinstance(api, ServerProxy))

called = None
Expand Down
1 change: 1 addition & 0 deletions tools/roslaunch/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<run_depend version_gte="1.0.37">python-rospkg</run_depend>
<run_depend>python-yaml</run_depend>
<run_depend>rosclean</run_depend>
<run_depend>rosgraph</run_depend>
<run_depend>rosgraph_msgs</run_depend>
<run_depend>roslib</run_depend>
<run_depend version_gte="1.11.16">rosmaster</run_depend>
Expand Down
2 changes: 1 addition & 1 deletion tools/roslaunch/src/roslaunch/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def _check_and_set_run_id(self, param_server, run_id):
@param default_run_id: run_id to use if value is not set
@type default_run_id: str
@param param_server: parameter server proxy
@type param_server: xmlrpclib.ServerProxy
@type param_server: rosgraph.xmlrpc.ServerProxy
"""
code, _, val = param_server.hasParam(_ID, '/run_id')
if code == 1 and not val:
Expand Down
5 changes: 1 addition & 4 deletions tools/roslaunch/test/unit/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,7 @@ def test_Master(self):
self.assertEquals(m, m)
self.assertEquals(m, Master(Master.ROSMASTER, 'http://foo:1234'))

try:
from xmlrpc.client import ServerProxy
except ImportError:
from xmlrpclib import ServerProxy
from rosgraph.xmlrpc import ServerProxy
self.assert_(isinstance(m.get(), ServerProxy))
m.uri = 'http://foo:567'
self.assertEquals(567, m.get_port())
Expand Down
8 changes: 4 additions & 4 deletions tools/roslaunch/test/unit/test_roslaunch_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
import sys
import rospkg
try:
from xmlrpc.client import MultiCall, ServerProxy
from xmlrpc.client import MultiCall
except ImportError:
from xmlrpclib import MultiCall, ServerProxy

from xmlrpclib import MultiCall

import rosgraph.xmlrpc
import roslaunch.core

def test_Executable():
Expand Down Expand Up @@ -246,7 +246,7 @@ def test_Master():
m.get_host() == 'localhost'
m.get_port() == 11311
assert m.is_running() in [True, False]
assert isinstance(m.get(), ServerProxy)
assert isinstance(m.get(), rosgraph.xmlrpc.ServerProxy)
assert isinstance(m.get_multi(), MultiCall)

m = Master(uri='http://badhostname:11312')
Expand Down
11 changes: 4 additions & 7 deletions tools/roslaunch/test/unit/test_roslaunch_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@

import roslaunch.pmon
import roslaunch.server
import rosgraph.xmlrpc
from roslaunch.server import ProcessListener

try:
from xmlrpc.client import ServerProxy
except ImportError:
from xmlrpclib import ServerProxy

import rosgraph
master = rosgraph.Master('test_roslaunch_server')
Expand Down Expand Up @@ -350,7 +347,7 @@ def test_ROSLaunchNode(self):
self.assert_(node.uri)

# - call the ping API that we added
s = ServerProxy(node.uri)
s = rosgraph.xmlrpc.ServerProxy(node.uri)
test_val = 'test-%s'%time.time()
s.ping(test_val)
self.assertEquals(handler.pinged, test_val)
Expand Down Expand Up @@ -407,7 +404,7 @@ def test_ROSLaunchParentNode(self):
try:
server.start()
self.assert_(server.uri, "server URI did not initialize")
s = ServerProxy(server.uri)
s = rosgraph.xmlrpc.ServerProxy(server.uri)
child_uri = 'http://fake-unroutable:1324'
# - list children should be empty
val = self._succeed(s.list_children())
Expand Down Expand Up @@ -458,7 +455,7 @@ def test_ROSLaunchChildNode(self):
try:
server.start()
self.assert_(server.uri, "server URI did not initialize")
s = ServerProxy(server.uri)
s = rosgraph.xmlrpc.ServerProxy(server.uri)

print("SERVER STARTED")

Expand Down

0 comments on commit 5783def

Please sign in to comment.