Package org.apache.uima.analysis_engine

Examples of org.apache.uima.analysis_engine.TextAnalysisEngine.newCAS()


              new XMLInputSource(JUnitExtension
                      .getFile("TextAnalysisEngineImplTest/TestPrimitiveTae1.xml")));

      // check default setting
      TextAnalysisEngine taeDefault = UIMAFramework.produceTAE(testDescriptor);
      CAS cas = taeDefault.newCAS();
      int heapSize = ((CASImpl) cas).getHeap().getCurrentTempSize();
      int bufSize = ((CASImpl)cas).getHeap().heap.length;
      //System.out.println("Heap size: " + heapSize + ", buffer size: " + bufSize);      
      Assert.assertTrue(bufSize < CASImpl.DEFAULT_RESET_HEAP_SIZE);
      assertTrue(heapSize <= bufSize);
View Full Code Here


              new XMLInputSource(JUnitExtension
                      .getFile("TextAnalysisEngineImplTest/TestPrimitiveTae1.xml")));

      // check default setting
      TextAnalysisEngine taeDefault = UIMAFramework.produceTAE(testDescriptor);
      CAS tcasDefault = taeDefault.newCAS();
      int heapSize = ((CASImpl) tcasDefault).getHeap().heap.length;
      Assert.assertEquals(expectedHeapSizeDefault, heapSize);

      // check override
      Map<String, Object> params = new HashMap<String, Object>();
View Full Code Here

      // check override
      Map<String, Object> params = new HashMap<String, Object>();
      params.put(Resource.PARAM_PERFORMANCE_TUNING_SETTINGS, newProps);
      TextAnalysisEngine taeOverride = UIMAFramework.produceTAE(testDescriptor, params);
      CAS tcasOverride = taeOverride.newCAS();
      heapSize = ((CASImpl) tcasOverride).getHeap().heap.length;
      Assert.assertEquals(100000, heapSize);
    } catch (Exception e) {
      JUnitExtension.handleException(e);
    }
View Full Code Here

              new XMLInputSource(JUnitExtension
                      .getFile("TextAnalysisEngineImplTest/TestPrimitiveTae1.xml")));

      // check default setting
      TextAnalysisEngine taeDefault = UIMAFramework.produceTAE(testDescriptor);
      CAS cas = taeDefault.newCAS();
      int heapSize = ((CASImpl) cas).getHeap().getHeapSize();
      int bufSize = ((CASImpl)cas).getHeap().heap.length;
      //System.out.println("Heap size: " + heapSize + ", buffer size: " + bufSize);      
      Assert.assertTrue(bufSize < CASImpl.DEFAULT_RESET_HEAP_SIZE);
      assertTrue(heapSize <= bufSize);
View Full Code Here

      // Test each form of the process method. When TestAnnotator executes, it
      // stores in static fields the document text and the ResultSpecification.
      // We use thse to make sure the information propogates correctly to the annotator.

      // process(CAS)
      CAS tcas = tae.newCAS();
      tcas.setDocumentText("new test");
      tae.process(tcas);
      tcas.reset();

      // process(CAS,ResultSpecification)
View Full Code Here

    // Test each form of the process method. When TestAnnotator executes, it
    // stores in static fields the document text and the ResultSpecification.
    // We use thse to make sure the information propogates correctly to the annotator.

    // process(CAS)
    CAS tcas = tae.newCAS();
    tcas.setDocumentText("new test");
    tae.process(tcas);
    assertEquals("new test", TestAnnotator.lastDocument);
    tcas.reset();
View Full Code Here

              new XMLInputSource(JUnitExtension
                      .getFile("TextAnalysisEngineImplTest/TestPrimitiveTae1.xml")));

      // check default setting
      TextAnalysisEngine taeDefault = UIMAFramework.produceTAE(testDescriptor);
      CAS cas = taeDefault.newCAS();
      int heapSize = ((CASImpl) cas).heap.getCurrentTempSize();
      // System.out.println("Heap size: " + heapSize + ", buffer size: " + ((CASImpl)
      // cas).heap.heap.length);
      Assert.assertTrue(heapSize < CASImpl.DEFAULT_RESET_HEAP_SIZE);
      assertTrue(heapSize <= ((CASImpl) cas).heap.heap.length);
View Full Code Here

              new XMLInputSource(JUnitExtension
                      .getFile("TextAnalysisEngineImplTest/TestPrimitiveTae1.xml")));

      // check default setting
      TextAnalysisEngine taeDefault = UIMAFramework.produceTAE(testDescriptor);
      CAS tcasDefault = taeDefault.newCAS();
      int heapSize = ((CASImpl) tcasDefault).getHeap().heap.length;
      Assert.assertEquals(expectedHeapSizeDefault, heapSize);

      // check override
      HashMap params = new HashMap();
View Full Code Here

      // check override
      HashMap params = new HashMap();
      params.put(Resource.PARAM_PERFORMANCE_TUNING_SETTINGS, newProps);
      TextAnalysisEngine taeOverride = UIMAFramework.produceTAE(testDescriptor, params);
      CAS tcasOverride = taeOverride.newCAS();
      heapSize = ((CASImpl) tcasOverride).getHeap().heap.length;
      Assert.assertEquals(100000, heapSize);
    } catch (Exception e) {
      JUnitExtension.handleException(e);
    }
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.