<commit_before>package org.jscsi.scsi.tasks;

import static org.junit.Assert.fail;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.xml.DOMConfigurator;
import org.jscsi.scsi.exceptions.TaskSetException;
import org.jscsi.scsi.lu.GenericTaskManager;
import org.junit.Test;

// TODO: Describe class or interface
public class GenericTaskManagerTest extends TaskManagerTest
{
   
   @Test
   public void testStaticInsertion_HSO() throws InterruptedException
   {
      DOMConfigurator.configure(System.getProperty("log4j.configuration"));
      
      List<TestTask> taskSet = new ArrayList<TestTask>();
      new HeadOfQueueTask(taskSet, 0);
      new SimpleTask(taskSet, 0);
      Task last = new OrderedTask(taskSet, 100);
      
      GenericTaskManager manager = new GenericTaskManager(1);  // TODO: Should we test with more threads?
      
      for ( Task t : taskSet )
      {
         try
         {
            manager.submitTask(t);
         }
         catch (TaskSetException e)
         {
            e.printStackTrace();
            fail("Task set exception thrown by task manager");
         }
      }
      
      Thread thread = new Thread(manager);
      thread.start();
      
      synchronized (last)
      {
         last.wait(10000);
      }
      
      manager.shutdown();
      thread.join();
      
   }
   
   
}

<commit_msg>cleanup<commit_after>package org.jscsi.scsi.tasks;

import static org.junit.Assert.fail;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.xml.DOMConfigurator;
import org.jscsi.scsi.exceptions.TaskSetException;
import org.jscsi.scsi.lu.GenericTaskManager;
import org.junit.Test;

public class GenericTaskManagerTest extends TaskManagerTest
{
   
   @Test
   public void testStaticInsertion_HSO() throws InterruptedException
   {
      DOMConfigurator.configure(System.getProperty("log4j.configuration"));
      
      List<TestTask> taskSet = new ArrayList<TestTask>();
      new HeadOfQueueTask(taskSet, 0);
      new SimpleTask(taskSet, 0);
      Task last = new OrderedTask(taskSet, 100);
      
      GenericTaskManager manager = new GenericTaskManager(1);  // TODO: Should we test with more threads?
      
      for ( Task t : taskSet )
      {
         try
         {
            manager.submitTask(t);
         }
         catch (TaskSetException e)
         {
            e.printStackTrace();
            fail("Task set exception thrown by task manager");
         }
      }
      
      Thread thread = new Thread(manager);
      thread.start();
      
      synchronized (last)
      {
         last.wait(10000);
      }
      
      manager.shutdown();
      thread.join();
      
   }  
}
{'fraction_non_alphanumeric': 0.09648798521256932, 'fraction_numerical': 0.009611829944547136, 'mean_word_length': 2.2879708383961117, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1374923', 'n_tokens_mistral': 800, 'n_tokens_neox': 788, 'n_words': 169}