private V3LcapMessage makeTestVoteMessage(Collection voteBlocks) throws IOException { mPollMgr.setStateDir("key", tempDir); V3LcapMessage msg = new V3LcapMessage( "ArchivalID_2", "key", "Plug42", m_testBytes, m_testBytes, V3LcapMessage.MSG_VOTE, 987654321, m_testID, tempDir, theDaemon); // Set msg vote blocks. for (Iterator ix = voteBlocks.iterator(); ix.hasNext(); ) { msg.addVoteBlock((VoteBlock) ix.next()); } msg.setHashAlgorithm(LcapMessage.getDefaultHashAlgorithm()); msg.setArchivalId(m_archivalID); msg.setPluginVersion("PlugVer42"); return msg; }
private V3LcapMessage makeRepairMessage(byte[] repairData) { V3LcapMessage msg = new V3LcapMessage( "ArchivalID_2", "key", "Plug42", m_testBytes, m_testBytes, V3LcapMessage.MSG_REPAIR_REP, 987654321, m_testID, tempDir, theDaemon); msg.setHashAlgorithm(LcapMessage.getDefaultHashAlgorithm()); msg.setTargetUrl(m_url); msg.setArchivalId(m_archivalID); msg.setPluginVersion("PlugVer42"); msg.setRepairDataLength(repairData.length); msg.setRepairProps(m_repairProps); msg.setInputStream(new ByteArrayInputStream(repairData)); return msg; }