Package eu.planets_project.tb.api.model.eval

Examples of eu.planets_project.tb.api.model.eval.EvaluationExecutable


      return(this.getResultFromCache(f1, f2));
    }
   
    //the execution results are packed within this executable
    //please note this mockup is not using the concept of the TestbedServiceTemplate
    EvaluationExecutable executable = new EvaluationExecutableImpl();
    executable.setExecutionStartDate(new GregorianCalendar().getTimeInMillis());
    executable.setExecutableInvoked(true);
    executable.setExecutionCompleted(false);
   
    try{
    //step1: identify using Pronom;
    String[] sPronomIDs1 = runDroid(f1);
    String[] sPronomIDs2 = runDroid(f2);
   
    //if-else logic - linking pronom results as input for xcdl extraction 
    @SuppressWarnings("unused")
    supportedTypes typeF1,typeF2;
    typeF1 = getType(sPronomIDs1);
    typeF2 = getType(sPronomIDs2);
   
    //step2: extract the xcdl descriptions
    String XCDL1 = runXCDLExtractor(f1 /*, typeF1.xcel()*/);
    String XCDL2 = runXCDLExtractor(f2 /*, typeF2.xcel()*/);
   
    //step3: run the XCDL comparison
    String result = runXCDLComparator(XCDL1, XCDL2);
   
    executable.setXCDLForSource(XCDL1);
    executable.setXCDLForTarget(XCDL2);
    executable.setXCDLsComparisonResult(result);
    executable.setExecutionSuccess(true);
   
    }catch(Exception e){
      executable.setExecutionSuccess(false);
    }
    //End Workflow; write back the results into the executable
    executable.setExecutionEndDate(new GregorianCalendar().getTimeInMillis());
    executable.setExecutionCompleted(true);

    //add the result to the cache
    this.addResultToCache(executable, f1, f2);
   
    return executable;
View Full Code Here


    f2 = new File("C:/Data/T2europa.tif");
  }
 
  public void testRuns(){
    WorkflowDroidXCDLExtractorComparator wf = new WorkflowDroidXCDLExtractorComparator();
    EvaluationExecutable ex1 = wf.execute(f1, f2);
    assertTrue(ex1.isExecutableInvoked());
    assertTrue(ex1.isExecutionCompleted());
    assertTrue(ex1.isExecutionSuccess());
  }
View Full Code Here

    assertTrue(ex1.isExecutionSuccess());
  }
 
  public void testCache(){
    WorkflowDroidXCDLExtractorComparator wf = new WorkflowDroidXCDLExtractorComparator();
    EvaluationExecutable ex1 = wf.execute(f1, f2);
    Calendar i1 = ex1.getExecutionStartDate();
    String s1 = ex1.getXCDLForSource();
   
    EvaluationExecutable ex2 = wf.execute(f1, f2);
    Calendar i2 = ex2.getExecutionStartDate();
    String s2 = ex2.getXCDLForSource();
   
    assertEquals(i1.getTimeInMillis()+"",i2.getTimeInMillis()+"");
    assertEquals(s1,s2);
    assertNotSame(ex1, ex2);
  }
View Full Code Here

TOP

Related Classes of eu.planets_project.tb.api.model.eval.EvaluationExecutable

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.