test_class.declarator: endedThreads
test_class.original_string: List<Long> endedThreads ;
test_class.type: List<Long>
test_class.var_name: endedThreads
test_class.file: worker/worker-manager/score-worker-manager-impl/src/test/java/io/cloudslang/worker/management/services/WorkerThreadFactoryTest.java
test_class.identifier: WorkerThreadFactoryTest
test_case.body: @Test
      public void testNewThread() throws Exception {
          Assert.assertTrue(endedThreads.isEmpty());
  
          WorkerThreadFactory factory = new WorkerThreadFactory("worker1");
          Thread thread1 = factory.newThread(new simpleCmd(1L));
          Thread thread2 = factory.newThread(new simpleCmd(2L));
  
          Assert.assertNotSame(thread1.getName(),thread2.getName());
  
          thread1.start();
          thread2.start();
  
          while(thread1.isAlive() || thread2.isAlive()){}
  
          Assert.assertEquals(2,endedThreads.size());
          Assert.assertEquals(3,endedThreads.get(0)+endedThreads.get(1));
      }
test_case.class_method_signature: WorkerThreadFactoryTest.testNewThread()
test_case.full_signature: @Test public void testNewThread()
test_case.identifier: testNewThread
test_case.invocations: assertTrue isEmpty newThread newThread assertNotSame getName getName start start isAlive isAlive assertEquals size assertEquals get get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNewThread()
focal_class.declarator: index
focal_class.modifier: private
focal_class.original_string: private int index;
focal_class.type: int
focal_class.var_name: index
focal_class.declarator: name
focal_class.modifier: private
focal_class.original_string: private String name;
focal_class.type: String
focal_class.var_name: name
focal_class.file: worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/WorkerThreadFactory.java
focal_class.identifier: WorkerThreadFactory
focal_class.interfaces: implements ThreadFactory
focal_class.class_method_signature: WorkerThreadFactory.WorkerThreadFactory(String commonName)
focal_class.full_signature: public  WorkerThreadFactory(String commonName)
focal_class.identifier: WorkerThreadFactory
focal_class.modifiers: public
focal_class.parameters: (String commonName)
focal_class.signature:  WorkerThreadFactory(String commonName)
focal_class.class_method_signature: WorkerThreadFactory.newThread(final Runnable command)
focal_class.full_signature: public Thread newThread(final Runnable command)
focal_class.identifier: newThread
focal_class.modifiers: public
focal_class.parameters: (final Runnable command)
focal_class.return: Thread
focal_class.signature: Thread newThread(final Runnable command)
focal_class.class_method_signature: WorkerThreadFactory.getThreadIDX()
focal_class.full_signature: private int getThreadIDX()
focal_class.identifier: getThreadIDX
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getThreadIDX()
focal_method.body: public Thread newThread(final Runnable command) {
          return new Thread(new Runnable() {
              public void run() {
                  command.run();
              }
          }, name + "-" + getThreadIDX());
      }
focal_method.class_method_signature: WorkerThreadFactory.newThread(final Runnable command)
focal_method.full_signature: public Thread newThread(final Runnable command)
focal_method.identifier: newThread
focal_method.invocations: run getThreadIDX
focal_method.modifiers: public
focal_method.parameters: (final Runnable command)
focal_method.return: Thread
focal_method.signature: Thread newThread(final Runnable command)