Search in sources :

Example 11 with WorkflowDefinitionImpl

use of org.opencastproject.workflow.api.WorkflowDefinitionImpl in project opencast by opencast.

the class EmailDataTest method setUp.

@Before
public void setUp() throws Exception {
    MediaPackageBuilder builder = MediaPackageBuilderFactory.newInstance().newMediaPackageBuilder();
    uriMP = EmailDataTest.class.getResource("/email_mediapackage.xml").toURI();
    mp = builder.loadFromXml(uriMP.toURL().openStream());
    URI episodeURI = EmailDataTest.class.getResource("/episode_dublincore.xml").toURI();
    URI seriesURI = EmailDataTest.class.getResource("/series_dublincore.xml").toURI();
    DublinCoreCatalog episodeDc = DublinCores.read(episodeURI.toURL().openStream());
    catalogs.put("episode", buildCatalogHash(episodeDc));
    DublinCoreCatalog seriesDc = DublinCores.read(seriesURI.toURL().openStream());
    catalogs.put("series", buildCatalogHash(seriesDc));
    WorkflowDefinitionImpl def = new WorkflowDefinitionImpl();
    def.setId("wfdef");
    Map<String, String> props = new HashMap<String, String>();
    props.put("emailAddress", "user@domain.com");
    // Create some incidents
    incident1 = EasyMock.createNiceMock(Incident.class);
    List<Tuple<String, String>> details = new LinkedList<Tuple<String, String>>();
    Tuple<String, String> detail = new Tuple<String, String>("detail-type", "error in operation1");
    details.add(detail);
    EasyMock.expect(incident1.getDetails()).andReturn(details);
    incident2 = EasyMock.createNiceMock(Incident.class);
    details = new LinkedList<Tuple<String, String>>();
    detail = new Tuple<String, String>("detail-type", "error in operation2");
    details.add(detail);
    EasyMock.expect(incident2.getDetails()).andReturn(details);
    // Link the incident and the subtree
    incidents = new LinkedList<Incident>();
    incidents.add(incident1);
    incidents.add(incident2);
    workflowInstance = new WorkflowInstanceImpl(def, null, null, null, null, props);
    workflowInstance.setId(1);
    workflowInstance.setState(WorkflowState.RUNNING);
    workflowInstance.setMediaPackage(mp);
    failedOperation = new WorkflowOperationInstanceImpl("operation1", OperationState.FAILED);
    WorkflowOperationInstanceImpl operation = new WorkflowOperationInstanceImpl("email", OperationState.RUNNING);
    List<WorkflowOperationInstance> operationList = new ArrayList<WorkflowOperationInstance>();
    operationList.add(failedOperation);
    operationList.add(operation);
    workflowInstance.setOperations(operationList);
    EasyMock.replay(incident1, incident2);
}
Also used : WorkflowDefinitionImpl(org.opencastproject.workflow.api.WorkflowDefinitionImpl) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) WorkflowOperationInstanceImpl(org.opencastproject.workflow.api.WorkflowOperationInstanceImpl) URI(java.net.URI) LinkedList(java.util.LinkedList) WorkflowInstanceImpl(org.opencastproject.workflow.api.WorkflowInstanceImpl) WorkflowOperationInstance(org.opencastproject.workflow.api.WorkflowOperationInstance) MediaPackageBuilder(org.opencastproject.mediapackage.MediaPackageBuilder) Incident(org.opencastproject.job.api.Incident) DublinCoreCatalog(org.opencastproject.metadata.dublincore.DublinCoreCatalog) Tuple(org.opencastproject.util.data.Tuple) Before(org.junit.Before)

Example 12 with WorkflowDefinitionImpl

use of org.opencastproject.workflow.api.WorkflowDefinitionImpl in project opencast by opencast.

the class EmailTemplateServiceImplTest method setUp.

@Before
public void setUp() throws Exception {
    MediaPackageBuilder builder = MediaPackageBuilderFactory.newInstance().newMediaPackageBuilder();
    uriMP = EmailTemplateServiceImplTest.class.getResource("/email_mediapackage.xml").toURI();
    mp = builder.loadFromXml(uriMP.toURL().openStream());
    service = new EmailTemplateServiceImpl();
    URI episodeURI = EmailTemplateServiceImplTest.class.getResource("/episode_dublincore.xml").toURI();
    URI seriesURI = EmailTemplateServiceImplTest.class.getResource("/series_dublincore.xml").toURI();
    Workspace workspace = EasyMock.createMock(Workspace.class);
    EasyMock.expect(workspace.get(new URI("episode_dublincore.xml"))).andReturn(new File(episodeURI));
    EasyMock.expect(workspace.get(new URI("series_dublincore.xml"))).andReturn(new File(seriesURI));
    EasyMock.replay(workspace);
    service.setWorkspace(workspace);
    EmailTemplateScanner templateScanner = EasyMock.createMock(EmailTemplateScanner.class);
    EasyMock.expect(templateScanner.getTemplate("templateBasic")).andReturn("Media package id: ${mediaPackage.identifier}, workflow id: ${workflow.id}, " + "title: ${mediaPackage.title}, series title: ${mediaPackage.seriesTitle}, " + "date: ${mediaPackage.date?datetime?iso_utc}");
    EasyMock.expect(templateScanner.getTemplate("templateCatalog")).andReturn("EPISODE creator: ${catalogs[\"episode\"][\"creator\"]}, isPartOf: ${catalogs[\"episode\"][\"isPartOf\"]}, " + "title: ${catalogs[\"episode\"][\"title\"]}, created: ${catalogs[\"episode\"][\"created\"]}, " + "SERIES creator: ${catalogs[\"series\"][\"creator\"]}, description: ${catalogs[\"series\"][\"description\"]}, " + "subject: ${catalogs[\"series\"][\"subject\"]}");
    EasyMock.expect(templateScanner.getTemplate("templateFailed")).andReturn("<#if failedOperation?has_content>Workflow failed in operation: ${failedOperation.template}</#if>, " + "Workflow errors: <#list incident as inc><#list inc.details as de>${de.b} </#list></#list>");
    EasyMock.expect(templateScanner.getTemplate("templateSyntaxError")).andReturn("${mediaPackage");
    EasyMock.replay(templateScanner);
    service.setEmailTemplateScanner(templateScanner);
    WorkflowDefinitionImpl def = new WorkflowDefinitionImpl();
    def.setId("wfdef");
    Map<String, String> props = new HashMap<String, String>();
    props.put("emailAddress", "user@domain.com");
    IncidentService is = EasyMock.createMock(IncidentService.class);
    /*
     * This is what we're building. EasyMock makes it ugly, of course /-------job1Tree / | / incident2 subtree |
     * incident1
     */
    // Create the tree and subtree
    IncidentTree subtree = EasyMock.createNiceMock(IncidentTree.class);
    IncidentTree job1Tree = EasyMock.createNiceMock(IncidentTree.class);
    // Create the incidents
    Incident incident1 = EasyMock.createNiceMock(Incident.class);
    List<Tuple<String, String>> details = new LinkedList<Tuple<String, String>>();
    Tuple<String, String> detail = new Tuple<String, String>("detail-type", "error in operation1");
    details.add(detail);
    EasyMock.expect(incident1.getDetails()).andReturn(details);
    Incident incident2 = EasyMock.createNiceMock(Incident.class);
    details = new LinkedList<Tuple<String, String>>();
    detail = new Tuple<String, String>("detail-type", "error in operation2");
    details.add(detail);
    EasyMock.expect(incident2.getDetails()).andReturn(details);
    // Link the incident and the subtree
    LinkedList<Incident> incidents = new LinkedList<Incident>();
    incidents.add(incident1);
    EasyMock.expect(subtree.getIncidents()).andReturn(incidents).anyTimes();
    // This is what Entwine wrote in the IncidentTree class, so rather than null we're using Immutables.nil()
    List<IncidentTree> subtreeDecendants = Immutables.nil();
    EasyMock.expect(subtree.getDescendants()).andReturn(subtreeDecendants).anyTimes();
    // Link the incident and the parent tree
    incidents = new LinkedList<Incident>();
    incidents.add(incident2);
    EasyMock.expect(job1Tree.getIncidents()).andReturn(incidents).anyTimes();
    // Link the subtree and parent tree
    LinkedList<IncidentTree> subtreeList = new LinkedList<IncidentTree>();
    subtreeList.add(subtree);
    EasyMock.expect(job1Tree.getDescendants()).andReturn(subtreeList).anyTimes();
    service.setIncidentService(is);
    workflowInstance = new WorkflowInstanceImpl(def, null, null, null, null, props);
    workflowInstance.setId(1);
    workflowInstance.setState(WorkflowState.RUNNING);
    workflowInstance.setMediaPackage(mp);
    WorkflowOperationInstanceImpl failedOperation1 = new WorkflowOperationInstanceImpl("operation1", OperationState.FAILED);
    failedOperation1.setFailWorkflowOnException(true);
    failedOperation1.setId(1L);
    EasyMock.expect(is.getIncidentsOfJob(1L, true)).andReturn(subtree).anyTimes();
    WorkflowOperationInstanceImpl failedOperation2 = new WorkflowOperationInstanceImpl("operation2", OperationState.FAILED);
    failedOperation2.setFailWorkflowOnException(false);
    failedOperation1.setId(2L);
    EasyMock.expect(is.getIncidentsOfJob(2L, true)).andReturn(job1Tree).anyTimes();
    WorkflowOperationInstanceImpl operation = new WorkflowOperationInstanceImpl("email", OperationState.RUNNING);
    List<WorkflowOperationInstance> operationList = new ArrayList<WorkflowOperationInstance>();
    operationList.add(failedOperation1);
    operationList.add(failedOperation2);
    operationList.add(operation);
    workflowInstance.setOperations(operationList);
    EasyMock.replay(is, subtree, job1Tree, incident1, incident2);
}
Also used : IncidentService(org.opencastproject.serviceregistry.api.IncidentService) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) WorkflowOperationInstanceImpl(org.opencastproject.workflow.api.WorkflowOperationInstanceImpl) URI(java.net.URI) WorkflowOperationInstance(org.opencastproject.workflow.api.WorkflowOperationInstance) MediaPackageBuilder(org.opencastproject.mediapackage.MediaPackageBuilder) IncidentTree(org.opencastproject.job.api.IncidentTree) WorkflowDefinitionImpl(org.opencastproject.workflow.api.WorkflowDefinitionImpl) LinkedList(java.util.LinkedList) WorkflowInstanceImpl(org.opencastproject.workflow.api.WorkflowInstanceImpl) Incident(org.opencastproject.job.api.Incident) File(java.io.File) Tuple(org.opencastproject.util.data.Tuple) Workspace(org.opencastproject.workspace.api.Workspace) Before(org.junit.Before)

Example 13 with WorkflowDefinitionImpl

use of org.opencastproject.workflow.api.WorkflowDefinitionImpl in project opencast by opencast.

the class IBMWatsonTranscriptionServiceTest method testWorkflowDispatcherRunProgressState.

@Test
public void testWorkflowDispatcherRunProgressState() throws Exception {
    InputStream stream = IBMWatsonTranscriptionServiceTest.class.getResourceAsStream("/" + PULLED_TRANSCRIPTION_FILE);
    database.storeJobControl(MP_ID, TRACK_ID, JOB_ID, TranscriptionJobControl.Status.Progress.name(), 0);
    database.storeJobControl("mpId2", "audioTrack2", "jobId2", TranscriptionJobControl.Status.Progress.name(), TRACK_DURATION);
    EasyMock.expect(workspace.putInCollection(EasyMock.anyObject(String.class), EasyMock.anyObject(String.class), EasyMock.anyObject(InputStream.class))).andReturn(new URI("http://anything"));
    EasyMock.replay(workspace);
    HttpEntity httpEntity = EasyMock.createNiceMock(HttpEntity.class);
    EasyMock.expect(httpEntity.getContent()).andReturn(stream);
    CloseableHttpResponse response = EasyMock.createNiceMock(CloseableHttpResponse.class);
    StatusLine status = EasyMock.createNiceMock(StatusLine.class);
    EasyMock.expect(response.getStatusLine()).andReturn(status).anyTimes();
    EasyMock.expect(response.getEntity()).andReturn(httpEntity).anyTimes();
    EasyMock.expect(status.getStatusCode()).andReturn(HttpStatus.SC_OK).anyTimes();
    EasyMock.replay(httpEntity, response, status);
    Capture<HttpGet> capturedGet = Capture.newInstance();
    EasyMock.expect(httpClient.execute(EasyMock.capture(capturedGet))).andReturn(response);
    EasyMock.replay(httpClient);
    // enrich(q.select(q.snapshot()).where(q.mediaPackageId(mpId).and(q.version().isLatest())).run()).getSnapshots();
    // Mocks for query, result, etc
    Snapshot snapshot = EasyMock.createNiceMock(Snapshot.class);
    EasyMock.expect(snapshot.getOrganizationId()).andReturn(org.getId());
    ARecord aRec = EasyMock.createNiceMock(ARecord.class);
    EasyMock.expect(aRec.getSnapshot()).andReturn(Opt.some(snapshot));
    Stream<ARecord> recStream = Stream.mk(aRec);
    Predicate p = EasyMock.createNiceMock(Predicate.class);
    EasyMock.expect(p.and(p)).andReturn(p);
    AResult r = EasyMock.createNiceMock(AResult.class);
    EasyMock.expect(r.getSize()).andReturn(1L);
    EasyMock.expect(r.getRecords()).andReturn(recStream);
    Target t = EasyMock.createNiceMock(Target.class);
    ASelectQuery selectQuery = EasyMock.createNiceMock(ASelectQuery.class);
    EasyMock.expect(selectQuery.where(EasyMock.anyObject(Predicate.class))).andReturn(selectQuery);
    EasyMock.expect(selectQuery.run()).andReturn(r);
    AQueryBuilder query = EasyMock.createNiceMock(AQueryBuilder.class);
    EasyMock.expect(query.snapshot()).andReturn(t);
    EasyMock.expect(query.mediaPackageId(EasyMock.anyObject(String.class))).andReturn(p);
    EasyMock.expect(query.select(EasyMock.anyObject(Target.class))).andReturn(selectQuery);
    VersionField v = EasyMock.createNiceMock(VersionField.class);
    EasyMock.expect(v.isLatest()).andReturn(p);
    EasyMock.expect(query.version()).andReturn(v);
    EasyMock.expect(assetManager.createQuery()).andReturn(query);
    EasyMock.replay(snapshot, aRec, p, r, t, selectQuery, query, v, assetManager);
    Capture<Set<String>> capturedMpIds = Capture.newInstance();
    WorkflowDefinition wfDef = new WorkflowDefinitionImpl();
    EasyMock.expect(wfService.getWorkflowDefinitionById(IBMWatsonTranscriptionService.DEFAULT_WF_DEF)).andReturn(wfDef);
    List<WorkflowInstance> wfList = new ArrayList<WorkflowInstance>();
    wfList.add(new WorkflowInstanceImpl());
    Stream<WorkflowInstance> wfListStream = Stream.mk(wfList);
    Workflows wfs = EasyMock.createNiceMock(Workflows.class);
    EasyMock.expect(wfs.applyWorkflowToLatestVersion(EasyMock.capture(capturedMpIds), EasyMock.anyObject(ConfiguredWorkflow.class))).andReturn(wfListStream);
    service.setWfUtil(wfs);
    EasyMock.replay(wfService, wfs);
    WorkflowDispatcher dispatcher = service.new WorkflowDispatcher();
    dispatcher.run();
    // Check if it called the external service to get the results
    Assert.assertEquals("https://stream.watsonplatform.net/speech-to-text/api/v1/recognitions/" + JOB_ID, capturedGet.getValue().getURI().toString());
    // Check if only one mp has a workflow created for it
    Assert.assertEquals(1, capturedMpIds.getValue().size());
    // And if it was the correct one
    Assert.assertEquals(MP_ID, capturedMpIds.getValue().iterator().next());
    // Check if status in db was updated
    TranscriptionJobControl job = database.findByJob(JOB_ID);
    Assert.assertNotNull(job);
    Assert.assertEquals(TranscriptionJobControl.Status.Closed.name(), job.getStatus());
}
Also used : Set(java.util.Set) HttpEntity(org.apache.http.HttpEntity) HttpGet(org.apache.http.client.methods.HttpGet) ArrayList(java.util.ArrayList) AQueryBuilder(org.opencastproject.assetmanager.api.query.AQueryBuilder) WorkflowDispatcher(org.opencastproject.transcription.ibmwatson.IBMWatsonTranscriptionService.WorkflowDispatcher) WorkflowInstance(org.opencastproject.workflow.api.WorkflowInstance) URI(java.net.URI) Predicate(org.opencastproject.assetmanager.api.query.Predicate) ARecord(org.opencastproject.assetmanager.api.query.ARecord) Target(org.opencastproject.assetmanager.api.query.Target) CloseableHttpResponse(org.apache.http.client.methods.CloseableHttpResponse) AResult(org.opencastproject.assetmanager.api.query.AResult) TranscriptionJobControl(org.opencastproject.transcription.ibmwatson.persistence.TranscriptionJobControl) WorkflowDefinitionImpl(org.opencastproject.workflow.api.WorkflowDefinitionImpl) Workflows(org.opencastproject.assetmanager.util.Workflows) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) VersionField(org.opencastproject.assetmanager.api.query.VersionField) WorkflowDefinition(org.opencastproject.workflow.api.WorkflowDefinition) ConfiguredWorkflow(org.opencastproject.workflow.api.ConfiguredWorkflow) StatusLine(org.apache.http.StatusLine) Snapshot(org.opencastproject.assetmanager.api.Snapshot) WorkflowInstanceImpl(org.opencastproject.workflow.api.WorkflowInstanceImpl) ASelectQuery(org.opencastproject.assetmanager.api.query.ASelectQuery) Test(org.junit.Test)

Example 14 with WorkflowDefinitionImpl

use of org.opencastproject.workflow.api.WorkflowDefinitionImpl in project opencast by opencast.

the class AttachTranscriptionOperationHandlerTest method setUp.

@Before
public void setUp() throws Exception {
    MediaPackageBuilder builder = MediaPackageBuilderFactory.newInstance().newMediaPackageBuilder();
    // Media package set up
    URI mediaPackageURI = StartTranscriptionOperationHandlerTest.class.getResource("/mp.xml").toURI();
    mediaPackage = builder.loadFromXml(mediaPackageURI.toURL().openStream());
    URI dfxpURI = StartTranscriptionOperationHandlerTest.class.getResource("/attachment_dfxp.xml").toURI();
    String dfxpXml = FileUtils.readFileToString(new File(dfxpURI));
    Attachment captionDfxp = (Attachment) MediaPackageElementParser.getFromXml(dfxpXml);
    URI vttURI = StartTranscriptionOperationHandlerTest.class.getResource("/attachment_vtt.xml").toURI();
    String vttXml = FileUtils.readFileToString(new File(vttURI));
    Attachment captionVtt = (Attachment) MediaPackageElementParser.getFromXml(vttXml);
    // Service registry set up
    job1 = EasyMock.createNiceMock(Job.class);
    EasyMock.expect(job1.getId()).andReturn(1L);
    EasyMock.expect(job1.getPayload()).andReturn(dfxpXml).anyTimes();
    EasyMock.expect(job1.getStatus()).andReturn(Job.Status.FINISHED);
    EasyMock.expect(job1.getDateCreated()).andReturn(new Date());
    EasyMock.expect(job1.getDateStarted()).andReturn(new Date());
    EasyMock.expect(job1.getQueueTime()).andReturn(new Long(0));
    EasyMock.replay(job1);
    job2 = EasyMock.createNiceMock(Job.class);
    EasyMock.expect(job2.getId()).andReturn(2L);
    EasyMock.expect(job2.getPayload()).andReturn(vttXml).anyTimes();
    EasyMock.expect(job2.getStatus()).andReturn(Job.Status.FINISHED);
    EasyMock.expect(job2.getDateCreated()).andReturn(new Date());
    EasyMock.expect(job2.getDateStarted()).andReturn(new Date());
    EasyMock.expect(job2.getQueueTime()).andReturn(new Long(0));
    EasyMock.replay(job2);
    ServiceRegistry serviceRegistry = EasyMock.createNiceMock(ServiceRegistry.class);
    EasyMock.expect(serviceRegistry.getJob(1L)).andReturn(job1);
    EasyMock.expect(serviceRegistry.getJob(2L)).andReturn(job2);
    EasyMock.replay(serviceRegistry);
    // Transcription service set up
    service = EasyMock.createStrictMock(TranscriptionService.class);
    EasyMock.expect(service.getGeneratedTranscription("mpId1", "transcriptionJob")).andReturn(captionDfxp);
    EasyMock.expect(service.getLanguage()).andReturn("en").once();
    EasyMock.expect(service.getGeneratedTranscription("mpId2", "transcriptionJob")).andReturn(captionVtt);
    EasyMock.expect(service.getLanguage()).andReturn("en").once();
    EasyMock.replay(service);
    // Caption service set up
    captionService = EasyMock.createNiceMock(CaptionService.class);
    // Workspace set up
    Workspace workspace = EasyMock.createNiceMock(Workspace.class);
    EasyMock.expect(workspace.moveTo(EasyMock.anyObject(URI.class), EasyMock.anyObject(String.class), EasyMock.anyObject(String.class), EasyMock.anyObject(String.class))).andReturn(// just something valid
    new URI("http://opencast.server.com/captions.xml"));
    EasyMock.replay(workspace);
    // Workflow set up
    WorkflowDefinitionImpl def = new WorkflowDefinitionImpl();
    def.setId("DCE-start-transcription");
    def.setPublished(true);
    workflowInstance = new WorkflowInstanceImpl(def, mediaPackage, null, null, null, null);
    workflowInstance.setId(1);
    operation = new WorkflowOperationInstanceImpl("attach-transcript", OperationState.RUNNING);
    List<WorkflowOperationInstance> operationList = new ArrayList<WorkflowOperationInstance>();
    operationList.add(operation);
    workflowInstance.setOperations(operationList);
    // Operation handler set up
    operationHandler = new AttachTranscriptionOperationHandler();
    operationHandler.setTranscriptionService(service);
    operationHandler.setServiceRegistry(serviceRegistry);
    operationHandler.setCaptionService(captionService);
    operationHandler.setWorkspace(workspace);
    operationHandler.setJobBarrierPollingInterval(1L);
}
Also used : TranscriptionService(org.opencastproject.transcription.api.TranscriptionService) WorkflowDefinitionImpl(org.opencastproject.workflow.api.WorkflowDefinitionImpl) ArrayList(java.util.ArrayList) WorkflowOperationInstanceImpl(org.opencastproject.workflow.api.WorkflowOperationInstanceImpl) Attachment(org.opencastproject.mediapackage.Attachment) URI(java.net.URI) Date(java.util.Date) WorkflowInstanceImpl(org.opencastproject.workflow.api.WorkflowInstanceImpl) WorkflowOperationInstance(org.opencastproject.workflow.api.WorkflowOperationInstance) MediaPackageBuilder(org.opencastproject.mediapackage.MediaPackageBuilder) ServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry) Job(org.opencastproject.job.api.Job) CaptionService(org.opencastproject.caption.api.CaptionService) File(java.io.File) Workspace(org.opencastproject.workspace.api.Workspace) Before(org.junit.Before)

Example 15 with WorkflowDefinitionImpl

use of org.opencastproject.workflow.api.WorkflowDefinitionImpl in project opencast by opencast.

the class WorkflowServiceImplTest method testRetryStrategyFailover.

@Test
@Ignore
public void testRetryStrategyFailover() throws Exception {
    WorkflowDefinitionImpl def = new WorkflowDefinitionImpl();
    def.setId("workflow-definition-1");
    def.setTitle("workflow-definition-1");
    def.setDescription("workflow-definition-1");
    def.setPublished(true);
    service.registerWorkflowDefinition(def);
    WorkflowOperationDefinitionImpl opDef = new WorkflowOperationDefinitionImpl("failOnHost", "fails on host", null, true);
    opDef.setRetryStrategy(RetryStrategy.RETRY);
    def.add(opDef);
    MediaPackage mp = MediaPackageBuilderFactory.newInstance().newMediaPackageBuilder().createNew();
    WorkflowInstance workflow = startAndWait(def, mp, WorkflowState.SUCCEEDED);
    Assert.assertTrue(service.getWorkflowById(workflow.getId()).getOperations().get(0).getState() == OperationState.SUCCEEDED);
    Assert.assertTrue(service.getWorkflowById(workflow.getId()).getOperations().get(0).getMaxAttempts() == 2);
    Assert.assertTrue(service.getWorkflowById(workflow.getId()).getOperations().get(0).getFailedAttempts() == 1);
}
Also used : WorkflowOperationDefinitionImpl(org.opencastproject.workflow.api.WorkflowOperationDefinitionImpl) WorkflowDefinitionImpl(org.opencastproject.workflow.api.WorkflowDefinitionImpl) MediaPackage(org.opencastproject.mediapackage.MediaPackage) WorkflowInstance(org.opencastproject.workflow.api.WorkflowInstance) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

WorkflowDefinitionImpl (org.opencastproject.workflow.api.WorkflowDefinitionImpl)18 WorkflowInstance (org.opencastproject.workflow.api.WorkflowInstance)12 Test (org.junit.Test)11 MediaPackage (org.opencastproject.mediapackage.MediaPackage)10 WorkflowOperationDefinitionImpl (org.opencastproject.workflow.api.WorkflowOperationDefinitionImpl)9 ArrayList (java.util.ArrayList)7 Before (org.junit.Before)7 WorkflowInstanceImpl (org.opencastproject.workflow.api.WorkflowInstanceImpl)7 WorkflowOperationInstance (org.opencastproject.workflow.api.WorkflowOperationInstance)7 URI (java.net.URI)5 MediaPackageBuilder (org.opencastproject.mediapackage.MediaPackageBuilder)5 HashMap (java.util.HashMap)4 File (java.io.File)3 InputStream (java.io.InputStream)3 Set (java.util.Set)3 AuthorizationService (org.opencastproject.security.api.AuthorizationService)3 WorkflowDefinition (org.opencastproject.workflow.api.WorkflowDefinition)3 WorkflowOperationInstanceImpl (org.opencastproject.workflow.api.WorkflowOperationInstanceImpl)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 Date (java.util.Date)2