Search in sources :

Example 6 with ISO87BPackager

use of org.jpos.iso.packager.ISO87BPackager 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("nCCChannel.getIncomingFilters().size()", 0, nCCChannel.getIncomingFilters().size());
    assertEquals("nCCChannel.getMaxPacketLength()", 100000, nCCChannel.getMaxPacketLength());
    assertSame("nCCChannel.getPackager()", p, nCCChannel.getPackager());
    assertEquals("nCCChannel.getPort()", 0, nCCChannel.getPort());
    assertEquals("nCCChannel.getName()", "", nCCChannel.getName());
    assertEquals("nCCChannel.getCounters().length", 3, nCCChannel.getCounters().length);
    assertNull("nCCChannel.getLogger()", nCCChannel.getLogger());
    assertNull("nCCChannel.getSocketFactory()", nCCChannel.getSocketFactory());
    assertSame("nCCChannel.getHeader()", TPDU, nCCChannel.getHeader());
    assertEquals("nCCChannel.getOutgoingFilters().size()", 0, nCCChannel.getOutgoingFilters().size());
    assertNull("nCCChannel.getServerSocket()", nCCChannel.getServerSocket());
    assertEquals("nCCChannel.getOriginalRealm()", "org.jpos.iso.channel.NCCChannel", 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.Test)

Example 7 with ISO87BPackager

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

the class NCCChannelTest method testSetHeaderThrowsNullPointerException.

@Test
public void testSetHeaderThrowsNullPointerException() throws Throwable {
    byte[] TPDU = new byte[1];
    NCCChannel nCCChannel = new NCCChannel(new ISO87BPackager(), TPDU, new ServerSocket());
    try {
        nCCChannel.setHeader((String) null);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertSame("nCCChannel.getHeader()", TPDU, nCCChannel.getHeader());
    }
}
Also used : ISO87BPackager(org.jpos.iso.packager.ISO87BPackager) ServerSocket(java.net.ServerSocket) Test(org.junit.Test)

Aggregations

ISO87BPackager (org.jpos.iso.packager.ISO87BPackager)7 Test (org.junit.Test)7 ServerSocket (java.net.ServerSocket)4 ISOPackager (org.jpos.iso.ISOPackager)3 ISOMsg (org.jpos.iso.ISOMsg)2 BASE1Header (org.jpos.iso.header.BASE1Header)2