Package org.jpos.iso

Examples of org.jpos.iso.ISOMsg


  statefulFilter.setSpace((Space) null);
  statefulFilter.setMatchDirection(0);
  statefulFilter.setIgnoredFields((int[]) null);
  try {
      statefulFilter.filter(new CSChannel("testStatefulFilterHost", 100,
        new PostPackager()), new ISOMsg("testStatefulFilterMti"),
        new LogEvent());
      fail("Expected NullPointerException to be thrown");
  } catch (NullPointerException ex) {
      assertNull("ex.getMessage()", ex.getMessage());
  }
View Full Code Here


  statefulFilter.setMatchDirection(0);
  statefulFilter.setSavedFields((int[]) null);
  statefulFilter.setIgnoredFields((int[]) null);
  try {
      statefulFilter.filter(new CSChannel("testStatefulFilterHost", 100,
        new PostPackager()), new ISOMsg("testStatefulFilterMti"),
        new LogEvent());
      fail("Expected NullPointerException to be thrown");
  } catch (NullPointerException ex) {
      assertNull("ex.getMessage()", ex.getMessage());
  }
View Full Code Here

  statefulFilter.setKey(key);
  statefulFilter.setSpace((Space) null);
  try {
      statefulFilter.filter(new CSChannel("testStatefulFilterHost", 100,
        new GenericPackager()),
        new ISOMsg("testStatefulFilterMti"), new LogEvent(
          "testStatefulFilterTag", "testString"));
      fail("Expected NullPointerException to be thrown");
  } catch (NullPointerException ex) {
      assertNull("ex.getMessage()", ex.getMessage());
  }
View Full Code Here

  }
    }

    @Test
    public void testFilterThrowsNullPointerException4() throws Throwable {
  ISOMsg m = new ISOMsg(100);
  m.setDirection(100);
  StatefulFilter statefulFilter = new StatefulFilter();
  statefulFilter.setSpace((Space) null);
  statefulFilter.setMatchDirection(100);
  statefulFilter.setSavedFields((int[]) null);
  try {
View Full Code Here

    @Test
    public void testAnsweredMessage() throws Exception {
        mux.request(createMsg("000002"), 500L, this, "Handback Two");
        assertFalse("expired called too fast", expiredCalled);
        ISOMsg m = (ISOMsg) sp.in("send", 500L);
        assertNotNull("Message not received by pseudo-channel", m);
        assertNotNull("Space doesn't contain message key", getInternalSpace(mux).rdp("send.0800000000029110001000002.req"));
        m.setResponseMTI();
        sp.out("receive", m);
        Thread.sleep(100L);
        assertNotNull("Response not received", responseMsg);
        Thread.sleep(1000L);
        assertFalse("Response received but expired was called", expiredCalled);
View Full Code Here

        q2.shutdown(true);
        Thread.sleep(2000L);
    }

    private ISOMsg createMsg(String stan) throws ISOException {
        ISOMsg m = new ISOMsg("0800");
        m.set(11, stan);
        m.set(41, "29110001"); // our favourite test terminal
        return m;
    }
View Full Code Here

        String[] requests = new String[] { "0100", "0101", "0400", "0401", "0420", "0800", "1100", "1800", "1804", "1820", "1820",
                "1200", "1220", "1240" };
        String[] responses = new String[] { "0110", "0110", "0410", "0410", "0430", "0810", "1110", "1810", "1814", "1824", "1830",
                "1210", "1230", "1250" };
        assertEquals("Request/Response string arrays must hold same number of entries", requests.length, responses.length);
        ISOMsg request = new ISOMsg();
        ISOMsg response = new ISOMsg();
        for (int i = 0; i < requests.length; i++) {
            request.setMTI(requests[i]);
            request.set (11, Integer.toString(i));
            response.setMTI(responses[i]);
            response.set (11, Integer.toString(i));
            assertEquals(((QMUX) mux).getKey(request), ((QMUX) mux).getKey(response));
        }
    }
View Full Code Here

    @Test
    public void testSendThrowsIllegalArgumentException() throws Throwable {
        ChannelPool channelPool = new ChannelPool();
        channelPool.addChannel(new GZIPChannel("testChannelPoolHost", -1, new Base1SubFieldPackager()));
        try {
            channelPool.send((ISOMsg) new ISOMsg().clone());
            fail("Expected IllegalArgumentException to be thrown");
        } catch (IllegalArgumentException ex) {
            assertEquals("ex.getMessage()", "port out of range:-1", ex.getMessage());
            assertEquals("channelPool.pool.size()", 1, channelPool.pool.size());
            assertNull("channelPool.current", channelPool.current);
View Full Code Here

    @Test
    public void testSendThrowsIOException() throws Throwable {
        ChannelPool channelPool = new ChannelPool();
        try {
            channelPool.send(new ISOMsg());
            fail("Expected IOException to be thrown");
        } catch (IOException ex) {
            assertEquals("ex.getClass()", IOException.class, ex.getClass());
            assertEquals("channelPool.pool.size()", 0, channelPool.pool.size());
            assertNull("channelPool.current", channelPool.current);
View Full Code Here

        Logger logger = new Logger();
        logger.addListener(null);
        ChannelPool channelPool = new ChannelPool();
        channelPool.setLogger(logger, "testChannelPoolRealm");
        try {
            channelPool.send(new ISOMsg("testChannelPoolMti"));
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
            assertNull("channelPool.current", channelPool.current);
            assertEquals("channelPool.pool.size()", 0, channelPool.pool.size());
View Full Code Here

TOP

Related Classes of org.jpos.iso.ISOMsg

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.