@Test public void testSend() { INotificationsThriftService.Client client = new INotificationsThriftService.Client(protocol); Info info = new Info(); info.setAction("thrift.test.action"); info.setAppId("222"); info.setBody("this is a thrift test body!"); info.setBodyHtml("<div>this is html body!</div>"); info.setDate(System.currentTimeMillis()); info.setData("this is thrift data."); info.setGuid("thrift.guid.1"); info.setLastModified(System.currentTimeMillis()); info.setObjectId("thrift.objectid.1"); info.setProcessed(false); info.setRead(false); info.setReceiverId("10214"); info.setSenderId("10214"); info.setTitle("this is a title!"); info.setTitleHtml("<div>this is a title!</div>"); info.setType("thrift.type"); info.setUri("http://thrfit.uri"); // info.setPush(true); try { StateResult res = client.sendInf(info); System.out.println(res.getStatus() + "->" + res.getMid()); } catch (TException e) { e.printStackTrace(); Assert.assertTrue(false); } }
@Test public void testList() { INotificationsThriftService.Client client = new INotificationsThriftService.Client(protocol); try { List<Info> result = client.listAllOfApp("10", "10208", "0", 0L, 10); Assert.assertNotNull(result); Assert.assertTrue(result.size() > 0); for (Info info : result) { System.out.println(info.getId()); } } catch (TException e) { e.printStackTrace(); Assert.assertTrue(false); } }