private boolean checkPostUserInfo(Msg msg) { /* If post user info is present, make sure it matches our info. * Otherwise, assume any posted information present came from us anyway(return true). */ switch(msg.dataType()) { case DataTypes.REFRESH_MSG: RefreshMsg refreshMsg = (RefreshMsg)msg; return (!refreshMsg.hasPublisherId() || refreshMsg.publisherIdUserAddress() == _postUserInfo.userAddr && refreshMsg.publisherIdUserId() == _postUserInfo.userId); case DataTypes.UPDATE_MSG: UpdateMsg updateMsg = (UpdateMsg)msg; return (!updateMsg.hasPublisherId() || updateMsg.publisherIdUserAddress() == _postUserInfo.userAddr && updateMsg.publisherIdUserId() == _postUserInfo.userId); default: return true; } } }
TestUtilities.checkResult(!refreshMsg.hasPublisherId(), "RefreshMsg.hasPublisherId()"); TestUtilities.checkResult(emaRefreshMsg.hasPublisherId(), "RefreshMsg.hasPublisherId()"); TestUtilities.checkResult(!refreshMsg.hasPublisherId(), "RefreshMsg.hasPublisherId()");
TestUtilities.checkResult(emaRefreshMsg.hasPublisherId(), "RefreshMsg.hasPublisherId()");
TestUtilities.checkResult(refreshMsg.hasPublisherId(), "RefreshMsg.hasPublisherId()");