@Override public ISOMsg request(ISOMsg m, long timeout) throws ISOException { ISOMsg r = (ISOMsg) m.clone(); r.setResponseMTI(); r.set(39, "00"); return r; }
@Test public void testSet5() throws Throwable { ISOMsg iSOMsg = new ISOMsg(); iSOMsg.setFieldNumber(0); ISOMsg iSOMsg2 = new ISOMsg(); iSOMsg2.set(100, "testISOMsgValue"); int[] fields = new int[2]; ISOMsg clone = (ISOMsg) iSOMsg2.clone(fields); clone.set((ISOComponent) iSOMsg.clone()); assertEquals("clone.fields.size()", 1, clone.fields.size()); assertTrue("clone.dirty", clone.dirty); }
@Test public void testSet() throws Throwable { ISOMsg iSOMsg = new ISOMsg(); iSOMsg.setPackager(new ISO87APackagerBBitmap()); iSOMsg.set(100, "testISOMsgValue"); assertEquals("iSOMsg.fields.size()", 1, iSOMsg.fields.size()); assertEquals("iSOMsg.maxField", 100, iSOMsg.maxField); assertTrue("iSOMsg.dirty", iSOMsg.dirty); }
/** * sets an appropiate retransmission MTI<br> * @exception ISOException on MTI not set or it is not a request */ public void setRetransmissionMTI() throws ISOException { if (!isRequest()) throw new ISOException ("not a request"); set (new ISOField (0, getMTI().substring(0,3) + "1")); } protected void writeHeader (ObjectOutput out) throws IOException {
@Override public void request(ISOMsg m, long timeout, ISOResponseListener rl, Object handBack) throws ISOException { ISOMsg r = (ISOMsg) m.clone(); r.setResponseMTI(); r.set(39, "00"); rl.responseReceived(r, handBack); }
private void fixup (ISOMsg m, int[] bfields) throws ISOException { for (int f : bfields) { if (m.hasField(f)) { ISOComponent c = m.getComponent(f); if (c instanceof ISOField) m.set(f, ((ISOField) c).getBytes()); } } } private XMLReader createXMLReader () throws SAXException {
private void checkProtected (ISOMsg m) throws ISOException { for (int f : protectFields) { if (m.hasField(f)) m.set(f, ISOUtil.protect(m.getString(f))); } } private void checkHidden (ISOMsg m) throws ISOException {
@Test public void testGetMaxField() throws Throwable { ISOMsg iSOMsg = new ISOMsg(); iSOMsg.set(100, "testISOMsgValue"); byte[] v = new byte[2]; iSOMsg.set(new ISOBinaryField(100, v)); iSOMsg.set(1000, (byte[]) null); int result = iSOMsg.getMaxField(); assertFalse("iSOMsg.maxFieldDirty", iSOMsg.maxFieldDirty); assertEquals("result", 100, result); assertEquals("iSOMsg.maxField", 100, iSOMsg.maxField); }
@Test public void testSet3() throws Throwable { ISOMsg iSOMsg = new ISOMsg(); iSOMsg.set(100, (String) null); assertEquals("iSOMsg.fields.size()", 0, iSOMsg.fields.size()); }
@Test public void testRecalcBitMap5() throws Throwable { ISOMsg iSOMsg = new ISOMsg(); iSOMsg.set(100, "testISOMsgValue"); iSOMsg.recalcBitMap(); byte[] value = new byte[2]; iSOMsg.set(Integer.valueOf(100), value); iSOMsg.recalcBitMap(); assertFalse("iSOMsg.dirty", iSOMsg.dirty); assertEquals("iSOMsg.fields.size()", 2, iSOMsg.fields.size()); }
@Test public void testSet7() throws Throwable { ISOMsg iSOMsg = new ISOMsg(); iSOMsg.set(100, (byte[]) null); assertEquals("iSOMsg.fields.size()", 0, iSOMsg.fields.size()); }
@Test public void testSet1() throws Throwable { ISOMsg iSOMsg = new ISOMsg(); iSOMsg.set(100, "testISOMsgValue"); assertEquals("iSOMsg.fields.size()", 1, iSOMsg.fields.size()); assertEquals("iSOMsg.maxField", 100, iSOMsg.maxField); assertTrue("iSOMsg.dirty", iSOMsg.dirty); }
@Test public void testRecalcBitMap2() throws Throwable { ISOMsg iSOMsg = new ISOMsg(100); iSOMsg.recalcBitMap(); iSOMsg.set(0, "testISOMsgValue"); iSOMsg.recalcBitMap(); assertFalse("iSOMsg.dirty", iSOMsg.dirty); assertEquals("iSOMsg.fields.size()", 2, iSOMsg.fields.size()); }
@Test public void testSet6() throws Throwable { ISOMsg iSOMsg = new ISOMsg("testISOMsgMti"); iSOMsg.set(new ISOMsg(100)); assertEquals("iSOMsg.fields.size()", 2, iSOMsg.fields.size()); assertEquals("iSOMsg.maxField", 100, iSOMsg.maxField); assertTrue("iSOMsg.dirty", iSOMsg.dirty); }
@Test public void testRecalcBitMap6() throws Throwable { byte[] value = new byte[3]; ISOMsg iSOMsg = new ISOMsg(); iSOMsg.set(1, value); iSOMsg.recalcBitMap(); assertEquals("iSOMsg.fields.size()", 2, iSOMsg.fields.size()); assertFalse("iSOMsg.dirty", iSOMsg.dirty); assertFalse("iSOMsg.maxFieldDirty", iSOMsg.maxFieldDirty); assertEquals("iSOMsg.maxField", 1, iSOMsg.maxField); }
@Test public void testRecalcBitMap3() throws Throwable { ISOMsg iSOMsg = new ISOMsg("testISOMsgMti"); iSOMsg.recalcBitMap(); ISOMsg m = new ISOMsg(); m.set(1, "testISOMsgValue"); iSOMsg.merge(m); iSOMsg.recalcBitMap(); assertFalse("iSOMsg.dirty", iSOMsg.dirty); assertEquals("iSOMsg.fields.size()", 3, iSOMsg.fields.size()); }
@Test public void testValidate2() throws Throwable { ISOMsg m = new ISOVMsg(new ISOMsg("testMSGTEST02Mti"), new ISOVError("testMSGTEST02Description")); m.set(1, "testMSGTEST02Value"); ISOMsg result = (ISOMsg) new MSGTEST02().validate(m); assertSame("result", m, result); }
@Test public void testFilter1() throws Throwable { ISOMsg m = new ISOMsg(100); m.merge(new ISOMsg("testMacroFilterMti")); m.set(1, ""); ISOMsg result = new MacroFilter().filter(new CSChannel(new ISOBaseValidatingPackager()), m, new LogEvent( "testMacroFilterTag", "")); assertEquals("result.getDirection()", 0, result.getDirection()); }