Example usage for org.springframework.context.support GenericApplicationContext publishEvent

List of usage examples for org.springframework.context.support GenericApplicationContext publishEvent

Introduction

In this page you can find the example usage for org.springframework.context.support GenericApplicationContext publishEvent.

Prototype

@Override
public void publishEvent(ApplicationEvent event) 

Source Link

Document

Publish the given event to all listeners.

Usage

From source file:net.sourceforge.vulcan.spring.AppCtxTest.java

public void testChildDoesNotReceiveFromParent() throws Exception {
    GenericApplicationContext parent = new GenericApplicationContext();
    parent.refresh();/*from   ww w .j  a  v a  2  s .  c om*/
    ac.setParent(parent);

    assertNotSame(evt, received);

    parent.publishEvent(evt);

    assertNotSame(evt, received);
}

From source file:net.sourceforge.vulcan.spring.AppCtxTest.java

public void testParentReceivesFromChild() throws Exception {
    GenericApplicationContext child = new GenericApplicationContext();
    child.setParent(this.ac);
    child.refresh();//from w ww  .ja  v  a  2s.  c o m

    assertNotSame(evt, received);

    child.publishEvent(evt);

    assertSame(evt, received);
}