Search in sources :

Example 1 with X25Channel

use of org.jpos.iso.channel.X25Channel in project jPOS by jpos.

the class BaseChannelTest method testAddIncomingFilter.

@Test
public void testAddIncomingFilter() throws Throwable {
    BaseChannel x25Channel = new X25Channel();
    x25Channel.addIncomingFilter(new MD5Filter());
    assertEquals(1, ((X25Channel) x25Channel).incomingFilters.size(), "(X25Channel) x25Channel.incomingFilters.size()");
}
Also used : X25Channel(org.jpos.iso.channel.X25Channel) MD5Filter(org.jpos.iso.filter.MD5Filter) Test(org.junit.jupiter.api.Test)

Example 2 with X25Channel

use of org.jpos.iso.channel.X25Channel in project jPOS by jpos.

the class BaseChannelTest method testAddOutgoingFilter.

@Test
public void testAddOutgoingFilter() throws Throwable {
    BaseChannel x25Channel = new X25Channel();
    x25Channel.addOutgoingFilter(new StatefulFilter());
    assertEquals(1, ((X25Channel) x25Channel).outgoingFilters.size(), "(X25Channel) x25Channel.outgoingFilters.size()");
}
Also used : X25Channel(org.jpos.iso.channel.X25Channel) StatefulFilter(org.jpos.iso.filter.StatefulFilter) Test(org.junit.jupiter.api.Test)

Example 3 with X25Channel

use of org.jpos.iso.channel.X25Channel in project jPOS by jpos.

the class BaseChannelTest method testRemoveOutgoingFilter.

@Test
public void testRemoveOutgoingFilter() throws Throwable {
    BaseChannel x25Channel = new X25Channel();
    x25Channel.removeOutgoingFilter(new StatefulFilter());
    assertEquals(0, ((X25Channel) x25Channel).outgoingFilters.size(), "(X25Channel) x25Channel.outgoingFilters.size()");
}
Also used : X25Channel(org.jpos.iso.channel.X25Channel) StatefulFilter(org.jpos.iso.filter.StatefulFilter) Test(org.junit.jupiter.api.Test)

Example 4 with X25Channel

use of org.jpos.iso.channel.X25Channel in project jPOS by jpos.

the class BaseChannelTest method testAddFilter.

@Test
public void testAddFilter() throws Throwable {
    BaseChannel x25Channel = new X25Channel();
    x25Channel.addFilter(new MD5Filter());
    assertEquals(1, ((X25Channel) x25Channel).incomingFilters.size(), "(X25Channel) x25Channel.incomingFilters.size()");
    assertEquals(1, ((X25Channel) x25Channel).outgoingFilters.size(), "(X25Channel) x25Channel.outgoingFilters.size()");
}
Also used : X25Channel(org.jpos.iso.channel.X25Channel) MD5Filter(org.jpos.iso.filter.MD5Filter) Test(org.junit.jupiter.api.Test)

Example 5 with X25Channel

use of org.jpos.iso.channel.X25Channel in project jPOS by jpos.

the class BaseChannelTest method testApplyIncomingFiltersThrowsVetoException.

@Test
public void testApplyIncomingFiltersThrowsVetoException() throws Throwable {
    BaseChannel x25Channel = new X25Channel();
    x25Channel.addFilter(new MD5Filter());
    try {
        x25Channel.applyIncomingFilters(new ISOMsg(), new LogEvent(new CTCSubFieldPackager(), "testBaseChannelTag"));
        fail("Expected VetoException to be thrown");
    } catch (ISOFilter.VetoException ex) {
        assertEquals("MD5Filter not configured", ex.getMessage(), "ex.getMessage()");
        assertNull(ex.nested, "ex.nested");
    }
}
Also used : LogEvent(org.jpos.util.LogEvent) X25Channel(org.jpos.iso.channel.X25Channel) CTCSubFieldPackager(org.jpos.iso.packager.CTCSubFieldPackager) MD5Filter(org.jpos.iso.filter.MD5Filter) Test(org.junit.jupiter.api.Test)

Aggregations

X25Channel (org.jpos.iso.channel.X25Channel)13 Test (org.junit.jupiter.api.Test)13 LogEvent (org.jpos.util.LogEvent)4 MD5Filter (org.jpos.iso.filter.MD5Filter)3 StatefulFilter (org.jpos.iso.filter.StatefulFilter)3 CTCSubFieldPackager (org.jpos.iso.packager.CTCSubFieldPackager)3 ArrayList (java.util.ArrayList)1 Configuration (org.jpos.core.Configuration)1 SimpleConfiguration (org.jpos.core.SimpleConfiguration)1 GenericValidatingPackager (org.jpos.iso.packager.GenericValidatingPackager)1 XMLPackager (org.jpos.iso.packager.XMLPackager)1