Esempio n. 1
0
 def testFriendsGet(self):
     """
     Test response from method <code>friends.get</code>
     """
     friendList = self.getFriendList().cast()
     Assert.assertTrue(friendList.__len__() > 10)
     for i in range(0,friendList.__len__()):
         fmt = NumberFormat.getFormat(u"0")
         friendId = friendList.get(i)
         System.out.println(fmt.format(friendId))
Esempio n. 2
0
 def convertNumberArray(self, jsArray):
     """
     Convert JsArrayNumber to List<Long>
     """
     result = ArrayList((Long),)
     try:
         for i in range(0,jsArray.__len__()):
             fmt = NumberFormat.getFormat(u"0")
             friendIdDbl = jsArray.get(i)
             l = Long.parseLong(fmt.format(friendIdDbl))
             result.add(l)
     except Exception,e:
         GWT.log(java.str(u"Failed to convert String array: ArrayLength: " + java.str(jsArray.__len__())) + u":" + JSONObject(jsArray).toString(), e)