List of usage examples for org.springframework.context.support StaticApplicationContext addApplicationListener
@Override
public void addApplicationListener(ApplicationListener<?> listener)
From source file:com.bbytes.zorba.jobworker.event.JobEventTest.java
@Test public void testEventPublishAndListener() { JobEvent jobEvent = new JobEvent("testid", JobStatusType.STARTED, null, "Test event"); StaticApplicationContext context = new StaticApplicationContext(); context.addApplicationListener(this); context.refresh();/* w ww .j a v a 2 s.co m*/ context.publishEvent(jobEvent); }