Search in sources :

Example 1 with XMLChannel

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

the class BaseChannelTest method testSendMessageTrailer.

@Test
public void testSendMessageTrailer() throws Throwable {
    BaseChannel xMLChannel = new XMLChannel(new PostPackager());
    xMLChannel.sendMessageTrailer(new ISOMsg(), new byte[] { 100 });
    int actual = xMLChannel.getHeaderLength();
    assertEquals("(XMLChannel) xMLChannel.getHeaderLength()", 0, actual);
}
Also used : PostPackager(org.jpos.iso.packager.PostPackager) XMLChannel(org.jpos.iso.channel.XMLChannel) Test(org.junit.Test)

Example 2 with XMLChannel

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

the class BaseChannelTest method testAcceptThrowsNullPointerException.

@Test
public void testAcceptThrowsNullPointerException() throws Throwable {
    BaseChannel xMLChannel = new XMLChannel(new PostPackager());
    try {
        xMLChannel.accept(null);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertNull("(XMLChannel) xMLChannel.logger", ((XMLChannel) xMLChannel).logger);
        assertNull("(XMLChannel) xMLChannel.originalRealm", ((XMLChannel) xMLChannel).originalRealm);
        assertNull("(XMLChannel) xMLChannel.serverIn", ((XMLChannel) xMLChannel).serverIn);
        assertNull("(XMLChannel) xMLChannel.serverOut", ((XMLChannel) xMLChannel).serverOut);
        assertNull("(XMLChannel) xMLChannel.getSocket()", xMLChannel.getSocket());
        assertEquals("(XMLChannel) xMLChannel.cnt.length", 3, ((XMLChannel) xMLChannel).cnt.length);
        assertNull("(XMLChannel) xMLChannel.realm", ((XMLChannel) xMLChannel).realm);
        assertFalse("(XMLChannel) xMLChannel.usable", ((XMLChannel) xMLChannel).usable);
    }
}
Also used : PostPackager(org.jpos.iso.packager.PostPackager) XMLChannel(org.jpos.iso.channel.XMLChannel) Test(org.junit.Test)

Example 3 with XMLChannel

use of org.jpos.iso.channel.XMLChannel 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 4 with XMLChannel

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

the class ConnectorTest method testProcess.

@Test
public void testProcess() throws Throwable {
    Connector connector = new Connector();
    boolean result = connector.process(new XMLChannel(), new ISOMsg(100));
    assertTrue("result", result);
}
Also used : XMLChannel(org.jpos.iso.channel.XMLChannel) Test(org.junit.Test)

Example 5 with XMLChannel

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

the class SslChannelIntegrationTest method newClientChannel.

private XMLChannel newClientChannel() throws IOException, ISOException {
    XMLChannel clientChannel = new XMLChannel(new XMLPackager());
    clientChannel.setSocketFactory(new SunJSSESocketFactory());
    clientChannel.setConfiguration(clientConfiguration());
    clientChannel.setLogger(logger, "client.channel");
    clientChannel.setHost("localhost", PORT);
    return clientChannel;
}
Also used : XMLPackager(org.jpos.iso.packager.XMLPackager) XMLChannel(org.jpos.iso.channel.XMLChannel)

Aggregations

XMLChannel (org.jpos.iso.channel.XMLChannel)8 Test (org.junit.Test)6 PostPackager (org.jpos.iso.packager.PostPackager)2 XMLPackager (org.jpos.iso.packager.XMLPackager)2 EOFException (java.io.EOFException)1 IOException (java.io.IOException)1 ServerSocket (java.net.ServerSocket)1 EuroPackager (org.jpos.iso.packager.EuroPackager)1 ISO87APackager (org.jpos.iso.packager.ISO87APackager)1 ThreadPool (org.jpos.util.ThreadPool)1