Search in sources :

Example 36 with ISOPackager

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

the class NCCChannelTest method testConstructor1.

@Test
public void testConstructor1() throws Throwable {
    byte[] TPDU = new byte[2];
    ISOPackager p = new ISO87BPackager();
    NCCChannel nCCChannel = new NCCChannel(p, TPDU);
    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()");
    assertNull(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) Test(org.junit.jupiter.api.Test)

Example 37 with ISOPackager

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

the class NCCChannelTest method testConstructor3.

@Test
public void testConstructor3() throws Throwable {
    byte[] TPDU = new byte[1];
    ISOPackager p = new CTCSubFieldPackager();
    NCCChannel nCCChannel = new NCCChannel("testNCCChannelHost", 100, p, TPDU);
    assertEquals(0, nCCChannel.getIncomingFilters().size(), "nCCChannel.getIncomingFilters().size()");
    assertEquals(100000, nCCChannel.getMaxPacketLength(), "nCCChannel.getMaxPacketLength()");
    assertSame(p, nCCChannel.getPackager(), "nCCChannel.getPackager()");
    assertEquals(100, 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()");
    assertNull(nCCChannel.getServerSocket(), "nCCChannel.getServerSocket()");
    assertEquals("org.jpos.iso.channel.NCCChannel", nCCChannel.getOriginalRealm(), "nCCChannel.getOriginalRealm()");
    assertNull(nCCChannel.getRealm(), "nCCChannel.getRealm()");
    assertEquals("testNCCChannelHost", nCCChannel.getHost(), "nCCChannel.getHost()");
}
Also used : ISOPackager(org.jpos.iso.ISOPackager) CTCSubFieldPackager(org.jpos.iso.packager.CTCSubFieldPackager) Test(org.junit.jupiter.api.Test)

Example 38 with ISOPackager

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

the class CSChannelTest method testConstructor.

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

Example 39 with ISOPackager

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

the class CSChannelTest method testConstructor1.

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

Example 40 with ISOPackager

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

the class HEXChannelTest method testConstructor.

@Test
public void testConstructor() throws Throwable {
    ISOPackager p = new GenericPackager();
    byte[] TPDU = new byte[3];
    HEXChannel hEXChannel = new HEXChannel("testHEXChannelHost", 100, p, TPDU);
    assertEquals(0, hEXChannel.getIncomingFilters().size(), "hEXChannel.getIncomingFilters().size()");
    assertEquals(100000, hEXChannel.getMaxPacketLength(), "hEXChannel.getMaxPacketLength()");
    assertSame(p, hEXChannel.getPackager(), "hEXChannel.getPackager()");
    assertEquals(100, hEXChannel.getPort(), "hEXChannel.getPort()");
    assertEquals("", hEXChannel.getName(), "hEXChannel.getName()");
    assertEquals(3, hEXChannel.getCounters().length, "hEXChannel.getCounters().length");
    assertNull(hEXChannel.getLogger(), "hEXChannel.getLogger()");
    assertNull(hEXChannel.getSocketFactory(), "hEXChannel.getSocketFactory()");
    assertSame(TPDU, hEXChannel.getHeader(), "hEXChannel.getHeader()");
    assertEquals(0, hEXChannel.getOutgoingFilters().size(), "hEXChannel.getOutgoingFilters().size()");
    assertNull(hEXChannel.getServerSocket(), "hEXChannel.getServerSocket()");
    assertEquals("org.jpos.iso.channel.HEXChannel", hEXChannel.getOriginalRealm(), "hEXChannel.getOriginalRealm()");
    assertNull(hEXChannel.getRealm(), "hEXChannel.getRealm()");
    assertEquals("testHEXChannelHost", hEXChannel.getHost(), "hEXChannel.getHost()");
}
Also used : ISOPackager(org.jpos.iso.ISOPackager) GenericPackager(org.jpos.iso.packager.GenericPackager) 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