@Test public void testRenamePayloadToProcessing() throws Exception{ NamedPayloads pp = repo.getPayload("partnership$msg_id_1.sfrm"); boolean flag = pp.setToProcessing(); Assert.assertTrue("Fail on renaming the payload to processing", flag); File fileProcessing = new File(repo.getRepository(), "##partnership$msg_id_1.sfrm"); File fileReady = new File(repo.getRepository(), "partnership$msg_id_1.sfrm"); Assert.assertFalse("The ready to payload still existing", fileReady.exists()); Assert.assertTrue("Renamed processing payload didn't exist", fileProcessing.exists()); }
public NamedPayloads getPayload(Object[] params, int state){ if (params.length < 2) throw new IllegalArgumentException( "Not enough parameters for getting payload."); String payloadName = null; if(params.length == 2){ payloadName = NamedPayloads.getStateForm(state) + params[0].toString() + NamedPayloads.decodeDelimiters + params[1].toString() + PACKAGE_EXT; }else if(params.length > 2){ payloadName = NamedPayloads.getStateForm(state) + params[0].toString() + NamedPayloads.decodeDelimiters + params[1].toString() + NamedPayloads.filenameStartBracket + params[2] + NamedPayloads.filenameEndBracket + PACKAGE_EXT; } File f = new File(this.getRepositoryPath(), payloadName); if (f.exists()) return this.createPayloadsProxy(f); return null; }
PackagedPayloadsRepository extends PayloadsRepository { public NamedPayloads getPayload(Object[] params, int state){ if (params.length < 2) throw new IllegalArgumentException( "Not enough parameters for getting payload."); String payloadName = null; if(params.length == 2){ payloadName = NamedPayloads.getStateForm(state) + params[0].toString() + NamedPayloads.decodeDelimiters + params[1].toString() + PACKAGE_EXT; }else if(params.length > 2){ payloadName = NamedPayloads.getStateForm(state) + params[0].toString() + NamedPayloads.decodeDelimiters + params[1].toString() + NamedPayloads.filenameStartBracket + params[2] + NamedPayloads.filenameEndBracket + PACKAGE_EXT; } File f = new File(this.getRepositoryPath(), payloadName); if (f.exists()) return this.createPayloadsProxy(f); return null; } }
PackagedPayloadsRepository extends PayloadsRepository { public NamedPayloads getPayload(Object[] params, int state){ if (params.length < 2) throw new IllegalArgumentException( "Not enough parameters for getting payload."); String payloadName = null; if(params.length == 2){ payloadName = NamedPayloads.getStateForm(state) + params[0].toString() + NamedPayloads.decodeDelimiters + params[1].toString() + PACKAGE_EXT; }else if(params.length > 2){ payloadName = NamedPayloads.getStateForm(state) + params[0].toString() + NamedPayloads.decodeDelimiters + params[1].toString() + NamedPayloads.filenameStartBracket + params[2] + NamedPayloads.filenameEndBracket + PACKAGE_EXT; } File f = new File(this.getRepositoryPath(), payloadName); if (f.exists()) return this.createPayloadsProxy(f); return null; }  }
PackagedPayloadsRepository extends PayloadsRepository { public NamedPayloads getPayload(Object[] params, int state){ if (params.length < 2) throw new IllegalArgumentException( "Not enough parameters for getting payload."); String payloadName = null; if(params.length == 2){ payloadName = NamedPayloads.getStateForm(state) + params[0].toString() + NamedPayloads.decodeDelimiters + params[1].toString() + PACKAGE_EXT; }else if(params.length > 2){ payloadName = NamedPayloads.getStateForm(state) + params[0].toString() + NamedPayloads.decodeDelimiters + params[1].toString() + NamedPayloads.filenameStartBracket + params[2] + NamedPayloads.filenameEndBracket + PACKAGE_EXT; } File f = new File(this.getRepositoryPath(), payloadName); if (f.exists()) return this.createPayloadsProxy(f); return null; }  Collection getReadyPayloads(); Collection getPayloads(); Collection getProcessingPayloads(); NamedPayloads createPayloads(Object[] params, int initialState); NamedPayloads getPayload(Object[] params, int state); String toString(); static void main(String args[]); }
PackagedPayloadsRepository extends PayloadsRepository { public NamedPayloads getPayload(Object[] params, int state){ if (params.length < 2) throw new IllegalArgumentException( "Not enough parameters for getting payload."); String payloadName = null; if(params.length == 2){ payloadName = NamedPayloads.getStateForm(state) + params[0].toString() + NamedPayloads.decodeDelimiters + params[1].toString() + PACKAGE_EXT; }else if(params.length > 2){ payloadName = NamedPayloads.getStateForm(state) + params[0].toString() + NamedPayloads.decodeDelimiters + params[1].toString() + NamedPayloads.filenameStartBracket + params[2] + NamedPayloads.filenameEndBracket + PACKAGE_EXT; } File f = new File(this.getRepositoryPath(), payloadName); if (f.exists()) return this.createPayloadsProxy(f); return null; }  Collection getReadyPayloads(); Collection getPayloads(); Collection getProcessingPayloads(); NamedPayloads createPayloads(Object[] params, int initialState); NamedPayloads getPayload(Object[] params, int state); String toString(); static void main(String args[]); static final String PACKAGE_EXT; }