Package org.seattlegamer.spacegame.core

Examples of org.seattlegamer.spacegame.core.BusImpl


public class ComponentTests {

  @Test
  public void toStringHasClassName() {
    Bus bus = new BusImpl();
    Component component = new TestComponent(bus, UUID.randomUUID());
    String string = component.toString();
    assertEquals("TestComponent", string);
  }
View Full Code Here


    int scale = propertiesAccessor.getInteger("scale", 80);
    return new ScaledImageResourceLoader(scale);
  }
 
  public @Bean Bus bus() {
    return new BusImpl();
  }
View Full Code Here

public class BusImplTests {

  @Test
  public void canSendToSpecificEntityId() {
   
    BusImpl bus = new BusImpl();
   
    UUID entityId = UUID.randomUUID();
   
    Foo fooOne = new Foo(bus, entityId);
    Foo fooTwo = new Foo(bus, UUID.randomUUID());
   
    bus.register(fooOne, entityId);
    bus.send("blah", entityId);
   
    assertEquals("blah", fooOne.fooValue);
    assertEquals(null, fooTwo.fooValue);

  }
View Full Code Here

  }
 
  @Test
  public void canRegisterAndDeregisterComponentsWithBus() {
   
    Bus bus = new BusImpl();
   
    UUID entityId = UUID.randomUUID();
   
    Foo fooOne = new Foo(bus, entityId);
   
    bus.register(fooOne, entityId);
    bus.send("blah", entityId);
   
    assertEquals("blah", fooOne.fooValue);
    fooOne.fooValue = null;

    bus.deregister(fooOne, entityId);
   
    assertEquals(null, fooOne.fooValue);

  }
View Full Code Here

  }
 
  @Test
  public void unsubscribedMessagesBroadcastNowhereSilently() {
   
    Bus bus = new BusImpl();
    bus.broadcast("buzz");
   
  }
View Full Code Here

  }
 
  @Test
  public void registrationsTakeIntoAccountSuperClass() {
   
    Bus bus = new BusImpl();
   
    UUID entityId = UUID.randomUUID();
   
    Bar bar = new Bar(bus, entityId);
   
    bus.register(bar, entityId);
    bus.broadcast("blah");
   
    assertEquals("blah", bar.fooValue);
    assertEquals("blah", bar.barValue);

  }
View Full Code Here

public class GameLauncherTests {

  @Test
  public void newGameCreatedWithPlayersFromManifest() throws IOException {
   
    Bus bus = new BusImpl();
    //TODO: use Mockito for dependencies
    ResourceCache resourceCache = new ResourceCache() {
      @Override public void putImage(String name, Object asset) {}
      @Override public Image getImage(String name) throws IOException { return null; }
    };
View Full Code Here

TOP

Related Classes of org.seattlegamer.spacegame.core.BusImpl

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.