public BacklogItem(ActorInitializer anInitializer) { super(anInitializer.address(), anInitializer.registry()); this.story = anInitializer.getParameter("story"); this.summary = anInitializer.getParameter("summary"); ActorAgent product = anInitializer.getParameter("product"); this.product = product.address(); product.tell(new BacklogItemPlanned(product.address(), this.self().address())); }
/** * @see co.vaughnvernon.actormodel.actor.ActorRegistry#deregister(co.vaughnvernon.actormodel.actor.ActorAgent) */ @Override public void deregister(ActorAgent anActorAgent) { Class<? extends Actor> actorType = this.actorTypeFor(anActorAgent.actorType()); if (actorType != null) { this.removeActor(actorType, anActorAgent.address()); } }
@Override public void run() { for ( ; askCount < 1000000 && !this.closed; ) { agent.ask(new TestMessage(), this.futureInterest); ++askCount; } } }
@Override public void run() { while (!this.closed) { agent.tell(new TestRawThroughputCommand()); ++messageCount; } } }
public void testExecuteWhenMessage() throws Exception { System.out.println("testExecuteMessage()"); ActorAgent agent = actorRegistry.actorFor(TestAggregateActor.class); assertNotNull(agent); agent.tell(new TestMessage()); this.stayAlive(200); }
public Sprint(ActorInitializer anInitializer) { super(anInitializer.address(), anInitializer.registry()); this.begins = anInitializer.getParameter("begins"); this.committedBacklogItems = new HashSet<Address>(); this.ends = anInitializer.getParameter("ends"); this.goals = anInitializer.getParameter("goals"); this.name = anInitializer.getParameter("name"); ActorAgent product = anInitializer.getParameter("product"); this.product = product.address(); product.tell(new SprintScheduled(product.address(), this.self().address())); }
public void testExecuteEvent() throws Exception { System.out.println("testExecuteEvent()"); ActorAgent agent = actorRegistry.actorFor(TestActor.class); assertNotNull(agent); agent.tell(new TestEvent()); this.stayAlive(200); }
public MessageInfo( ActorAgent aFromAgent, ActorAgent aToAgent, Message aMessage, boolean isAsking) { super(); this.setFromAddress(aFromAgent.address().address()); this.setFromActorType(aFromAgent.actorType()); this.setToAddress(aToAgent.address().address()); this.setToActorType(aToAgent.actorType()); this.setMessageType(aMessage.getClass().getName()); this.setAsking(isAsking); }
public void testExecuteAsk() throws Exception { System.out.println("testExecuteAsk()"); ActorAgent agent = actorRegistry.actorFor(TestActor.class); assertNotNull(agent); agent.ask(new TestMessage(), new FutureInterest() { @Override public void completedWith(Future aFuture) { completed = true; System.out.println("Future completed with: " + aFuture.value()); } @Override public void timedOut(Future aFuture) { completed = false; System.out.println("Timed out"); } }); this.stayAlive(500L); assertTrue(completed); }
public void testExecuteMessage() throws Exception { System.out.println("testExecuteMessage()"); ActorAgent agent = actorRegistry.actorFor(TestActor.class); assertNotNull(agent); agent.tell(new TestMessage()); this.stayAlive(200); }
public void testExecuteCommand() throws Exception { System.out.println("testExecuteCommand()"); ActorAgent agent = actorRegistry.actorFor(TestActor.class); assertNotNull(agent); agent.tell(new TestCommand()); this.stayAlive(500); }
public void testExecuteWhenCommand() throws Exception { System.out.println("testExecuteCommand()"); ActorAgent agent = actorRegistry.actorFor(TestAggregateActor.class); assertNotNull(agent); agent.tell(new TestCommand()); this.stayAlive(100); }
public void testExecuteWhenEvent() throws Exception { System.out.println("testExecuteEvent()"); ActorAgent agent = actorRegistry.actorFor(TestAggregateActor.class); assertNotNull(agent); agent.tell(new TestEvent()); this.stayAlive(200); }
public void when(CommitTo aCommand) { this.sprint = aCommand.sprint(); ActorAgent sprint = this.registry().actorRegisteredAs(Sprint.class, this.sprint); sprint.tell(new BacklogItemCommitted(this.product, this.address(), this.sprint)); }
public void testProductPlanBacklogItem() throws Exception { ActorInitializer initializer = new ActorInitializer(this.actorRegistry); initializer.putParameter("name", "Test Product"); initializer.putParameter("description", "A decsription."); ActorAgent product = this.actorRegistry.actorFor(Product.class, initializer); product.tell(new PlanBacklogItem( "A summary of the backlog item.", "A story about the backlog item.")); this.stayAlive(); this.actorRegistry.expectedMessages(2); this.actorRegistry.expectedMessage(PlanBacklogItem.class); this.actorRegistry.expectedMessage(BacklogItemPlanned.class); }
public void testProductScheduleSprint() throws Exception { ActorInitializer initializer = new ActorInitializer(this.actorRegistry); initializer.putParameter("name", "Test Product"); initializer.putParameter("description", "A decsription."); ActorAgent product = this.actorRegistry.actorFor(Product.class, initializer); product.tell(new ScheduleSprint( "Sprint 1", "The initial sprint.", this.daysFromNow(1), this.daysFromNow(15))); this.stayAlive(); this.actorRegistry.expectedMessages(2); this.actorRegistry.expectedMessage(ScheduleSprint.class); this.actorRegistry.expectedMessage(SprintScheduled.class); }