use of org.jpos.iso.channel.X25Channel in project jPOS by jpos.
the class BaseChannelTest method testApplyOutgoingFilters.
@Test
public void testApplyOutgoingFilters() throws Throwable {
BaseChannel x25Channel = new X25Channel();
LogEvent evt = new LogEvent(new CTCSubFieldPackager(), "testBaseChannelTag");
ISOMsg result = x25Channel.applyOutgoingFilters(m, evt);
assertSame(m, result, "result");
}
use of org.jpos.iso.channel.X25Channel in project jPOS by jpos.
the class BaseChannelTest method testResetCounters.
@Test
public void testResetCounters() throws Throwable {
BaseChannel x25Channel = new X25Channel(new GenericValidatingPackager());
x25Channel.resetCounters();
assertEquals(3, ((X25Channel) x25Channel).cnt.length, "(X25Channel) x25Channel.cnt.length");
}
use of org.jpos.iso.channel.X25Channel in project jPOS by jpos.
the class BaseChannelTest method testSendKeepAliveThrowsNullPointerException.
@Test
public void testSendKeepAliveThrowsNullPointerException() throws Throwable {
try {
new X25Channel("testBaseChannelHost", 100, new XMLPackager()).sendKeepAlive();
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot invoke \"java.io.DataOutputStream.flush()\" because \"this.serverOut\" is null", ex.getMessage(), "ex.getMessage()");
}
}
}
use of org.jpos.iso.channel.X25Channel in project jPOS by jpos.
the class BaseChannelTest method testApplyIncomingFilters2.
@Test
public void testApplyIncomingFilters2() throws Throwable {
BaseChannel x25Channel = new X25Channel(null, new ServerSocket());
byte[] header = new byte[1];
byte[] image = new byte[1];
ISOMsg result = x25Channel.applyIncomingFilters(null, header, image, new LogEvent("testBaseChannelTag"));
assertNull(result, "result");
}
use of org.jpos.iso.channel.X25Channel in project jPOS by jpos.
the class BaseChannelTest method testSetConfigurationThrowsNullPointerException.
@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
BaseChannel x25Channel = new X25Channel();
Configuration cfg = new SimpleConfiguration((Properties) null);
try {
x25Channel.setConfiguration(cfg);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot invoke \"java.util.Properties.get(Object)\" because \"this.props\" is null", ex.getMessage(), "ex.getMessage()");
}
assertEquals(100000, x25Channel.getMaxPacketLength(), "(X25Channel) x25Channel.getMaxPacketLength()");
assertEquals(0, x25Channel.getPort(), "(X25Channel) x25Channel.getPort()");
assertEquals(0, x25Channel.getTimeout(), "(X25Channel) x25Channel.getTimeout()");
assertNull(x25Channel.getHost(), "(X25Channel) x25Channel.getHost()");
assertNull(x25Channel.getSocket(), "(X25Channel) x25Channel.getSocket()");
assertFalse(((X25Channel) x25Channel).overrideHeader, "(X25Channel) x25Channel.overrideHeader");
}
}
Aggregations