Search in sources :

Example 6 with ISOBaseValidatingPackager

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

the class BaseChannelTest method testGetHeaderLength4.

@Test
public void testGetHeaderLength4() throws Throwable {
    byte[] header = new byte[1];
    BaseChannel gZIPChannel = new GZIPChannel("testBaseChannelHost", 100, new ISOBaseValidatingPackager());
    gZIPChannel.setHeader(header);
    int result = gZIPChannel.getHeaderLength();
    assertEquals("result", 1, result);
}
Also used : ISOBaseValidatingPackager(org.jpos.iso.packager.ISOBaseValidatingPackager) GZIPChannel(org.jpos.iso.channel.GZIPChannel) Test(org.junit.Test)

Example 7 with ISOBaseValidatingPackager

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

the class HEXChannelTest method testConstructor3.

@Test
public void testConstructor3() throws Throwable {
    ISOPackager p = new ISOBaseValidatingPackager();
    byte[] TPDU = new byte[2];
    ServerSocket serverSocket = new ServerSocket();
    HEXChannel hEXChannel = new HEXChannel(p, TPDU, serverSocket);
    assertEquals("hEXChannel.getIncomingFilters().size()", 0, hEXChannel.getIncomingFilters().size());
    assertEquals("hEXChannel.getMaxPacketLength()", 100000, hEXChannel.getMaxPacketLength());
    assertSame("hEXChannel.getPackager()", p, hEXChannel.getPackager());
    assertEquals("hEXChannel.getPort()", 0, hEXChannel.getPort());
    assertEquals("hEXChannel.getName()", "", hEXChannel.getName());
    assertEquals("hEXChannel.getCounters().length", 3, hEXChannel.getCounters().length);
    assertNull("hEXChannel.getLogger()", hEXChannel.getLogger());
    assertNull("hEXChannel.getSocketFactory()", hEXChannel.getSocketFactory());
    assertSame("hEXChannel.getHeader()", TPDU, hEXChannel.getHeader());
    assertEquals("hEXChannel.getOutgoingFilters().size()", 0, hEXChannel.getOutgoingFilters().size());
    assertSame("hEXChannel.getServerSocket()", serverSocket, hEXChannel.getServerSocket());
    assertEquals("hEXChannel.getOriginalRealm()", "org.jpos.iso.channel.HEXChannel", hEXChannel.getOriginalRealm());
    assertNull("hEXChannel.getRealm()", hEXChannel.getRealm());
    assertNull("hEXChannel.getHost()", hEXChannel.getHost());
}
Also used : ISOPackager(org.jpos.iso.ISOPackager) ISOBaseValidatingPackager(org.jpos.iso.packager.ISOBaseValidatingPackager) ServerSocket(java.net.ServerSocket) Test(org.junit.Test)

Example 8 with ISOBaseValidatingPackager

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

the class PADChannelTest method testConstructor.

@Test
public void testConstructor() throws Throwable {
    ISOPackager p = new ISOBaseValidatingPackager();
    PADChannel pADChannel = new PADChannel("testPADChannelHost", 100, p);
    assertEquals("pADChannel.getIncomingFilters().size()", 0, pADChannel.getIncomingFilters().size());
    assertEquals("pADChannel.getMaxPacketLength()", 100000, pADChannel.getMaxPacketLength());
    assertSame("pADChannel.getPackager()", p, pADChannel.getPackager());
    assertEquals("pADChannel.getPort()", 100, pADChannel.getPort());
    assertEquals("pADChannel.getName()", "", pADChannel.getName());
    assertEquals("pADChannel.getCounters().length", 3, pADChannel.getCounters().length);
    assertNull("pADChannel.getLogger()", pADChannel.getLogger());
    assertNull("pADChannel.getSocketFactory()", pADChannel.getSocketFactory());
    assertNull("pADChannel.getHeader()", pADChannel.getHeader());
    assertEquals("pADChannel.getOutgoingFilters().size()", 0, pADChannel.getOutgoingFilters().size());
    assertNull("pADChannel.getServerSocket()", pADChannel.getServerSocket());
    assertEquals("pADChannel.getOriginalRealm()", "org.jpos.iso.channel.PADChannel", pADChannel.getOriginalRealm());
    assertNull("pADChannel.getRealm()", pADChannel.getRealm());
    assertEquals("pADChannel.getHost()", "testPADChannelHost", pADChannel.getHost());
    assertNull("pADChannel.reader", pADChannel.reader);
}
Also used : ISOPackager(org.jpos.iso.ISOPackager) ISOBaseValidatingPackager(org.jpos.iso.packager.ISOBaseValidatingPackager) Test(org.junit.Test)

Example 9 with ISOBaseValidatingPackager

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

the class PostChannelTest method testConstructor2.

@Test
public void testConstructor2() throws Throwable {
    ISOPackager p = new ISOBaseValidatingPackager();
    PostChannel postChannel = new PostChannel(p);
    assertEquals("postChannel.getIncomingFilters().size()", 0, postChannel.getIncomingFilters().size());
    assertEquals("postChannel.getMaxPacketLength()", 100000, postChannel.getMaxPacketLength());
    assertSame("postChannel.getPackager()", p, postChannel.getPackager());
    assertEquals("postChannel.getPort()", 0, postChannel.getPort());
    assertEquals("postChannel.getName()", "", postChannel.getName());
    assertEquals("postChannel.getCounters().length", 3, postChannel.getCounters().length);
    assertNull("postChannel.getLogger()", postChannel.getLogger());
    assertNull("postChannel.getSocketFactory()", postChannel.getSocketFactory());
    assertNull("postChannel.getHeader()", postChannel.getHeader());
    assertEquals("postChannel.getOutgoingFilters().size()", 0, postChannel.getOutgoingFilters().size());
    assertNull("postChannel.getServerSocket()", postChannel.getServerSocket());
    assertEquals("postChannel.getOriginalRealm()", "org.jpos.iso.channel.PostChannel", postChannel.getOriginalRealm());
    assertNull("postChannel.getRealm()", postChannel.getRealm());
    assertNull("postChannel.getHost()", postChannel.getHost());
}
Also used : ISOPackager(org.jpos.iso.ISOPackager) ISOBaseValidatingPackager(org.jpos.iso.packager.ISOBaseValidatingPackager) Test(org.junit.Test)

Example 10 with ISOBaseValidatingPackager

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

the class RawChannelTest method testConstructor1.

@Test
public void testConstructor1() throws Throwable {
    byte[] header = new byte[3];
    ISOPackager p = new ISOBaseValidatingPackager();
    RawChannel rawChannel = new RawChannel("testRawChannelHost", 100, p, header);
    assertEquals("rawChannel.getIncomingFilters().size()", 0, rawChannel.getIncomingFilters().size());
    assertEquals("rawChannel.getMaxPacketLength()", 100000, rawChannel.getMaxPacketLength());
    assertSame("rawChannel.getPackager()", p, rawChannel.getPackager());
    assertEquals("rawChannel.getPort()", 100, rawChannel.getPort());
    assertEquals("rawChannel.getName()", "", rawChannel.getName());
    assertEquals("rawChannel.getCounters().length", 3, rawChannel.getCounters().length);
    assertNull("rawChannel.getLogger()", rawChannel.getLogger());
    assertNull("rawChannel.getSocketFactory()", rawChannel.getSocketFactory());
    assertSame("rawChannel.getHeader()", header, rawChannel.getHeader());
    assertEquals("rawChannel.getOutgoingFilters().size()", 0, rawChannel.getOutgoingFilters().size());
    assertNull("rawChannel.getServerSocket()", rawChannel.getServerSocket());
    assertEquals("rawChannel.getOriginalRealm()", "org.jpos.iso.channel.RawChannel", rawChannel.getOriginalRealm());
    assertNull("rawChannel.getRealm()", rawChannel.getRealm());
    assertEquals("rawChannel.getHost()", "testRawChannelHost", rawChannel.getHost());
}
Also used : ISOPackager(org.jpos.iso.ISOPackager) ISOBaseValidatingPackager(org.jpos.iso.packager.ISOBaseValidatingPackager) Test(org.junit.Test)

Aggregations

ISOBaseValidatingPackager (org.jpos.iso.packager.ISOBaseValidatingPackager)15 Test (org.junit.Test)15 LogEvent (org.jpos.util.LogEvent)8 ISOMsg (org.jpos.iso.ISOMsg)7 ISOPackager (org.jpos.iso.ISOPackager)5 SimpleConfiguration (org.jpos.core.SimpleConfiguration)4 ASCIIChannel (org.jpos.iso.channel.ASCIIChannel)4 CSChannel (org.jpos.iso.channel.CSChannel)3 ServerSocket (java.net.ServerSocket)2 ISOFilter (org.jpos.iso.ISOFilter)2 GZIPChannel (org.jpos.iso.channel.GZIPChannel)2