@Test public void testFilterThrowsNullPointerException() throws Throwable { MacroFilter macroFilter = new MacroFilter(); LogEvent evt = new LogEvent(); try { macroFilter.filter(new PADChannel("testMacroFilterHost", 100, new XMLPackager()), null, evt); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"org.jpos.iso.ISOMsg.getMaxField()\" because \"m\" is null", ex.getMessage(), "ex.getMessage()"); } assertNull(macroFilter.cfg, "macroFilter.cfg"); assertNull(macroFilter.seq, "macroFilter.seq"); } }
public ISOMsg filter (ISOChannel channel, ISOMsg m, LogEvent evt) throws VetoException { try { applyProps (m); if (validFields.length > 0) m = m.clone (validFields); if (unsetFields.length > 0) m.unset (unsetFields); } catch (ISOException e) { evt.addMessage (e); throw new VetoException (e); } return m; }
MacroFilter implements ISOFilter, Configurable { public ISOMsg filter (ISOChannel channel, ISOMsg m, LogEvent evt) throws VetoException { try { applyProps (m); if (validFields.length > 0) m = m.clone (validFields); if (unsetFields.length > 0) m.unset (unsetFields); } catch (ISOException e) { evt.addMessage (e); throw new VetoException (e); } return m; } }
MacroFilter implements ISOFilter, Configurable { public ISOMsg filter (ISOChannel channel, ISOMsg m, LogEvent evt) throws VetoException { try { applyProps (m); if (validFields.length > 0) m = m.clone (validFields); if (unsetFields.length > 0) m.unset (unsetFields); } catch (ISOException e) { evt.addMessage (e); throw new VetoException (e); } return m; } MacroFilter(); }
MacroFilter implements ISOFilter, Configurable { public ISOMsg filter (ISOChannel channel, ISOMsg m, LogEvent evt) throws VetoException { try { applyProps (m); if (validFields.length > 0) m = m.clone (validFields); if (unsetFields.length > 0) m.unset (unsetFields); } catch (ISOException e) { evt.addMessage (e); throw new VetoException (e); } return m; } MacroFilter(); void setConfiguration(Configuration cfg); ISOMsg filter(ISOChannel channel, ISOMsg m, LogEvent evt); }
MacroFilter implements ISOFilter, Configurable { public ISOMsg filter (ISOChannel channel, ISOMsg m, LogEvent evt) throws VetoException { try { applyProps (m); if (validFields.length > 0) m = m.clone (validFields); if (unsetFields.length > 0) m.unset (unsetFields); } catch (ISOException e) { evt.addMessage (e); throw new VetoException (e); } return m; } MacroFilter(); void setConfiguration(Configuration cfg); ISOMsg filter(ISOChannel channel, ISOMsg m, LogEvent evt);  }