test_class.declarator: inBuffer
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private InBuffer inBuffer;
test_class.type: InBuffer
test_class.var_name: inBuffer
test_class.declarator: queueDispatcher
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private QueueDispatcherService queueDispatcher;
test_class.type: QueueDispatcherService
test_class.var_name: queueDispatcher
test_class.declarator: workerManager
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private WorkerManager workerManager;
test_class.type: WorkerManager
test_class.var_name: workerManager
test_class.declarator: simpleExecutionRunnableFactory
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private SimpleExecutionRunnableFactory simpleExecutionRunnableFactory;
test_class.type: SimpleExecutionRunnableFactory
test_class.var_name: simpleExecutionRunnableFactory
test_class.declarator: outBuffer
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private OutboundBuffer outBuffer;
test_class.type: OutboundBuffer
test_class.var_name: outBuffer
test_class.declarator: recoveryManager
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private WorkerRecoveryManagerImpl recoveryManager;
test_class.type: WorkerRecoveryManagerImpl
test_class.var_name: recoveryManager
test_class.declarator: synchronizationManager
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private SynchronizationManager synchronizationManager;
test_class.type: SynchronizationManager
test_class.var_name: synchronizationManager
test_class.declarator: workerStateUpdateService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private WorkerStateUpdateService workerStateUpdateService;
test_class.type: WorkerStateUpdateService
test_class.var_name: workerStateUpdateService
test_class.declarator: workerConfigurationUtils
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private WorkerConfigurationUtils workerConfigurationUtils;
test_class.type: WorkerConfigurationUtils
test_class.var_name: workerConfigurationUtils
test_class.file: worker/worker-manager/score-worker-manager-impl/src/test/java/io/cloudslang/worker/management/services/InBufferTest.java
test_class.identifier: InBufferTest
test_case.body: @Test(timeout = 5000)
      public void testRunBeforeCtxClosedEvent() throws Exception {
          ContextRefreshedEvent refreshEvent = mock(ContextRefreshedEvent.class);
          inBuffer.onApplicationEvent(refreshEvent);
  
          ContextClosedEvent event = mock(ContextClosedEvent.class);
          when(workerManager.isUp()).thenReturn(true);
          doReturn(true).when(workerStateUpdateService).isWorkerEnabled();
          Thread thread = new Thread(inBuffer);
          thread.start();
  
          verify(workerManager, timeout(1000).atLeastOnce()).getInBufferSize();
  
          inBuffer.onApplicationEvent(event);
          while (thread.isAlive()) {
              Thread.sleep(100L);
          }
      }
test_case.class_method_signature: InBufferTest.testRunBeforeCtxClosedEvent()
test_case.full_signature: @Test(timeout = 5000) public void testRunBeforeCtxClosedEvent()
test_case.identifier: testRunBeforeCtxClosedEvent
test_case.invocations: mock onApplicationEvent mock thenReturn when isUp isWorkerEnabled when doReturn start getInBufferSize verify atLeastOnce timeout onApplicationEvent isAlive sleep
test_case.modifiers: @Test(timeout = 5000) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRunBeforeCtxClosedEvent()
focal_class.declarator: logger = Logger.getLogger(InBuffer.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = Logger.getLogger(InBuffer.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: MINIMUM_GC_DELTA = 10000
focal_class.modifier: private static final
focal_class.original_string: private static final int MINIMUM_GC_DELTA = 10000;
focal_class.type: int
focal_class.var_name: MINIMUM_GC_DELTA
focal_class.declarator: queueDispatcher
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private QueueDispatcherService queueDispatcher;
focal_class.type: QueueDispatcherService
focal_class.var_name: queueDispatcher
focal_class.declarator: workerUuid
focal_class.modifier: @Resource
      private
focal_class.original_string: @Resource
      private String workerUuid;
focal_class.type: String
focal_class.var_name: workerUuid
focal_class.declarator: capacity
focal_class.modifier: @Autowired
      @Qualifier("inBufferCapacity")
      private
focal_class.original_string: @Autowired
      @Qualifier("inBufferCapacity")
      private Integer capacity;
focal_class.type: Integer
focal_class.var_name: capacity
focal_class.declarator: coolDownPollingMillis = 200
focal_class.modifier: @Autowired(required = false)
      @Qualifier("coolDownPollingMillis")
      private
focal_class.original_string: @Autowired(required = false)
      @Qualifier("coolDownPollingMillis")
      private Integer coolDownPollingMillis = 200;
focal_class.type: Integer
focal_class.var_name: coolDownPollingMillis
focal_class.declarator: workerManager
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private WorkerManager workerManager;
focal_class.type: WorkerManager
focal_class.var_name: workerManager
focal_class.declarator: simpleExecutionRunnableFactory
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private SimpleExecutionRunnableFactory simpleExecutionRunnableFactory;
focal_class.type: SimpleExecutionRunnableFactory
focal_class.var_name: simpleExecutionRunnableFactory
focal_class.declarator: outBuffer
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private OutboundBuffer outBuffer;
focal_class.type: OutboundBuffer
focal_class.var_name: outBuffer
focal_class.declarator: syncManager
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private SynchronizationManager syncManager;
focal_class.type: SynchronizationManager
focal_class.var_name: syncManager
focal_class.declarator: numberOfThreads
focal_class.modifier: @Autowired
      @Qualifier("numberOfExecutionThreads")
      private
focal_class.original_string: @Autowired
      @Qualifier("numberOfExecutionThreads")
      private Integer numberOfThreads;
focal_class.type: Integer
focal_class.var_name: numberOfThreads
focal_class.declarator: executionsActivityListener
focal_class.modifier: @Autowired(required = false)
      private
focal_class.original_string: @Autowired(required = false)
      private ExecutionsActivityListener executionsActivityListener;
focal_class.type: ExecutionsActivityListener
focal_class.var_name: executionsActivityListener
focal_class.declarator: workerConfigurationUtils
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private WorkerConfigurationUtils workerConfigurationUtils;
focal_class.type: WorkerConfigurationUtils
focal_class.var_name: workerConfigurationUtils
focal_class.declarator: workerStateUpdateService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private WorkerStateUpdateService workerStateUpdateService;
focal_class.type: WorkerStateUpdateService
focal_class.var_name: workerStateUpdateService
focal_class.declarator: fillBufferThread = new Thread(this)
focal_class.modifier: private
focal_class.original_string: private Thread fillBufferThread = new Thread(this);
focal_class.type: Thread
focal_class.var_name: fillBufferThread
focal_class.declarator: inShutdown
focal_class.modifier: private
focal_class.original_string: private boolean inShutdown;
focal_class.type: boolean
focal_class.var_name: inShutdown
focal_class.declarator: endOfInit = false
focal_class.modifier: private
focal_class.original_string: private boolean endOfInit = false;
focal_class.type: boolean
focal_class.var_name: endOfInit
focal_class.declarator: gcTimer = System.currentTimeMillis()
focal_class.modifier: private
focal_class.original_string: private long gcTimer = System.currentTimeMillis();
focal_class.type: long
focal_class.var_name: gcTimer
focal_class.declarator: newInBufferBehaviour
focal_class.modifier: private
focal_class.original_string: private boolean newInBufferBehaviour;
focal_class.type: boolean
focal_class.var_name: newInBufferBehaviour
focal_class.declarator: newInBufferSize
focal_class.modifier: private
focal_class.original_string: private int newInBufferSize;
focal_class.type: int
focal_class.var_name: newInBufferSize
focal_class.declarator: minInBufferSize
focal_class.modifier: private
focal_class.original_string: private int minInBufferSize;
focal_class.type: int
focal_class.var_name: minInBufferSize
focal_class.declarator: workerFreeMemoryRatio
focal_class.modifier: private
focal_class.original_string: private double workerFreeMemoryRatio;
focal_class.type: double
focal_class.var_name: workerFreeMemoryRatio
focal_class.file: worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/InBuffer.java
focal_class.identifier: InBuffer
focal_class.interfaces: implements WorkerRecoveryListener, ApplicationListener, Runnable
focal_class.class_method_signature: InBuffer.init()
focal_class.full_signature: @PostConstruct void init()
focal_class.identifier: init
focal_class.modifiers: @PostConstruct
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: InBuffer.getWorkerFreeMemoryRatio()
focal_class.full_signature: private double getWorkerFreeMemoryRatio()
focal_class.identifier: getWorkerFreeMemoryRatio
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: double
focal_class.signature: double getWorkerFreeMemoryRatio()
focal_class.class_method_signature: InBuffer.fillBufferPeriodically()
focal_class.full_signature: private void fillBufferPeriodically()
focal_class.identifier: fillBufferPeriodically
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void fillBufferPeriodically()
focal_class.class_method_signature: InBuffer.needToPoll(int bufferSize, long totalMemory, long freeMemory)
focal_class.full_signature: private boolean needToPoll(int bufferSize, long totalMemory, long freeMemory)
focal_class.identifier: needToPoll
focal_class.modifiers: private
focal_class.parameters: (int bufferSize, long totalMemory, long freeMemory)
focal_class.return: boolean
focal_class.signature: boolean needToPoll(int bufferSize, long totalMemory, long freeMemory)
focal_class.class_method_signature: InBuffer.ackMessages(List<ExecutionMessage> newMessages)
focal_class.full_signature: private void ackMessages(List<ExecutionMessage> newMessages)
focal_class.identifier: ackMessages
focal_class.modifiers: private
focal_class.parameters: (List<ExecutionMessage> newMessages)
focal_class.return: void
focal_class.signature: void ackMessages(List<ExecutionMessage> newMessages)
focal_class.class_method_signature: InBuffer.addExecutionMessage(ExecutionMessage msg)
focal_class.full_signature: public void addExecutionMessage(ExecutionMessage msg)
focal_class.identifier: addExecutionMessage
focal_class.modifiers: public
focal_class.parameters: (ExecutionMessage msg)
focal_class.return: void
focal_class.signature: void addExecutionMessage(ExecutionMessage msg)
focal_class.class_method_signature: InBuffer.addExecutionMessageInner(ExecutionMessage msg)
focal_class.full_signature: private void addExecutionMessageInner(ExecutionMessage msg)
focal_class.identifier: addExecutionMessageInner
focal_class.modifiers: private
focal_class.parameters: (ExecutionMessage msg)
focal_class.return: void
focal_class.signature: void addExecutionMessageInner(ExecutionMessage msg)
focal_class.class_method_signature: InBuffer.onApplicationEvent(ApplicationEvent applicationEvent)
focal_class.full_signature: @Override public void onApplicationEvent(ApplicationEvent applicationEvent)
focal_class.identifier: onApplicationEvent
focal_class.modifiers: @Override public
focal_class.parameters: (ApplicationEvent applicationEvent)
focal_class.return: void
focal_class.signature: void onApplicationEvent(ApplicationEvent applicationEvent)
focal_class.class_method_signature: InBuffer.run()
focal_class.full_signature: @Override public void run()
focal_class.identifier: run
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void run()
focal_class.class_method_signature: InBuffer.checkFreeMemorySpace(long totalMemory, long freeMemory)
focal_class.full_signature: private boolean checkFreeMemorySpace(long totalMemory, long freeMemory)
focal_class.identifier: checkFreeMemorySpace
focal_class.modifiers: private
focal_class.parameters: (long totalMemory, long freeMemory)
focal_class.return: boolean
focal_class.signature: boolean checkFreeMemorySpace(long totalMemory, long freeMemory)
focal_class.class_method_signature: InBuffer.doRecovery()
focal_class.full_signature: @Override public void doRecovery()
focal_class.identifier: doRecovery
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void doRecovery()
focal_class.class_method_signature: InBuffer.getCapacity()
focal_class.full_signature: public int getCapacity()
focal_class.identifier: getCapacity
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getCapacity()
focal_method.body: @Override
      public void onApplicationEvent(ApplicationEvent applicationEvent) {
          if (applicationEvent instanceof ContextRefreshedEvent && !endOfInit) {
              endOfInit = true;
              inShutdown = false;
              fillBufferThread.setName("WorkerFillBufferThread");
              fillBufferThread.start();
          } else if (applicationEvent instanceof ContextClosedEvent) {
              inShutdown = true;
          }
      }
focal_method.class_method_signature: InBuffer.onApplicationEvent(ApplicationEvent applicationEvent)
focal_method.full_signature: @Override public void onApplicationEvent(ApplicationEvent applicationEvent)
focal_method.identifier: onApplicationEvent
focal_method.invocations: setName start
focal_method.modifiers: @Override public
focal_method.parameters: (ApplicationEvent applicationEvent)
focal_method.return: void
focal_method.signature: void onApplicationEvent(ApplicationEvent applicationEvent)