SimpleModuleInterpreterActor extends AbstractModuleInterpreterActor { @Override void inPortHasSignal(int inPortId) { endAsynchronousAction(module.getInPorts().get(inPortId)); } private  SimpleModuleInterpreterActor(Factory factory); @Override void preStart(); @Override void postStop(); @Override void onReceive(Object message);  }
@Test public void inPortHasSignal() { try (ModuleInterpretation moduleInterpretation = testCaseBuilder("successfulExecution").build()) { Props props = moduleInterpretation.toSimpleModuleInterpreterProps(MODULE_ID, bitSetOf(0, 1), bitSetOf(0)); TestActorRef<SimpleModuleInterpreterActor> actorRef = TestActorRef.create( moduleInterpretation.getActorSystem(), props, moduleInterpretation.getSupervisor()); TestProbe executorProbe = moduleInterpretation.getExecutorProbe(); Assert.assertFalse(executorProbe.msgAvailable()); actorRef.receive(new InPortHasSignal(0)); Assert.assertFalse(executorProbe.msgAvailable()); actorRef.receive(new InPortHasSignal(1)); ExecuteTrace executeTraceMessage = executorProbe.expectMsgClass(ExecuteTrace.class); RuntimeStateProvider runtimeStateProvider = executeTraceMessage.getRuntimeStateProvider(); InstanceProvider instanceProvider = mock(InstanceProvider.class); RuntimeContext restoredRuntimeContext = await(runtimeStateProvider.provideRuntimeContext(instanceProvider)); Assert.assertSame(restoredRuntimeContext.getRepository(), repository); SimpleModuleExecutorResult executionResult = new SimpleModuleExecutorResult.Builder( Name.qualifiedName(SimpleModuleExecutorResult.class.getName())) .build(); actorRef.receive(executionResult); TestProbe parentProbe = moduleInterpretation.getParentProbe(); parentProbe.expectMsg(new SubmoduleOutPortHasSignal(MODULE_ID, 0)); parentProbe.watch(actorRef); parentProbe.expectMsgClass(Terminated.class); Assert.assertFalse(parentProbe.msgAvailable()); } }