Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
Update the code due to the changes applied in the BIC (issue sarl/sar…
Browse files Browse the repository at this point in the history
  • Loading branch information
gallandarakhneorg committed May 15, 2014
1 parent 8f20529 commit 647d6fe
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void agentSpawned(AgentContext parent, Agent iAgentID,
}

Initialize init = new Initialize();
init.setParameters(initializationParameters);
init.parameters = initializationParameters;
this.eventBusCapacity.selfEvent(init);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public void createSpace() {
ArgumentCaptor<Event> argument3 = ArgumentCaptor.forClass(Event.class);
Mockito.verify(defSpace, new Times(1)).emit(argument3.capture());
assertThat(argument3.getValue(), new IsInstanceOf(SpaceCreated.class));
assertEquals(id, ((SpaceCreated)argument3.getValue()).getSpaceID().getID());
assertEquals(id, ((SpaceCreated)argument3.getValue()).spaceID.getID());
}

@Test
Expand Down Expand Up @@ -277,7 +277,7 @@ public void getOrCreateSpace() {
ArgumentCaptor<Event> argument3 = ArgumentCaptor.forClass(Event.class);
Mockito.verify(defSpace, new Times(1)).emit(argument3.capture());
assertThat(argument3.getValue(), new IsInstanceOf(SpaceCreated.class));
assertEquals(id, ((SpaceCreated)argument3.getValue()).getSpaceID().getID());
assertEquals(id, ((SpaceCreated)argument3.getValue()).spaceID.getID());
//
OpenEventSpace space2 = this.context.getOrCreateSpace(OpenEventSpaceSpecification.class, id);
assertSame(space, space2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ public void spawn() {
ArgumentCaptor<Event> argument4 = ArgumentCaptor.forClass(Event.class);
Mockito.verify(this.defaultSpace, new Times(1)).emit(argument4.capture());
assertTrue(argument4.getValue() instanceof AgentSpawned);
assertSame(agentId, ((AgentSpawned)argument4.getValue()).getAgentID());
assertEquals(ag.getClass().getName(), ((AgentSpawned)argument4.getValue()).getAgentType());
assertSame(agentId, ((AgentSpawned)argument4.getValue()).agentID);
assertEquals(ag.getClass().getName(), ((AgentSpawned)argument4.getValue()).agentType);
}

@Test
Expand Down Expand Up @@ -236,7 +236,7 @@ public void killAgent() throws AgentKillException {
ArgumentCaptor<Event> argument5 = ArgumentCaptor.forClass(Event.class);
Mockito.verify(this.defaultSpace, new Times(2)).emit(argument5.capture());
assertTrue(argument5.getValue() instanceof AgentKilled);
assertEquals(agentId, ((AgentKilled)argument5.getValue()).getAgentID());
assertEquals(agentId, ((AgentKilled)argument5.getValue()).agentID);
//
Mockito.verify(this.kernelListener, new Times(1)).kernelAgentDestroy();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,17 @@ public void join() {
Event evt = argument1.getValue();
assertNotNull(evt);
assertTrue(evt instanceof MemberJoined);
assertEquals(c.getID(), ((MemberJoined)evt).getParentContextID());
assertEquals(this.agent.getID(), ((MemberJoined)evt).getAgentID());
assertEquals(c.getID(), ((MemberJoined)evt).parentContextID);
assertEquals(this.agent.getID(), ((MemberJoined)evt).agentID);
//
ArgumentCaptor<Event> argument2 = ArgumentCaptor.forClass(Event.class);
++nb;
Mockito.verify(this.behaviorCapacity, new Times(nb)).wake(argument2.capture());
evt = argument2.getValue();
assertNotNull(evt);
assertTrue(evt instanceof ContextJoined);
assertEquals(c.getID(), ((ContextJoined)evt).getHolonContextID());
assertEquals(c.getDefaultSpace().getID().getID(), ((ContextJoined)evt).getDefaultSpaceID());
assertEquals(c.getID(), ((ContextJoined)evt).holonContextID);
assertEquals(c.getDefaultSpace().getID().getID(), ((ContextJoined)evt).defaultSpaceID);
}
Collection<AgentContext> c = this.skill.getAllContexts();
assertEquals(this.contexts.size(), c.size());
Expand Down Expand Up @@ -231,7 +231,7 @@ public void leave() {
Event evt = argument1.getValue();
assertNotNull(evt);
assertTrue(evt instanceof MemberLeft);
assertEquals(this.agent.getID(), ((MemberLeft)evt).getAgentID());
assertEquals(this.agent.getID(), ((MemberLeft)evt).agentID);
//
ArgumentCaptor<Event> argument2 = ArgumentCaptor.forClass(Event.class);
++nb;
Expand All @@ -240,7 +240,7 @@ public void leave() {
evt = argument2.getValue();
assertNotNull(evt);
assertTrue(evt instanceof ContextLeft);
assertEquals(c.getID(), ((ContextLeft)evt).getHolonContextID());
assertEquals(c.getID(), ((ContextLeft)evt).holonContextID);
}
assertTrue(remaining.isEmpty());
}
Expand Down

0 comments on commit 647d6fe

Please sign in to comment.