Search in sources :

Example 1 with ISO87APackager

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

the class BaseChannelTest method testGetHeader.

@Test
public void testGetHeader() throws Throwable {
    byte[] header = new byte[0];
    BaseChannel bASE24Channel = new BASE24Channel(new ISO87APackager(), new ServerSocket());
    bASE24Channel.setHeader(header);
    byte[] result = bASE24Channel.getHeader();
    assertSame("result", header, result);
}
Also used : BASE24Channel(org.jpos.iso.channel.BASE24Channel) ISO87APackager(org.jpos.iso.packager.ISO87APackager) Test(org.junit.Test)

Example 2 with ISO87APackager

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

the class BaseChannelTest method testIsConnected.

@Test
public void testIsConnected() throws Throwable {
    boolean result = new XMLChannel(new ISO87APackager()).isConnected();
    assertFalse("result", result);
}
Also used : ISO87APackager(org.jpos.iso.packager.ISO87APackager) XMLChannel(org.jpos.iso.channel.XMLChannel) Test(org.junit.Test)

Example 3 with ISO87APackager

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

the class BASE24TCPChannelTest method testConstructor.

@Test
public void testConstructor() throws Throwable {
    ISOPackager p = new ISO87APackager();
    BASE24TCPChannel bASE24TCPChannel = new BASE24TCPChannel(p);
    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());
    assertNull("bASE24TCPChannel.getServerSocket()", 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) ISO87APackager(org.jpos.iso.packager.ISO87APackager) Test(org.junit.Test)

Example 4 with ISO87APackager

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

the class NCCChannelTest method testSendMessageLengthThrowsNullPointerException.

@Test
public void testSendMessageLengthThrowsNullPointerException() throws Throwable {
    byte[] TPDU = new byte[0];
    NCCChannel nCCChannel = new NCCChannel(new ISO87APackager(), TPDU);
    try {
        nCCChannel.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 5 with ISO87APackager

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

the class ISOMsg2Test method testSetSource.

@Test
public void testSetSource() throws Throwable {
    ISOMsg iSOMsg = new ISOMsg();
    ISOSource source = new LogChannel("testISOMsgHost", 100, new ISO87APackager());
    iSOMsg.setSource(source);
    assertSame("iSOMsg.getSource()", source, iSOMsg.getSource());
}
Also used : LogChannel(org.jpos.iso.channel.LogChannel) 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