Package org.apache.uima.cas

Examples of org.apache.uima.cas.CAS.reset()


    // Send CPC. The service should recreate a session and send CPC reply
    eeUimaEngine.collectionProcessingComplete();
    // Now send some CASes and sleep to let the inactivity timer pop again
    for (int i = 0; i < 5; i++) {
      eeUimaEngine.sendAndReceiveCAS(cas); // This will start a timer on reply queue
      cas.reset();
      if (i == 3) {
        Thread.currentThread().sleep(8000);
      }
    }
    // Send another CPC
View Full Code Here


      eeUimaEngine.sendAndReceiveCAS(cas);
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      eeUimaEngine.collectionProcessingComplete();
      cas.reset();
    }
    eeUimaEngine.stop();
    // runTest(null,eeUimaEngine,String.valueOf(broker.getMasterConnectorURI()),"TopLevelTaeQueue",
    // 1, EXCEPTION_LATCH);
  }
View Full Code Here

        return Status.CANCEL_STATUS;
      }
      TreePath treePath = null;
      final IAnnotationCheckTreeNode root = new AnnotationCheckRootNode();
      for (File file : listFiles) {
        cas.reset();
        try {
          XmiCasDeserializer.deserialize(new FileInputStream(file), cas, true);
        } catch (FileNotFoundException e) {
          RutaAddonsPlugin.error(e);
        } catch (SAXException e) {
View Full Code Here

      RutaAddonsPlugin.error(e);
    }
    for (AnnotationCheckTreeNode each : children) {
      CheckDocument cd = (CheckDocument) each.getElement();
      if (cd.checked && cd.keep) {
        cas.reset();
        File oldFile = new File(cd.source);
        File goldFile = new File(documentSink.getText(), oldFile.getName());
        try {
          if (goldFile.exists()) {
            XmiCasDeserializer.deserialize(new FileInputStream(goldFile), cas, false);
View Full Code Here

          RutaAddonsPlugin.error(e);
        } catch (IOException e) {
          RutaAddonsPlugin.error(e);
        }
        String documentText = cas.getDocumentText();
        cas.reset();
        cas.setDocumentText(documentText);
        try {
          XmiCasDeserializer.deserialize(new FileInputStream(oldFile), casSource, true);
        } catch (FileNotFoundException e) {
          RutaAddonsPlugin.error(e);
View Full Code Here

              HashMap<String, String> testFilesMap = createFileMap(testDataPath);
              String documentFileName = getFileNameWithoutExtensions(document.getDocument()
                      .getAbsolutePath());
              if (testFilesMap.get(documentFileName) != null) {
                File testFile = new File(testFilesMap.get(documentFileName));
                testCas.reset();
                XmiCasDeserializer.deserialize(new FileInputStream(testFile), testCas, true);
                IPreferenceStore store = RutaAddonsPlugin.getDefault().getPreferenceStore();
                String factoryName = store.getString(TestingPreferenceConstants.EVALUATOR_FACTORY);
                boolean includeSubtypes = store.getBoolean(TestingPreferenceConstants.INCLUDE_SUBTYPES);
                boolean useAllTypes = store.getBoolean(TestingPreferenceConstants.ALL_TYPES);
View Full Code Here

        CAS runCas = CasCreationUtils.createCas(tsd, null, null);
        CAS goldCas = CasCreationUtils.createCas(tsd, null, null);
        for (TestCasData td : testCasData) {
          // init etc
          runCas.reset();
          goldCas.reset();
          // deserialize CASes
          IPath path2RunFile = runTestPath.append(td.getPath().toFile().getName());
          String runFilePath = path2RunFile.toPortableString();
          File runFile = new File(runFilePath);
          deserializeCASs(goldCas, td, runCas, runFile);
View Full Code Here

        CAS cleanCas = getEmptyCas(tsd);

        for (TestCasData td : testCasData) {
          // init etc
          cleanCas.reset(); // clean
          // deserialize CASes
          FileInputStream inputStreamRun = null;
          try {
            inputStreamRun = new FileInputStream(new File(td.getPath().toPortableString()));
            XmiCasDeserializer.deserialize(inputStreamRun, cleanCas, true);
View Full Code Here

        CAS testCas = getEmptyCas(descriptor);

        for (TestCasData td : testCasData) {
          // init td etc
          runCas.reset();
          testCas.reset();
          String elementName = fScript.getLocation().lastSegment();
          monitor.setTaskName("Processing [w/o classpatch ext.] " + td.getPath().lastSegment());
          int lastIndexOf = elementName.lastIndexOf(RutaEngine.SCRIPT_FILE_EXTENSION);
          if (lastIndexOf != -1) {
            elementName = elementName.substring(0, lastIndexOf);
View Full Code Here

        try {

          if (cas == null) {
            cas = ae.newCAS();
          } else {
            cas.reset();
          }
          if (path.getFileExtension().equals("xmi")) {
            XmiCasDeserializer.deserialize(new FileInputStream(path.toPortableString()), cas, true);
          } else {
            cas.setDocumentText(getText(path.toPortableString()));
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.