Package org.asmatron.messengine.testing.support

Examples of org.asmatron.messengine.testing.support.TestActionDelegate


public class TestDefaultCommandEngine {
  public static final ActionId<DemoCommandObject> cType = new ActionId<DemoCommandObject>("c");

  @Test
  public void testeamesta() throws Exception {
    DefaultActionDelegate engine = new TestActionDelegate();
    final AtomicBoolean handled = new AtomicBoolean(false);

    engine.addActionHandler(cType, new ActionHandler<DemoCommandObject>() {
      @Override
      public void handle(DemoCommandObject arg) {
        handled.set(true);
      }
    });
    engine.send(cType.create(new DemoCommandObject()));
    assertTrue(handled.get());
  }
View Full Code Here


    assertTrue(handled.get());
  }

  @Test(expected = DuplicateActionHandlerException.class)
  public void shouldNotAddTwoHandlers() throws Exception {
    DefaultActionDelegate engine = new TestActionDelegate();

    engine.addActionHandler(cType, new ActionHandler<DemoCommandObject>() {
      @Override
      public void handle(DemoCommandObject arg) {
      }
    });
    engine.addActionHandler(cType, new ActionHandler<DemoCommandObject>() {
      @Override
      public void handle(DemoCommandObject arg) {
      }
    });
  }
View Full Code Here

    }
    return messagingConfigurator;
  }

  public TestEngine() {
    super(new TestActionDelegate(), new TestEventDelegate(), new TestMessagingDelegate(), new TestModelDelegate());
    start();
  }
View Full Code Here

TOP

Related Classes of org.asmatron.messengine.testing.support.TestActionDelegate

Copyright © 2018 www.massapicom. 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.