Examples of RunInfo


Examples of at.tuwien.minimee.migration.runners.RunInfo

        try {
            String command = prepareCommand(config, params, inputFile, outputFile, time);
           
            IRunner runner = makeRunner(command, config);
            RunInfo r = runner.run();   
           
            result.setSuccessful(r.isSuccess());
            result.setReport(r.getReport());
           
            byte[] migratedFile = new byte[]{};
            try {
                migratedFile = FileUtils.getBytesFromFile(new File(outputFile));
                DigitalObject u = new DigitalObject();
                u.getData().setData(migratedFile);
                FormatInfo tFormat = new FormatInfo();
                tFormat.setDefaultExtension(config.getOutEnding());
                result.setTargetFormat(tFormat);
                result.setMigratedObject(u);
            } catch (Exception e) {
                log.error("Could not get outputfile "+outputFile);
                result.setSuccessful(false);
                log.error(e);
            }
            collectData(config, time, result);
           
          

            double length = migratedFile.length;
            double elapsed = r.getElapsedTimeMS();
            double elapsedPerMB = ((double)elapsed)/(getMByte(data));

            Measurement me = new Measurement(MigrationResult.MIGRES_ELAPSED_TIME,elapsed);
            result.getMeasurements().put(MigrationResult.MIGRES_ELAPSED_TIME, me);

            for (MeasurableProperty property: getMeasurableProperties()) {
                if (!property.getName().startsWith("machine:")) {
                    Measurement m = new Measurement();
                    m.setProperty(property);
                    PositiveFloatValue v = (PositiveFloatValue) property.getScale().createValue();
                    if (property.getName().equals(MigrationResult.MIGRES_ELAPSED_TIME)) {
                        v.setValue(elapsed);
                        m.setValue(v);
                        result.getMeasurements().put(property.getName(), m);
                    } else if (property.getName().equals(MigrationResult.MIGRES_ELAPSED_TIME_PER_MB)) {
                        v.setValue(elapsedPerMB);
                        m.setValue(v);
                        result.getMeasurements().put(property.getName(), m);
                    } else if (property.getName().equals(MigrationResult.MIGRES_RELATIVE_FILESIZE)) {
                        v.setValue(((double)length)/data.length * 100);
                        m.setValue(v);
                        result.getMeasurements().put(property.getName(), m);
                    } else if (property.getName().equals(MigrationResult.MIGRES_RESULT_FILESIZE)) {
                        v.setValue((double)length);
                        m.setValue(v);
                        result.getMeasurements().put(property.getName(), m);
                    }
                }               
            }
           
            success =  r.isSuccess();
        } catch (Exception e) {
            log.error(e.getMessage(),e);
            return false;
        } finally {
            cleanup(time,inputFile,outputFile);
View Full Code Here

Examples of at.tuwien.minimee.migration.runners.RunInfo

        try {
            String command = prepareCommand(config, params, inputFile, outputFile, time);
           
            IRunner runner = makeRunner(command, config);
            RunInfo r = runner.run();   
           
            result.setSuccessful(r.isSuccess());
            result.setReport(r.getReport());
           
            byte[] migratedFile = new byte[]{};
            try {
                migratedFile = FileUtils.getBytesFromFile(new File(outputFile));
                DigitalObject u = new DigitalObject();
                u.getData().setData(migratedFile);
                FormatInfo tFormat = new FormatInfo();
                tFormat.setDefaultExtension(config.getOutEnding());
                result.setTargetFormat(tFormat);
                result.setMigratedObject(u);
            } catch (Exception e) {
                log.error("Could not get outputfile "+outputFile, e);
                result.setReport(result.getReport() + "\r\n error: could not retrieve outputfile.");
                result.setSuccessful(false);
            }
            collectData(config, time, result);
           
          

            double length = migratedFile.length;
            double elapsed = r.getElapsedTimeMS();
            double elapsedPerMB = ((double)elapsed)/(getMByte(data));

            Measurement me = new Measurement(MeasureConstants.ELAPSED_TIME_PER_OBJECT,elapsed);
            result.getMeasurements().put(MeasureConstants.ELAPSED_TIME_PER_OBJECT, me);

            for (Measure measure: getMeasures()) {
                if (!measure.getUri().startsWith("machine:")) {
                    Measurement m = new Measurement();
                    m.setMeasureId(measure.getUri());
                    PositiveFloatValue v = new PositiveFloatValue();
                    if (measure.getUri().equals(MeasureConstants.ELAPSED_TIME_PER_OBJECT)) {
                        v.setValue(elapsed);
                        m.setValue(v);
                        result.getMeasurements().put(measure.getUri(), m);
                    } else if (measure.getUri().equals(MeasureConstants.ELAPSED_TIME_PER_MB)) {
                        v.setValue(elapsedPerMB);
                        m.setValue(v);
                        result.getMeasurements().put(measure.getUri(), m);
                    } else if (measure.getUri().equals(MeasureConstants.COMPARATIVE_FILE_SIZE)) {
                        v.setValue(((double)length)/data.length * 100);
                        m.setValue(v);
                        result.getMeasurements().put(measure.getUri(), m);
                    } else if (measure.getUri().equals(MigrationResult.MIGRES_RESULT_FILESIZE)) {
                        v.setValue((double)length);
                        m.setValue(v);
                        result.getMeasurements().put(measure.getUri(), m);
                    }
                }               
            }
           
            success =  r.isSuccess();
        } catch (Exception e) {
            log.error(e.getMessage(),e);
            return false;
        } finally {
            cleanup(time,inputFile,outputFile);
View Full Code Here

Examples of org.testng.eclipse.ui.RunInfo

  public boolean select(Viewer viewer, Object parentElement, Object element) {
    if (m_searchString == null || m_searchString.length() == 0) {
      return true;
    }

    RunInfo p = (RunInfo) element;

    return p.getTestName().toLowerCase().matches(m_searchString.toLowerCase());
  }
View Full Code Here

Examples of org.testng.eclipse.ui.RunInfo

  }

  public int compare(Viewer viewer, Object e1, Object e2) {
    int result = 0;

    RunInfo r1 = (RunInfo) e1;
    RunInfo r2 = (RunInfo) e2;
    switch(m_column) {
      // Test name
      case 0 : result = r1.getTestName().compareTo(r2.getTestName()); break;

      // Time
      case 1: result = (int) (m_tab.getTestTime(r1.getTestId())
          - m_tab.getTestTime(r2.getTestId()));
          break;

      // Class count
      case 2: result = (int) (m_tab.getTestClassCount(r1.getTestId())
          - m_tab.getTestClassCount(r2.getTestId()));
          break;

      // Method count
      case 3: result = (int) (m_tab.getTestMethodCount(r1.getTestId())
          - m_tab.getTestMethodCount(r2.getTestId()));
          break;
    }

    return adjustDirection(result);
  }
View Full Code Here

Examples of org.testng.eclipse.ui.RunInfo

      public void selectionChanged(SelectionChangedEvent event) {
        ISelection selection = event.getSelection();
        if (selection instanceof StructuredSelection) {
          StructuredSelection ss = (StructuredSelection) selection;
          RunInfo selected = ((RunInfo) ss.getFirstElement());
          if (selected != null) {
            String selectedId = ((RunInfo) ss.getFirstElement()).getTestId();
            if (m_selectedId != null && !m_selectedId.startsWith(selectedId)) {
              m_selectedId = selectedId;
            }
          }
        }
      }

    });

    //
    // Content provider
    //
    m_testViewer.setContentProvider(new IStructuredContentProvider() {

      public void dispose() {
      }

      public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
      }

      public Object[] getElements(Object inputElement) {
        return m_tests.values().toArray();
      }
     
    });

    //
    // Label provider
    //
    m_testViewer.setLabelProvider(new ITableLabelProvider() {
     
      public void removeListener(ILabelProviderListener listener) {
      }
     
      public boolean isLabelProperty(Object element, String property) {
        return false;
      }
     
      public void dispose() {
      }
     
      public void addListener(ILabelProviderListener listener) {
      }
     
      public String getColumnText(Object element, int columnIndex) {
        RunInfo runInfo = (RunInfo) element;
        String testId = runInfo.getTestId();
        switch(columnIndex) {
          case 0return ((RunInfo) element).getTestName();
          case 1: return MessageFormat.format("{0}", ((float) getTestTime(testId)) / 1000);
          case 2: return Integer.toString(getTestClassCount(testId));
          case 3: return Integer.toString(getTestMethodCount(testId));
View Full Code Here

Examples of org.testng.eclipse.ui.RunInfo

  public TestMethodTreeItem(TreeItem parent, RunInfo runInfo) {
    super(parent, runInfo);
  }

  protected String getLabel() {
    RunInfo runInfo = getRunInfo();
    String result = runInfo.getMethodName() + runInfo.getInvocationCountDisplay();
    return result;
  }
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.