Search in sources :

Example 6 with ISO87APackager

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

the class BASE24TCPChannelTest method testConstructor1.

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

Example 7 with ISO87APackager

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

the class BASE24TCPChannelTest method testSendMessageLengthThrowsNullPointerException.

@Test
public void testSendMessageLengthThrowsNullPointerException() throws Throwable {
    BASE24TCPChannel bASE24TCPChannel = new BASE24TCPChannel(new ISO87APackager());
    try {
        bASE24TCPChannel.sendMessageLength(100);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : ISO87APackager(org.jpos.iso.packager.ISO87APackager) Test(org.junit.Test)

Example 8 with ISO87APackager

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

the class NCCChannelTest method testSendMessageHeaderThrowsNullPointerException2.

@Test
public void testSendMessageHeaderThrowsNullPointerException2() throws Throwable {
    byte[] TPDU = new byte[16];
    NCCChannel nCCChannel = new NCCChannel(new ISO87APackager(), TPDU);
    try {
        nCCChannel.sendMessageHeader(null, 100);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : ISO87APackager(org.jpos.iso.packager.ISO87APackager) Test(org.junit.Test)

Aggregations

ISO87APackager (org.jpos.iso.packager.ISO87APackager)8 Test (org.junit.Test)8 ISOPackager (org.jpos.iso.ISOPackager)2 ServerSocket (java.net.ServerSocket)1 BASE24Channel (org.jpos.iso.channel.BASE24Channel)1 LogChannel (org.jpos.iso.channel.LogChannel)1 XMLChannel (org.jpos.iso.channel.XMLChannel)1