Search in sources :

Example 1 with MD5Filter

use of org.jpos.iso.filter.MD5Filter in project jPOS by jpos.

the class BaseChannelTest method testRemoveFilter3.

@Test
public void testRemoveFilter3() throws Throwable {
    BaseChannel pADChannel = new PADChannel("testBaseChannelHost", 100, null);
    pADChannel.removeFilter(new MD5Filter(), 2);
    assertEquals("(PADChannel) pADChannel.outgoingFilters.size()", 0, ((PADChannel) pADChannel).outgoingFilters.size());
}
Also used : PADChannel(org.jpos.iso.channel.PADChannel) MD5Filter(org.jpos.iso.filter.MD5Filter) Test(org.junit.Test)

Example 2 with MD5Filter

use of org.jpos.iso.filter.MD5Filter 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("ex.getMessage()", "MD5Filter not configured", 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.Test)

Example 3 with MD5Filter

use of org.jpos.iso.filter.MD5Filter 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("(X25Channel) x25Channel.incomingFilters.size()", 1, ((X25Channel) x25Channel).incomingFilters.size());
    assertEquals("(X25Channel) x25Channel.outgoingFilters.size()", 1, ((X25Channel) x25Channel).outgoingFilters.size());
}
Also used : X25Channel(org.jpos.iso.channel.X25Channel) MD5Filter(org.jpos.iso.filter.MD5Filter) Test(org.junit.Test)

Example 4 with MD5Filter

use of org.jpos.iso.filter.MD5Filter 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("(X25Channel) x25Channel.incomingFilters.size()", 1, ((X25Channel) x25Channel).incomingFilters.size());
}
Also used : X25Channel(org.jpos.iso.channel.X25Channel) MD5Filter(org.jpos.iso.filter.MD5Filter) Test(org.junit.Test)

Example 5 with MD5Filter

use of org.jpos.iso.filter.MD5Filter in project jPOS by jpos.

the class BaseChannelTest method testApplyOutgoingFiltersThrowsVetoException.

@Test
public void testApplyOutgoingFiltersThrowsVetoException() throws Throwable {
    BaseChannel bASE24Channel = new BASE24Channel("testBaseChannelHost", 100, new ISO87APackagerBBitmap());
    bASE24Channel.addFilter(new MD5Filter(), 0);
    try {
        bASE24Channel.applyOutgoingFilters(new ISOMsg(), new LogEvent());
        fail("Expected VetoException to be thrown");
    } catch (ISOFilter.VetoException ex) {
        assertEquals("ex.getMessage()", "MD5Filter not configured", ex.getMessage());
        assertNull("ex.nested", ex.nested);
    }
}
Also used : BASE24Channel(org.jpos.iso.channel.BASE24Channel) LogEvent(org.jpos.util.LogEvent) MD5Filter(org.jpos.iso.filter.MD5Filter) ISO87APackagerBBitmap(org.jpos.iso.packager.ISO87APackagerBBitmap) Test(org.junit.Test)

Aggregations

MD5Filter (org.jpos.iso.filter.MD5Filter)6 Test (org.junit.Test)6 X25Channel (org.jpos.iso.channel.X25Channel)3 BASE24Channel (org.jpos.iso.channel.BASE24Channel)2 ISO87APackagerBBitmap (org.jpos.iso.packager.ISO87APackagerBBitmap)2 LogEvent (org.jpos.util.LogEvent)2 PADChannel (org.jpos.iso.channel.PADChannel)1 CTCSubFieldPackager (org.jpos.iso.packager.CTCSubFieldPackager)1