@Test
  public void testIngest() throws Exception {

    for (int i = 0; i < 100; i++) {
      String sipFileName = "sips/mets_entity_" + i + ".xml";
      java.io.File xmlFile = new java.io.File(sipFileName);
      IntellectualEntity entity = TestUtil.createTestEntity("mets_entity" + i);
      FileOutputStream out = new FileOutputStream(xmlFile);
      ScapeMarshaller.newInstance().serialize(entity, out);
      loaderApplication.enqueuSip(URI.create("file:" + sipFileName));
    }

    loaderApplication.ingestIEs();
  }
 @AfterClass
 public static void tearDown() throws Exception {
   MOCK.stop();
   MOCK.close();
   assertFalse(MOCK.isRunning());
   loaderApplication.shutdown();
 }
  @BeforeClass
  public static void setup() throws Exception {
    PropertyConfigurator.configure("log4j.properties");
    Thread t = new Thread(MOCK);
    t.start();
    while (!MOCK.isRunning()) {
      Thread.sleep(10);
    }

    conf = new Configuration();
    conf.setDir("sips/");
    conf.setUrl("http://localhost:8387");
    conf.setIngest("entity-async");
    conf.setLifecycle("lifecycle");
    loaderApplication = new LoaderApplication(conf);
    loaderApplication.cleanQueue();
  }