@Test public void objectNotInvoked() throws Exception { observers.fireEvent(new Color()); assertEvent(BasicObserver.color); }
public void fireEvent(final Object event) { if (event == null) { throw new IllegalArgumentException("event cannot be null"); } for (final Observer observer : observers) { try { observer.invoke(event); } catch (InvocationTargetException e) { final Throwable t = e.getTargetException() == null ? e : e.getTargetException(); if (e.getTargetException() != null) { logger.log(Level.WARNING, "Observer method invocation failed", t); } } catch (IllegalAccessException e) { e.printStackTrace(); } } }
Observers { public void fireEvent(final Object event) { if (event == null) { throw new IllegalArgumentException("event cannot be null"); } for (final Observer observer : observers) { try { observer.invoke(event); } catch (InvocationTargetException e) { final Throwable t = e.getTargetException() == null ? e : e.getTargetException(); if (e.getTargetException() != null) { logger.log(Level.WARNING, "Observer method invocation failed", t); } } catch (IllegalAccessException e) { e.printStackTrace(); } } } }
Observers { public void fireEvent(final Object event) { if (event == null) { throw new IllegalArgumentException("event cannot be null"); } for (final Observer observer : observers) { try { observer.invoke(event); } catch (InvocationTargetException e) { final Throwable t = e.getTargetException() == null ? e : e.getTargetException(); if (e.getTargetException() != null) { logger.log(Level.WARNING, "Observer method invocation failed", t); } } catch (IllegalAccessException e) { e.printStackTrace(); } } }  }
Observers { public void fireEvent(final Object event) { if (event == null) { throw new IllegalArgumentException("event cannot be null"); } for (final Observer observer : observers) { try { observer.invoke(event); } catch (InvocationTargetException e) { final Throwable t = e.getTargetException() == null ? e : e.getTargetException(); if (e.getTargetException() != null) { logger.log(Level.WARNING, "Observer method invocation failed", t); } } catch (IllegalAccessException e) { e.printStackTrace(); } } }  boolean addObserver(final Object observer); boolean removeObserver(final Object listener); void fireEvent(final Object event); }
Observers { public void fireEvent(final Object event) { if (event == null) { throw new IllegalArgumentException("event cannot be null"); } for (final Observer observer : observers) { try { observer.invoke(event); } catch (InvocationTargetException e) { final Throwable t = e.getTargetException() == null ? e : e.getTargetException(); if (e.getTargetException() != null) { logger.log(Level.WARNING, "Observer method invocation failed", t); } } catch (IllegalAccessException e) { e.printStackTrace(); } } }  boolean addObserver(final Object observer); boolean removeObserver(final Object listener); void fireEvent(final Object event);  }