Examples of HideOutput


Examples of org.apache.uima.fit.testing.util.HideOutput

  public void testOtherViewAware() throws ResourceInitializationException,
          AnalysisEngineProcessException {
    AnalysisEngineDescription description = AnalysisEngineFactory.createEngineDescription(
            SofaAwareAnnotator.class, typeSystemDescription);
    AnalysisEngine engine = AnalysisEngineFactory.createEngine(description, "myView");
    HideOutput hider = new HideOutput();
    engine.process(jCas);
    hider.restoreOutput();
  }
View Full Code Here

Examples of org.apache.uima.fit.testing.util.HideOutput

      uoe = e;
    }
    assertNotNull(uoe);
    cr.close();

    HideOutput hideOutput = new HideOutput();
    cr = CollectionReaderFactory.createReader(SingleFileXReader.class,
            typeSystemDescription, SingleFileXReader.PARAM_XML_SCHEME, "XCAS",
            SingleFileXReader.PARAM_FILE_NAME, "test/data/docs/bad.xcas");
    RuntimeException re = null;
    try {
      new JCasIterator(cr).next();
    } catch (RuntimeException e) {
      re = e;
    }
    assertNotNull(re);
    hideOutput.restoreOutput();

    cr = CollectionReaderFactory.createReader(SingleFileXReader.class,
            typeSystemDescription, SingleFileXReader.PARAM_XML_SCHEME, "XMI",
            SingleFileXReader.PARAM_FILE_NAME, "test/data/docs/dne.xmi");
    re = null;
View Full Code Here

Examples of org.apache.uima.fit.testing.util.HideOutput

  public void testOtherViewAware() throws ResourceInitializationException,
          AnalysisEngineProcessException {
    AnalysisEngineDescription description = AnalysisEngineFactory.createEngineDescription(
            SofaAwareAnnotator.class, typeSystemDescription);
    AnalysisEngine engine = AnalysisEngineFactory.createEngine(description, "myView");
    HideOutput hider = new HideOutput();
    engine.process(jCas);
    hider.restoreOutput();
  }
View Full Code Here

Examples of org.apache.uima.fit.testing.util.HideOutput

    ByteArrayOutputStream stringErr = new ByteArrayOutputStream();
    System.setOut(new PrintStream(stringOut));
    System.setErr(new PrintStream(stringErr));
    try {
      // check that nothing is written to stdout or stderr while hidden
      HideOutput ho = new HideOutput();
      System.out.print(message);
      System.err.print(message);
      Assert.assertEquals("", stringOut.toString());
      Assert.assertEquals("", stringErr.toString());

      // check that data is again written to stdout and stderr after restoring
      ho.restoreOutput();
      System.out.print(message);
      System.err.print(message);
      Assert.assertEquals(message, stringOut.toString());
      Assert.assertEquals(message, stringErr.toString());
    }
View Full Code Here

Examples of org.uimafit.testing.util.HideOutput

    // run the data-writing pipeline
    SimplePipeline.runPipeline(collectionReader, builder.createAggregateDescription());

    // train the classifier and package it into a .jar file
    HideOutput hider = new HideOutput();
    JarClassifierBuilder.trainAndPackage(directory, this.trainingArguments);
    hider.restoreOutput();
  }
View Full Code Here

Examples of org.uimafit.testing.util.HideOutput

//                  TKSVMlightStringOutcomeDataWriter.class,
        directory,
        1.0));
    SimplePipeline.runPipeline(collectionReader, aggregateBuilder.createAggregate());

    HideOutput hider = new HideOutput();
    // libsvm:
    JarClassifierBuilder.trainAndPackage(directory,  "-t", "0", "-c", "10");
    // tksvmlight with no tk features:
//    JarClassifierBuilder.trainAndPackage(directory, "-t", "0", "-c", "10", "-N", "0");
//    JarClassifierBuilder.trainAndPackage(directory,  "-t", "5", "-S", "0", "-N", "3", "-C", "+", "-T", "1.0");
    hider.restoreOutput();
    hider.close();
  }
View Full Code Here

Examples of org.uimafit.testing.util.HideOutput

      System.arraycopy(trainingArgs, 0, args, 1, trainingArgs.length);
    } else {
      args = new String[] { modelOutputDirectory };
    }

    HideOutput hider = new HideOutput();
    logger.info("starting training...");
    org.cleartk.classifier.jar.Train.main(args);
    logger.info("finished training.");
    hider.restoreOutput();

    AggregateBuilder decodingBuilder = new AggregateBuilder();
   
    //AnalysisEngineDescription goldCopierAnnotator = AnalysisEngineFactory.createPrimitiveDescription(ReferenceIdentifiedAnnotationsSystemToGoldCopier.class);
    decodingBuilder.add(goldCopierAnnotator);
View Full Code Here

Examples of org.uimafit.testing.util.HideOutput

      System.arraycopy(trainingArgs, 0, args, 1, trainingArgs.length);
    } else {
      args = new String[] { modelOutputDirectory };
    }

    HideOutput hider = new HideOutput();
    logger.info("starting training...");
    org.cleartk.classifier.jar.Train.main(args);
    logger.info("finished training.");
    hider.restoreOutput();

    AggregateBuilder decodingBuilder = new AggregateBuilder();
   
    //AnalysisEngineDescription goldCopierAnnotator = AnalysisEngineFactory.createPrimitiveDescription(ReferenceIdentifiedAnnotationsSystemToGoldCopier.class);
    decodingBuilder.add(goldCopierAnnotator);
View Full Code Here

Examples of org.uimafit.testing.util.HideOutput

    builder.add(classifierAnnotator);
*/   
   
    SimplePipeline.runPipeline(collectionReader,  builder.createAggregateDescription());
   
    HideOutput hider = new HideOutput();
    JarClassifierBuilder.trainAndPackage(directory, this.trainingArguments);
    hider.restoreOutput();
  }
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.