Search in sources :

Example 6 with Base1SubFieldPackager

use of org.jpos.iso.packager.Base1SubFieldPackager in project jPOS by jpos.

the class VAPChannelTest method testSetConfiguration1.

@Test
public void testSetConfiguration1() throws Throwable {
    VAPChannel vAPChannel = new VAPChannel(new Base1SubFieldPackager());
    vAPChannel.setConfiguration(new SimpleConfiguration());
    assertEquals("vAPChannel.srcid", "000000", vAPChannel.srcid);
    assertEquals("vAPChannel.dstid", "000000", vAPChannel.dstid);
    assertEquals("vAPChannel.getMaxPacketLength()", 100000, vAPChannel.getMaxPacketLength());
    assertEquals("vAPChannel.getPort()", 0, vAPChannel.getPort());
    assertNull("vAPChannel.getSocket()", vAPChannel.getSocket());
    assertEquals("vAPChannel.getTimeout()", 300000, vAPChannel.getTimeout());
    assertFalse("vAPChannel.isOverrideHeader()", vAPChannel.isOverrideHeader());
    assertNull("vAPChannel.getHost()", vAPChannel.getHost());
}
Also used : Base1SubFieldPackager(org.jpos.iso.packager.Base1SubFieldPackager) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.Test)

Example 7 with Base1SubFieldPackager

use of org.jpos.iso.packager.Base1SubFieldPackager in project jPOS by jpos.

the class DelayFilterTest method testFilter.

@Test
public void testFilter() throws Throwable {
    DelayFilter delayFilter = new DelayFilter(0);
    LogEvent evt = new LogEvent("testDelayFilterTag", "testString");
    ISOChannel channel = new CSChannel(new Base1SubFieldPackager(), new ServerSocket());
    ISOMsg result = delayFilter.filter(channel, m, evt);
    assertEquals("evt.payLoad.size()", 2, evt.getPayLoad().size());
    assertEquals("evt.payLoad.get(1)", "<delay-filter delay=\"0\"/>", evt.getPayLoad().get(1));
    assertSame("result", m, result);
}
Also used : Base1SubFieldPackager(org.jpos.iso.packager.Base1SubFieldPackager) ISOMsg(org.jpos.iso.ISOMsg) LogEvent(org.jpos.util.LogEvent) ServerSocket(java.net.ServerSocket) ISOChannel(org.jpos.iso.ISOChannel) CSChannel(org.jpos.iso.channel.CSChannel) Test(org.junit.Test)

Example 8 with Base1SubFieldPackager

use of org.jpos.iso.packager.Base1SubFieldPackager in project jPOS by jpos.

the class StatefulFilterTest method testFilter7.

@Test
public void testFilter7() throws Throwable {
    int[] key = new int[0];
    StatefulFilter statefulFilter = new StatefulFilter();
    statefulFilter.setKey(key);
    statefulFilter.setMatchDirection(0);
    statefulFilter.setSavedFields(null);
    ISOMsg m = new ISOMsg("testStatefulFilterMti");
    ISOMsg result = statefulFilter.filter(new PADChannel(new XMLPackager()), m, new LogEvent(new Base1SubFieldPackager(), "testStatefulFilterTag"));
    assertSame("result", m, result);
}
Also used : XMLPackager(org.jpos.iso.packager.XMLPackager) Base1SubFieldPackager(org.jpos.iso.packager.Base1SubFieldPackager) ISOMsg(org.jpos.iso.ISOMsg) LogEvent(org.jpos.util.LogEvent) PADChannel(org.jpos.iso.channel.PADChannel) Test(org.junit.Test)

Aggregations

Base1SubFieldPackager (org.jpos.iso.packager.Base1SubFieldPackager)8 Test (org.junit.Test)8 ISOMsg (org.jpos.iso.ISOMsg)4 LogEvent (org.jpos.util.LogEvent)3 ServerSocket (java.net.ServerSocket)2 PADChannel (org.jpos.iso.channel.PADChannel)2 SimpleConfiguration (org.jpos.core.SimpleConfiguration)1 ISOChannel (org.jpos.iso.ISOChannel)1 ISOPackager (org.jpos.iso.ISOPackager)1 BASE24TCPChannel (org.jpos.iso.channel.BASE24TCPChannel)1 CSChannel (org.jpos.iso.channel.CSChannel)1 XMLPackager (org.jpos.iso.packager.XMLPackager)1