* is answered and correct
*/
public void testServerUptime() {
XMPPConnection conn0 = getConnection(0);
LastActivity lastActivity = null;
try {
lastActivity = LastActivityManager.getLastActivity(conn0, getHost());
} catch (XMPPException e) {
if (e.getXMPPError().getCode() == 403) {
//The test can not be done since the host do not allow this kind of request
return;
}
e.printStackTrace();
fail("An error occurred requesting the Last Activity");
}
assertNotNull("No last activity packet", lastActivity);
assertTrue("The last activity idle time should be greater than 0 : " +
lastActivity.getIdleTime(), lastActivity.getIdleTime() > 0);
}