Examples of CollectionProcessingEngine


Examples of org.apache.uima.collection.CollectionProcessingEngine

  public void testProcessWithAnnotatorProcessException() throws Exception {
    int documentCount = 20; // number of document to process
    int exceptionSequence = 4; // the sequence in which errors are produced
    ManageOutputDevice.setAllSystemOutputToNirvana();
    // setup CPM
    CollectionProcessingEngine cpe = setupCpm(documentCount, "AnnotatorProcessException",
            exceptionSequence, "process");

    // Create and register a Status Callback Listener
    TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(cpe);
    cpe.addStatusCallbackListener(listener);
    cpeProcessNoMsg(cpe, listener);

    ManageOutputDevice.setAllSystemOutputToDefault();
    // check the results, if everything worked as expected
    assertEquals(
View Full Code Here

Examples of org.apache.uima.collection.CollectionProcessingEngine

    int documentCount = 20; // number of documents to process
    int exceptionSequence = 3; // the sequence in which errors are produced
    ManageOutputDevice.setAllSystemOutputToNirvana();

    // setup CPM
    CollectionProcessingEngine cpe = setupCpm(documentCount, "OutOfMemoryException",
            exceptionSequence, "process");

    // Create and register a Status Callback Listener
    TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(cpe);
    cpe.addStatusCallbackListener(listener);
    cpeProcessNoMsg(cpe, listener);

    ManageOutputDevice.setAllSystemOutputToDefault();
    // check the results, if everything worked as expected
    assertEquals(
View Full Code Here

Examples of org.apache.uima.collection.CollectionProcessingEngine

    int documentCount = 20; // number of documents to process
    int exceptionSequence = 3; // the sequence in which errors are produced
    ManageOutputDevice.setAllSystemOutputToNirvana();

    // setup CPM
    CollectionProcessingEngine cpe = setupCpm(documentCount, "NullPointerException",
            exceptionSequence, "process");

    // Create and register a Status Callback Listener
    TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(cpe);
    cpe.addStatusCallbackListener(listener);
    cpeProcessNoMsg(cpe, listener);

    ManageOutputDevice.setAllSystemOutputToDefault();
    // check the results, if everything worked as expected
    assertEquals(
View Full Code Here

Examples of org.apache.uima.collection.CollectionProcessingEngine

    ManageOutputDevice.setAllSystemOutputToNirvana();

    TestStatusCallbackListener listener = null;
    try {
      // setup CPM
      CollectionProcessingEngine cpe = setupCpm(documentCount, "NullPointerException",
              exceptionSequence, "initialize");

      // Create and register a Status Callback Listener
      listener = new CollectionReaderStatusCallbackListener(cpe);
      cpe.addStatusCallbackListener(listener);
      cpeProcessNoMsg(cpe, listener);
    } catch (NullPointerException e) {
      // e.printStackTrace();
      exceptionThrown = true;
View Full Code Here

Examples of org.apache.uima.collection.CollectionProcessingEngine

    ManageOutputDevice.setAllSystemOutputToNirvana();

    TestStatusCallbackListener listener = null;

    // setup CPM
    CollectionProcessingEngine cpe = setupCpm(documentCount, "OutOfMemoryException",
            exceptionSequence, "initialize");

    // Create and register a Status Callback Listener
    listener = new CollectionReaderStatusCallbackListener(cpe);
    cpe.addStatusCallbackListener(listener);
    cpeProcessNoMsg(cpe, listener);

    ManageOutputDevice.setAllSystemOutputToDefault();
    // check the results, if everything worked as expected
    assertEquals(
View Full Code Here

Examples of org.apache.uima.collection.CollectionProcessingEngine

      int documentCount = 20; // number of documents processed
      int exceptionSequence = 5; // the sequence in which errors are produced
      ManageOutputDevice.setAllSystemOutputToNirvana();

      // setup CPM
      CollectionProcessingEngine cpe = setupCpm(documentCount,
            "OutOfMemoryError", exceptionSequence, "getNext");

      // Create and register a Status Callback Listener
      CollectionReaderStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
            cpe);
      cpe.addStatusCallbackListener(listener);

      cpe.process();

      // wait until cpm has finished
      while (!listener.isFinished() && !listener.isAborted()) {
         Thread.sleep(5);
      }
View Full Code Here

Examples of org.apache.uima.collection.CollectionProcessingEngine

      int documentCount = 20; // number of documents processed
      int exceptionSequence = 2; // the sequence in which errors are produced
      ManageOutputDevice.setAllSystemOutputToNirvana();

      // setup CPM
      CollectionProcessingEngine cpe = setupCpm(documentCount,
            "CollectionException", exceptionSequence, "getNext");

      // Create and register a Status Callback Listener
      TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
            cpe);
      cpe.addStatusCallbackListener(listener);

      cpeProcessNoMsg(cpe, listener);

      ManageOutputDevice.setAllSystemOutputToDefault();
      // check the results, if everything worked as expected
View Full Code Here

Examples of org.apache.uima.collection.CollectionProcessingEngine

      int documentCount = 20; // number of documents processed
      int exceptionSequence = 3; // the sequence in which errors are produced
      ManageOutputDevice.setAllSystemOutputToNirvana();

      // setup CPM
      CollectionProcessingEngine cpe = setupCpm(documentCount, "IOException",
            exceptionSequence, "getNext");

      // Create and register a Status Callback Listener
      TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
            cpe);
      cpe.addStatusCallbackListener(listener);

      cpe.process();

      // wait until cpm has finished
      Date d = new Date();
      long time = d.getTime() + 1000 * TIMEOUT;
      while (!listener.isFinished() && !listener.isAborted()) {
         Thread.sleep(5);
         d = new Date();
         // timeout mechanism
         if (time < d.getTime()) {
            System.out.println("CPM manually aborted!");
            cpe.stop();
            // wait until CPM has aborted
            while (!listener.isAborted()) {
               Thread.sleep(5);
            }
         }
View Full Code Here

Examples of org.apache.uima.collection.CollectionProcessingEngine

      int documentCount = 20; // number of documents processed
      int exceptionSequence = 2; // the sequence in which errors are produced
      ManageOutputDevice.setAllSystemOutputToNirvana();

      // setup CPM
      CollectionProcessingEngine cpe = setupCpm(documentCount,
            "NullPointerException", exceptionSequence, "getNext");

      // Create and register a Status Callback Listener
      TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
            cpe);
      cpe.addStatusCallbackListener(listener);

      cpeProcessNoMsg(cpe, listener);

      ManageOutputDevice.setAllSystemOutputToDefault();
      // check the results, if everything worked as expected
View Full Code Here

Examples of org.apache.uima.collection.CollectionProcessingEngine

      int documentCount = 20; // number of documents processed
      int exceptionSequence = 4; // the sequence in which errors are produced
      ManageOutputDevice.setAllSystemOutputToNirvana();

      // setup CPM
      CollectionProcessingEngine cpe = setupCpm(documentCount,
            "OutOfMemoryError", exceptionSequence, "hasNext");

      // Create and register a Status Callback Listener
      CollectionReaderStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
            cpe);
      cpe.addStatusCallbackListener(listener);

      cpeProcessNoMsg(cpe, listener);

      ManageOutputDevice.setAllSystemOutputToDefault();
      // check the results, if everything worked as expected
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.