use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class VISA1PackagerTest method testHandleSpecialField351.
@SuppressWarnings("unchecked")
@Test
public void testHandleSpecialField351() throws Throwable {
int[] sequence = new int[0];
VISA1Packager vISA1Packager = new VISA1Packager(sequence, 100, "testVISA1PackagerBadResultCode", "testVISA1PackagerOkPattern");
Vector v = new Vector(100, 1000);
int result = vISA1Packager.handleSpecialField35(new ISOMsg(100), v);
assertEquals("result", 0, result);
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class VISA1PackagerTest method testCreateISOMsg.
@Test
public void testCreateISOMsg() throws Throwable {
int[] sequence = new int[0];
ISOMsg result = new VISA1Packager(sequence, 100, "testVISA1PackagerBadResultCode", "testVISA1PackagerOkPattern").createISOMsg();
assertEquals("result.getDirection()", 0, result.getDirection());
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class VISA1PackagerTest method testUnpack.
@Test
public void testUnpack() throws Throwable {
int[] sequence = new int[2];
ISOComponent m = new ISOMsg(100);
VISA1Packager vISA1Packager = new VISA1Packager(sequence, 100, "testVISA1PackagerBadResultCode", "");
byte[] b = new byte[1];
int result = vISA1Packager.unpack(m, b);
assertEquals("(ISOMsg) m.getMaxField()", 100, m.getMaxField());
assertEquals("result", 1, result);
assertSame("vISA1Packager.filter", vISA1Packager, vISA1Packager.filter);
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class XMLPackagerTest method testUnpackLargeXmlBytes.
@Test
public void testUnpackLargeXmlBytes() throws IOException, ISOException {
String veryLongXml = "<large-xml><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element><element><nested-element>Some very very long text</nested-element></element></large-xml>";
String input = "<isomsg> <!-- org.jpos.iso.packager.XMLPackager -->" + "<field id=\"0\" value=\"0800\"/>" + "<field id=\"1\"><![CDATA[" + veryLongXml + "]]></field>" + "</isomsg>";
isoMsg.setHeader("header".getBytes());
ISOMsg result = xMLPackager.createISOMsg();
int consumedBytes = xMLPackager.unpack(result, input.getBytes());
assertThat(result.getString(1), is(veryLongXml));
}
use of org.jpos.iso.ISOMsg in project jPOS by jpos.
the class XMLPackagerTest method testGetFieldDescription.
@Test
public void testGetFieldDescription() throws Throwable {
ISOComponent m = new ISOMsg(100);
String result = xMLPackager.getFieldDescription(m, 100);
assertEquals("result", "<notavailable/>", result);
}
Aggregations