Examples of NACChannel


Examples of org.jpos.iso.channel.NACChannel

    try {
      POS2000Packager packager = new POS2000Packager();
      byte[] tpdu = { 0x60, 0x00, 0x00, 0x00, 0x00 }; // TPDU Desarrollo

      nacChannel = new NACChannel(host, port, packager, tpdu);
      nacChannel.connect();
      nacChannel.setTimeout(timeout);
    } catch (FileNotFoundException e) {
      logger.error(channelName + "|No se pudo levantar el puerto " + port + ": " + e.getMessage() + " |");
    } catch (IOException e) {
View Full Code Here

Examples of org.jpos.iso.channel.NACChannel

    table = new TimeoutHashMap<MessageID, ISOSource>(timeout);
    messageIDInfo = new MessageIDInfo(element);
    Properties properties = new Properties();

    POS2000Packager packager = new POS2000Packager();
    NACChannel channel = new NACChannel();
    byte[] tpdu = {0x60, 0x00, 0x00, 0x00, 0x00}; //TPDU Desarrollo
   
    channel.setHeader( tpdu );
    try {
      properties.load(this.getClass().getResourceAsStream("/conf/authorizer.properties"));
      channel.setPackager(packager);
      channel.setTimeout(timeout);
     
      server = new ISOServer(port, channel, null);
      server.setConfiguration(new SimpleConfiguration());
      server.addISORequestListener(this);
      new Thread(server).start();
View Full Code Here

Examples of org.jpos.iso.channel.NACChannel

    @Test
    public void testFilter5() throws Throwable {
        MacroFilter macroFilter = new MacroFilter();
        LogEvent evt = new LogEvent();
        ISOChannel channel = new NACChannel();

        when(m.getMaxField()).thenReturn(0);
        when(m.hasField(0)).thenReturn(true);
        when(m.getValue(0)).thenReturn("N/A in Composite");
View Full Code Here

Examples of org.jpos.iso.channel.NACChannel

        assertSame("process.source", source, process.source);
    }

    @Test
    public void testProcessRunThrowsNullPointerException() throws Throwable {
        ISOSource source = new NACChannel();
        Connector.Process process = new Connector().new Process(source, null);
        try {
            process.run();
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
View Full Code Here

Examples of org.jpos.iso.channel.NACChannel

    @Test
    public void testFilter1() throws Throwable {
  ISOMsg m = new ISOMsg("testStatefulFilterMti");
  m.setDirection(1);
  ISOMsg result = new StatefulFilter().filter(new NACChannel(), m,
    new LogEvent());
  assertSame("result", m, result);
    }
View Full Code Here

Examples of org.jpos.iso.channel.NACChannel

    }

    @Test
    public void testFilterThrowsNullPointerException() throws Throwable {
        try {
            new DelayFilter(0).filter(new NACChannel(), new ISOMsg("testDelayFilterMti"), null);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
        }
    }
View Full Code Here

Examples of org.jpos.iso.channel.NACChannel

        assertSame("(RawChannel) rawChannel.packager", p, ((RawChannel) rawChannel).packager);
    }

    @Test
    public void testCreateMsgThrowsNullPointerException() throws Throwable {
        BaseChannel nACChannel = new NACChannel();
        try {
            nACChannel.createMsg();
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
            assertNull("(NACChannel) nACChannel.packager", ((NACChannel) nACChannel).packager);
        }
View Full Code Here

Examples of org.jpos.iso.channel.NACChannel

        }
    }

    @Test
    public void testGetCounters() throws Throwable {
        int[] result = new NACChannel().getCounters();
        assertEquals("result.length", 3, result.length);
        assertEquals("result[0]", 0, result[0]);
    }
View Full Code Here

Examples of org.jpos.iso.channel.NACChannel

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

    @Test
    public void testGetDynamicPackager1() throws Throwable {
        BaseChannel nACChannel = new NACChannel();
        ISOPackager p = new ISO87APackagerBBitmap();
        nACChannel.setPackager(p);
        byte[] image = new byte[1];
        ISOPackager result = nACChannel.getDynamicPackager(image);
        assertSame("result", p, result);
    }
View Full Code Here

Examples of org.jpos.iso.channel.NACChannel

        }
    }

    @Test
    public void testReadHeaderThrowsNegativeArraySizeException() throws Throwable {
        BaseChannel nACChannel = new NACChannel();
        try {
            nACChannel.readHeader(-1);
            fail("Expected NegativeArraySizeException to be thrown");
        } catch (NegativeArraySizeException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
            assertNull("(NACChannel) nACChannel.serverIn", ((NACChannel) nACChannel).serverIn);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.