Package org.cishell.testing.convertertester.core.tester2

Examples of org.cishell.testing.convertertester.core.tester2.ConverterTester2


              * report generators
              */
            
             System.out.println("Executing tests...");
            
             ConverterTester2 ct = new ConverterTester2(log);
        
             if (testAllConvs) {
               ct.execute(convRefs,
                   new ReportGenerator[]
                      {allGen, allConvGen, allErrGen,
                   graphGen, origGraphGen, readmeGen},
                   cContext, bContext,
                   new HopFilter(numHops));
             } else {
               ct.execute(convRefs,
                   new ReportGenerator[]
                      {allGen, allConvGen, allErrGen,
                   graphGen, origGraphGen, readmeGen},
                   cContext, bContext,
                   new ConvAndHopFilter(selectedConvName, numHops));
View Full Code Here


  private void processConfigurationFile(File f) throws FileNotFoundException {
    System.out.println("Processing " + f.getName());
    try {
      ServiceReference[] refs = getServiceReferences();
      ct = new ConverterTester2(this.logger);
      System.out.println("NOT YET READY FOR USE.");
//      ReportGenerator overview = new OverviewReportGenerator();
//      ct.execute(new ReportGenerator[] {overview}, logger, c, b);
      System.out.println(ct);
    } catch (Exception ex) {
View Full Code Here

   
    /*
     * rig up fake CIShellContext so we can get ahold of
     * errors sent to logger.
     */    
    FakeLogCIShellContext fakeCIShellContext =
      new FakeLogCIShellContext(testData.getContext());
   

 
    //dataSoFar.add(currentData);
   
    Converter currentConverter = null;
    try {
      for (int ii = 0; ii < converters.size(); ii++) {
        currentConverter = converters.get(ii);
     
        // No parameters used.
        Hashtable<String, Object> parameters = new Hashtable<String, Object>();
       
        currentData =
          currentConverter.execute(currentData, parameters, fakeCIShellContext);
       
        if (currentData != null) {
          setMetadata(currentData, currentConverter);
          dataSoFar.add(currentData);
        }

        /*
         * There are two ways that converters generally fail.
         * 1) They throw an exception that propagates out into
         * this method, where we catch it.
         * 2) They catch their own exception, send it to the logger,
         * and return null.
         */
        if (currentData == null || currentData[0].getData() == null) {
          Converter converter = converters.get(ii);
         
          String explanation = "Result of conversion was null. \r\n";
         
         
          if (fakeCIShellContext.hasLogEntries()) {
            String logText = extractLogText(fakeCIShellContext);
            explanation += "Error logger contains the following: \r\n" +
              logText;
          } else {
            explanation += "No errors logged. Cause unknown. \r\n";
View Full Code Here

    LogEntry[] entries = fakeLogContext.getLogEntries();
   
    String logText = "";
   
    for (int ii = 0; ii < entries.length; ii++) {
      LogEntry entry = entries[ii];
     
      Throwable e    = entry.getThrowable();
      String message = entry.getMessage();
     
      logText += message + "\r\n";
      if (e != null) {
      logText += getStackTrace(e) + "\r\n";
      }
View Full Code Here

      boolean idsPreserved) {
   
    if (areLossy) {
      return new LossyComparer();
    } else if (! idsPreserved) {
      return new IdsNotPreservedComparer();
    } else {
      return new IdsPreservedComparer();
    }
  }
View Full Code Here

    if (areLossy) {
      return new LossyComparer();
    } else if (! idsPreserved) {
      return new IdsNotPreservedComparer();
    } else {
      return new IdsPreservedComparer();
    }
  }
View Full Code Here

 
  private NewGraphComparer getComparer(boolean areLossy,
      boolean idsPreserved) {
   
    if (areLossy) {
      return new LossyComparer();
    } else if (! idsPreserved) {
      return new IdsNotPreservedComparer();
    } else {
      return new IdsPreservedComparer();
    }
View Full Code Here

      // graph comparison phase

      Graph resultGraph = (Graph) originalInMemory[0].getData();
      Graph origGraph = (Graph) resultInMemory[0].getData();

      NewGraphComparer comparer = testData.getComparer();
      ComparisonResult graphComparisonPhaseResult = comparer.compare(
          origGraph, resultGraph);

      if (!graphComparisonPhaseResult.comparisonSucceeded()) {
        String explanation =
          graphComparisonPhaseResult.getLog();
View Full Code Here

   
    boolean isLossy = testConvs.isLossy() || compareConvs.isLossy();
    boolean preserveIDs = testConvs.preservesIDs() &&
      compareConvs.preservesIDs();
   
    NewGraphComparer comparer = getComparer(isLossy, preserveIDs);
       
    //pack all the data relevant to the test into a single object.
        TestConfigData testBasicData = new TestConfigData(comparer, testConvs,
            compareConvs, cContext, testFileData);
       
View Full Code Here

          faultHeuristic);
   
    //feed test results to the report generators
   
    for (int ii = 0; ii < reportGenerators.length; ii++) {
      ReportGenerator reportGenerator = reportGenerators[ii];
     
      reportGenerator.generateReport(allTestsResult,
          allConvertersResult, converterGraph.asNWB());
    }
  }
View Full Code Here

TOP

Related Classes of org.cishell.testing.convertertester.core.tester2.ConverterTester2

Copyright © 2018 www.massapicom. 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.