Package papaya.tests

Source Code of papaya.tests.EventBusTests

/**
*
*/
package papaya.tests;

import java.util.ArrayList;

import papaya.collections.Collections;
import papaya.event.Event;
import papaya.event.EventBus;
import papaya.event.EventBus.EventSubscribed;
import papaya.logging.LogWrapper;

/**
* This class was created as part of the PapayaUtils project. </br> </br>
* Get the source code of this file on Bitbucket : </br>
* bitbucket.org/systembenders/benders </br> </br>
*
* PapayaUtils is distribuited under a GNU Lesser General Public License. </br>
* (https://www.gnu.org/licenses/lgpl.html)
* @author matheus
*
*/
public class EventBusTests {
  static EventBus bus = new EventBus(new ArrayList<Class<?>>());
 
  static LogWrapper testLogWrapper = new LogWrapper("Tests");
  public static void main(String[] args) {
     bus.register(EventBusTests.class);
     try {
      bus.post(new Event(Collections.class, "dummy_event",new int[]{1,2,3},1,2,3,'a','b'));
    } catch( Exception e) {
      e.printStackTrace();
    }
  }
 
  @EventSubscribed
  public void onEvent(Event e) {
      testLogWrapper.info("[Dummy1]%s",e.toString(true));
  }
 
  @EventSubscribed
  public void onEvent2(Event e) {
    testLogWrapper.info("[Dummy2]%s",e.toString(true));
  }
 
  @EventSubscribed
  public void onEvent3(Event e) {
    testLogWrapper.info("[Dummy3]%s",e.toString(true));
  }
 
  @EventSubscribed
  public void onEvent4(Event e) {
    testLogWrapper.info("[Dummy4]%s",e.toString(true));
  }
  @EventSubscribed
  public void onEvent5(Event e) {
    testLogWrapper.info("[Dummy5]%s",e.toString(true));
  }
 
}
TOP

Related Classes of papaya.tests.EventBusTests

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.