@Test public void testFilter2() throws Throwable { DelayFilter delayFilter = new DelayFilter(-1); ISOChannel channel = new PADChannel(new CTCSubFieldPackager()); LogEvent evt = new LogEvent("testDelayFilterTag", ""); ISOMsg result = delayFilter.filter(channel, m, evt); assertEquals(2, evt.getPayLoad().size(), "evt.payLoad.size()"); assertEquals("<delay-filter delay=\"-1\"/>", evt.getPayLoad().get(1), "evt.payLoad.get(1)"); assertSame(m, result, "result"); }
public ISOMsg filter (ISOChannel channel, ISOMsg m, LogEvent evt) { evt.addMessage ("<delay-filter delay=\""+delay+"\"/>"); if (delay > 0) { try { Thread.sleep (delay); } catch (InterruptedException e) { } } return m; }
DelayFilter implements ISOFilter, Configurable { public ISOMsg filter (ISOChannel channel, ISOMsg m, LogEvent evt) { evt.addMessage ("<delay-filter delay=\""+delay+"\"/>"); if (delay > 0) { try { Thread.sleep (delay); } catch (InterruptedException e) { } } return m; } }
DelayFilter implements ISOFilter, Configurable { public ISOMsg filter (ISOChannel channel, ISOMsg m, LogEvent evt) { evt.addMessage ("<delay-filter delay=\""+delay+"\"/>"); if (delay > 0) { try { Thread.sleep (delay); } catch (InterruptedException e) { } } return m; } DelayFilter();  DelayFilter(int delay); }
DelayFilter implements ISOFilter, Configurable { public ISOMsg filter (ISOChannel channel, ISOMsg m, LogEvent evt) { evt.addMessage ("<delay-filter delay=\""+delay+"\"/>"); if (delay > 0) { try { Thread.sleep (delay); } catch (InterruptedException e) { } } return m; } DelayFilter();  DelayFilter(int delay); void setConfiguration(Configuration cfg); ISOMsg filter(ISOChannel channel, ISOMsg m, LogEvent evt); }
DelayFilter implements ISOFilter, Configurable { public ISOMsg filter (ISOChannel channel, ISOMsg m, LogEvent evt) { evt.addMessage ("<delay-filter delay=\""+delay+"\"/>"); if (delay > 0) { try { Thread.sleep (delay); } catch (InterruptedException e) { } } return m; } DelayFilter();  DelayFilter(int delay); void setConfiguration(Configuration cfg); ISOMsg filter(ISOChannel channel, ISOMsg m, LogEvent evt);  }