Package org.jpos.iso.channel

Examples of org.jpos.iso.channel.GZIPChannel


    }

    @Test
    public void testFilter() throws Throwable {
        MacroFilter macroFilter = new MacroFilter();
        ISOChannel channel = new GZIPChannel(new X92GenericPackager());
        LogEvent evt = new LogEvent("testMacroFilterTag", "\u0000\u0000");
        when(m.getMaxField()).thenReturn(0);
        ISOMsg result = macroFilter.filter(channel, m, evt);
        assertSame("result", m, result);
        verify(m).hasField(0);
View Full Code Here


    @Test
    public void testFilterThrowsNullPointerException5() throws Throwable {
  StatefulFilter statefulFilter = new StatefulFilter();
  statefulFilter.setSpace((Space) null);
  try {
      statefulFilter.filter(new GZIPChannel(), new ISOMsg(
        "testStatefulFilterMti"), new LogEvent());
      fail("Expected NullPointerException to be thrown");
  } catch (NullPointerException ex) {
      assertNull("ex.getMessage()", ex.getMessage());
  }
View Full Code Here

        mD5Filter.setConfiguration(new SimpleConfiguration());
        int[] fields = new int[1];
        mD5Filter.setFields(fields);
        ISOMsg m = new ISOMsg("testMD5FilterMti");
        try {
            mD5Filter.filter(new GZIPChannel(new XMLPackager()), m, null);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
            assertEquals("m.getDirection()", 0, m.getDirection());
        }
View Full Code Here

        int[] fields = new int[1];
        fields[0] = -100;
        mD5Filter.setFields(fields);
        ISOMsg m = new ISOMsg("testMD5FilterMti");
        try {
            mD5Filter.filter(new GZIPChannel(new XMLPackager()), m, null);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
            assertEquals("m.getDirection()", 0, m.getDirection());
        }
View Full Code Here

        }
    }

    @Test
    public void testAcceptThrowsSocketException() throws Throwable {
        BaseChannel gZIPChannel = new GZIPChannel();
        ServerSocket s = new ServerSocket();
        try {
            gZIPChannel.accept(s);
            fail("Expected SocketException to be thrown");
        } catch (SocketException ex) {
            assertEquals("ex.getClass()", SocketException.class, ex.getClass());
            assertNull("(GZIPChannel) gZIPChannel.logger", ((GZIPChannel) gZIPChannel).logger);
            assertNull("(GZIPChannel) gZIPChannel.originalRealm", ((GZIPChannel) gZIPChannel).originalRealm);
            assertNull("(GZIPChannel) gZIPChannel.serverIn", ((GZIPChannel) gZIPChannel).serverIn);
            assertNull("(GZIPChannel) gZIPChannel.serverOut", ((GZIPChannel) gZIPChannel).serverOut);
            assertNull("(GZIPChannel) gZIPChannel.getSocket()", gZIPChannel.getSocket());
            assertEquals("(GZIPChannel) gZIPChannel.cnt.length", 3, ((GZIPChannel) gZIPChannel).cnt.length);
            assertNull("(GZIPChannel) gZIPChannel.realm", ((GZIPChannel) gZIPChannel).realm);
            assertFalse("(GZIPChannel) gZIPChannel.usable", ((GZIPChannel) gZIPChannel).usable);
            assertFalse("s.isClosed()", s.isClosed());
        }
View Full Code Here

        assertEquals("(X25Channel) x25Channel.outgoingFilters.size()", 0, ((X25Channel) x25Channel).outgoingFilters.size());
    }

    @Test
    public void testAddFilter2() throws Throwable {
        BaseChannel gZIPChannel = new GZIPChannel();
        gZIPChannel.addFilter(new StatefulFilter(), 1);
        assertEquals("(GZIPChannel) gZIPChannel.incomingFilters.size()", 1, ((GZIPChannel) gZIPChannel).incomingFilters.size());
    }
View Full Code Here

        assertEquals("(GZIPChannel) gZIPChannel.incomingFilters.size()", 1, ((GZIPChannel) gZIPChannel).incomingFilters.size());
    }

    @Test
    public void testAddFilter3() throws Throwable {
        BaseChannel gZIPChannel = new GZIPChannel();
        gZIPChannel.addFilter(new DelayFilter(), 2);
        assertEquals("(GZIPChannel) gZIPChannel.outgoingFilters.size()", 1, ((GZIPChannel) gZIPChannel).outgoingFilters.size());
    }
View Full Code Here

        assertSame("result", m, result);
    }

    @Test
    public void testApplyIncomingFilters1() throws Throwable {
        BaseChannel gZIPChannel = new GZIPChannel("testBaseChannelHost", 100, new ISOBaseValidatingPackager());
        LogEvent evt = new LogEvent();
        byte[] header = new byte[0];
        byte[] image = new byte[2];
        ISOMsg result = gZIPChannel.applyIncomingFilters(m, header, image, evt);
        assertSame("result", m, result);
    }
View Full Code Here

        }
    }

    @Test
    public void testApplyTimeout() throws Throwable {
        BaseChannel gZIPChannel = new GZIPChannel();
        gZIPChannel.applyTimeout();
        assertNull("(GZIPChannel) gZIPChannel.getSocket()", gZIPChannel.getSocket());
    }
View Full Code Here

    }

    @Test
    public void testConnectThrowsNullPointerException1() throws Throwable {
        Socket socket = new Socket(Proxy.NO_PROXY);
        BaseChannel gZIPChannel = new GZIPChannel();
        gZIPChannel.setTimeout(1);
        try {
            gZIPChannel.connect(socket);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
            assertNull("(GZIPChannel) gZIPChannel.serverIn", ((GZIPChannel) gZIPChannel).serverIn);
            assertNull("(GZIPChannel) gZIPChannel.serverOut", ((GZIPChannel) gZIPChannel).serverOut);
            assertSame("(GZIPChannel) gZIPChannel.getSocket()", socket, gZIPChannel.getSocket());
            assertEquals("(GZIPChannel) gZIPChannel.cnt.length", 3, ((GZIPChannel) gZIPChannel).cnt.length);
            assertFalse("(GZIPChannel) gZIPChannel.usable", ((GZIPChannel) gZIPChannel).usable);
            assertNull("(GZIPChannel) gZIPChannel.logger", ((GZIPChannel) gZIPChannel).logger);
            assertNull("(GZIPChannel) gZIPChannel.originalRealm", ((GZIPChannel) gZIPChannel).originalRealm);
            assertNull("(GZIPChannel) gZIPChannel.realm", ((GZIPChannel) gZIPChannel).realm);
View Full Code Here

TOP

Related Classes of org.jpos.iso.channel.GZIPChannel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.