Search in sources :

Example 6 with CTCSubFieldPackager

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

the class BaseChannelTest method testApplyOutgoingFilters1.

@Test
public void testApplyOutgoingFilters1() throws Throwable {
    BaseChannel x25Channel = new X25Channel();
    ISOMsg result = x25Channel.applyOutgoingFilters(null, new LogEvent(new CTCSubFieldPackager(), "testBaseChannelTag"));
    assertNull("result", result);
}
Also used : LogEvent(org.jpos.util.LogEvent) X25Channel(org.jpos.iso.channel.X25Channel) CTCSubFieldPackager(org.jpos.iso.packager.CTCSubFieldPackager) Test(org.junit.Test)

Example 7 with CTCSubFieldPackager

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

the class GZIPChannelTest method testSendMessageThrowsNullPointerException.

@Test
public void testSendMessageThrowsNullPointerException() throws Throwable {
    GZIPChannel gZIPChannel = new GZIPChannel("testGZIPChannelHost", 100, new CTCSubFieldPackager());
    byte[] b = new byte[3];
    try {
        gZIPChannel.sendMessage(b, 100, 1000);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : CTCSubFieldPackager(org.jpos.iso.packager.CTCSubFieldPackager) Test(org.junit.Test)

Example 8 with CTCSubFieldPackager

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

the class NACChannelTest method testConstructor2.

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

Example 9 with CTCSubFieldPackager

use of org.jpos.iso.packager.CTCSubFieldPackager 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("nCCChannel.getIncomingFilters().size()", 0, nCCChannel.getIncomingFilters().size());
    assertEquals("nCCChannel.getMaxPacketLength()", 100000, nCCChannel.getMaxPacketLength());
    assertSame("nCCChannel.getPackager()", p, nCCChannel.getPackager());
    assertEquals("nCCChannel.getPort()", 100, 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());
    assertEquals("nCCChannel.getHost()", "testNCCChannelHost", nCCChannel.getHost());
}
Also used : ISOPackager(org.jpos.iso.ISOPackager) CTCSubFieldPackager(org.jpos.iso.packager.CTCSubFieldPackager) Test(org.junit.Test)

Example 10 with CTCSubFieldPackager

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

the class MD5FilterTest method testFilterThrowsNullPointerException1.

@Test
public void testFilterThrowsNullPointerException1() throws Throwable {
    int[] fields = new int[1];
    MD5Filter mD5Filter = new MD5Filter();
    mD5Filter.setConfiguration(new SimpleConfiguration());
    mD5Filter.setFields(fields);
    LogEvent evt = new LogEvent("testMD5FilterTag", Integer.valueOf(-12));
    try {
        mD5Filter.filter(new PostChannel(new CTCSubFieldPackager()), null, evt);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : LogEvent(org.jpos.util.LogEvent) SimpleConfiguration(org.jpos.core.SimpleConfiguration) PostChannel(org.jpos.iso.channel.PostChannel) CTCSubFieldPackager(org.jpos.iso.packager.CTCSubFieldPackager) Test(org.junit.Test)

Aggregations

CTCSubFieldPackager (org.jpos.iso.packager.CTCSubFieldPackager)13 Test (org.junit.Test)13 LogEvent (org.jpos.util.LogEvent)9 ISOMsg (org.jpos.iso.ISOMsg)4 PostChannel (org.jpos.iso.channel.PostChannel)4 ISOPackager (org.jpos.iso.ISOPackager)3 X25Channel (org.jpos.iso.channel.X25Channel)3 ServerSocket (java.net.ServerSocket)2 PADChannel (org.jpos.iso.channel.PADChannel)2 XMLPackager (org.jpos.iso.packager.XMLPackager)2 SimpleConfiguration (org.jpos.core.SimpleConfiguration)1 ISOChannel (org.jpos.iso.ISOChannel)1 ISOFilter (org.jpos.iso.ISOFilter)1 MD5Filter (org.jpos.iso.filter.MD5Filter)1