Search in sources :

Example 6 with ISOPackager

use of org.jpos.iso.ISOPackager in project jPOS by jpos.

the class NCCChannelTest method testConstructor.

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

Example 7 with ISOPackager

use of org.jpos.iso.ISOPackager in project jPOS by jpos.

the class PADChannelTest method testConstructor2.

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

Example 8 with ISOPackager

use of org.jpos.iso.ISOPackager in project jPOS by jpos.

the class RawChannelTest method testConstructor3.

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

Example 9 with ISOPackager

use of org.jpos.iso.ISOPackager in project jPOS by jpos.

the class BASE24ChannelTest method testConstructor.

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

Example 10 with ISOPackager

use of org.jpos.iso.ISOPackager in project jPOS by jpos.

the class BASE24ChannelTest method testConstructor3.

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

Aggregations

ISOPackager (org.jpos.iso.ISOPackager)46 Test (org.junit.jupiter.api.Test)42 ServerSocket (java.net.ServerSocket)12 ISOBaseValidatingPackager (org.jpos.iso.packager.ISOBaseValidatingPackager)5 ISO93APackager (org.jpos.iso.packager.ISO93APackager)4 ISOMsg (org.jpos.iso.ISOMsg)3 Base1Packager (org.jpos.iso.packager.Base1Packager)3 CTCSubFieldPackager (org.jpos.iso.packager.CTCSubFieldPackager)3 GenericPackager (org.jpos.iso.packager.GenericPackager)3 ISO87APackagerBBitmap (org.jpos.iso.packager.ISO87APackagerBBitmap)3 ISO87BPackager (org.jpos.iso.packager.ISO87BPackager)3 PostPackager (org.jpos.iso.packager.PostPackager)3 XMLPackager (org.jpos.iso.packager.XMLPackager)3 GenericValidatingPackager (org.jpos.iso.packager.GenericValidatingPackager)2 ISO87APackager (org.jpos.iso.packager.ISO87APackager)2 ISO93BPackager (org.jpos.iso.packager.ISO93BPackager)2 ListSelectionEvent (javax.swing.event.ListSelectionEvent)1 ListSelectionListener (javax.swing.event.ListSelectionListener)1 AbstractTableModel (javax.swing.table.AbstractTableModel)1 TableModel (javax.swing.table.TableModel)1