use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class NormalizeAudioWorkflowOperationHandlerTest method testAudio.
@Test
public void testAudio() throws Exception {
operationInstance.setConfiguration("source-tags", "");
operationInstance.setConfiguration("source-flavor", "*/audio");
operationInstance.setConfiguration("source-flavors", "");
operationInstance.setConfiguration("target-flavor", "*/normalized");
operationInstance.setConfiguration("target-tags", "norm");
operationInstance.setConfiguration("force-transcode", "true");
operationInstance.setConfiguration("target-decibel", "-30");
WorkflowOperationResult result = operationHandler.start(instance, null);
Assert.assertEquals(Action.CONTINUE, result.getAction());
Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 4, result.getMediaPackage().getElements().length);
Track[] tracks = result.getMediaPackage().getTracks(new MediaPackageElementFlavor("presentation", "normalized"));
Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 1, tracks.length);
Assert.assertTrue(tracks[0].containsTag("norm"));
TrackImpl audioVideo = (TrackImpl) tracks[0];
Assert.assertEquals(-30f, audioVideo.getAudio().get(0).getRmsLevDb().floatValue(), 0.001d);
tracks = result.getMediaPackage().getTracks(new MediaPackageElementFlavor("presentation", "audio"));
Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 1, tracks.length);
audioVideo = (TrackImpl) tracks[0];
Assert.assertNull(audioVideo.getAudio().get(0).getRmsLevDb());
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class NormalizeAudioWorkflowOperationHandlerTest method testAudioContainer.
@Test
public void testAudioContainer() throws Exception {
operationInstance.setConfiguration("source-tags", "");
operationInstance.setConfiguration("source-flavor", "*/container-audio");
operationInstance.setConfiguration("source-flavors", "");
operationInstance.setConfiguration("target-flavor", "*/normalized");
operationInstance.setConfiguration("target-tags", "norm");
operationInstance.setConfiguration("force-transcode", "true");
operationInstance.setConfiguration("target-decibel", "-30");
WorkflowOperationResult result = operationHandler.start(instance, null);
Assert.assertEquals(Action.CONTINUE, result.getAction());
Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 4, result.getMediaPackage().getElements().length);
Track[] tracks = result.getMediaPackage().getTracks(new MediaPackageElementFlavor("presentation", "normalized"));
Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 1, tracks.length);
Assert.assertTrue(tracks[0].containsTag("norm"));
TrackImpl audioVideo = (TrackImpl) tracks[0];
Assert.assertEquals(-30f, audioVideo.getAudio().get(0).getRmsLevDb().floatValue(), 0.001d);
tracks = result.getMediaPackage().getTracks(new MediaPackageElementFlavor("presentation", "container-audio"));
Assert.assertEquals("Resulting mediapackage has the wrong number of tracks", 1, tracks.length);
audioVideo = (TrackImpl) tracks[0];
Assert.assertNull(audioVideo.getAudio().get(0).getRmsLevDb());
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class InspectWorkflowOperationHandlerTest method testInspectOperationDCMetadata.
@Test
public void testInspectOperationDCMetadata() throws Exception {
WorkflowOperationResult result = getWorkflowOperationResult(mp);
Catalog cat = result.getMediaPackage().getCatalogs()[0];
// dublincore check: also checked with strict mock calls
Assert.assertEquals(NEW_DC_URL, cat.getURI().toString());
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class InspectWorkflowOperationHandlerTest method testInspectOperationTrackMetadata.
@Test
public void testInspectOperationTrackMetadata() throws Exception {
for (Catalog c : mp.getCatalogs()) {
mp.remove(c);
}
WorkflowOperationResult result = getWorkflowOperationResult(mp);
Track trackNew = result.getMediaPackage().getTracks()[0];
// check track metadata
Assert.assertNotNull(trackNew.getChecksum());
Assert.assertNotNull(trackNew.getMimeType());
Assert.assertNotNull(trackNew.getDuration());
Assert.assertNotNull(trackNew.getStreams());
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class StartTranscriptionOperationHandlerTest method testStartSkipFlavor.
@Test
public void testStartSkipFlavor() throws Exception {
// Make sure operation will be skipped if media package already contains the flavor passed
operation.setConfiguration(StartTranscriptionOperationHandler.SKIP_IF_FLAVOR_EXISTS, "audio/ogg");
WorkflowOperationResult result = operationHandler.start(workflowInstance, null);
Assert.assertEquals(Action.SKIP, result.getAction());
}
Aggregations