use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class ConcatWorkflowOperationHandlerTest method testResolutionByTrackNotMandatory.
@Test
public void testResolutionByTrackNotMandatory() throws Exception {
setMockups();
// operation configuration
String targetTags = "engage,rss";
Map<String, String> configurations = new HashMap<String, String>();
configurations.put("source-flavor-part-0", "presentation/source");
configurations.put("source-flavor-part-1", "presenter/source");
configurations.put("source-flavor-part-1-mandatory", "false");
configurations.put("target-tags", targetTags);
configurations.put("target-flavor", "presenter/concat");
configurations.put("encoding-profile", "concat");
configurations.put("output-resolution", "part-1");
// run the operation handler
WorkflowOperationResult result = getWorkflowOperationResult(mp, configurations);
Assert.assertEquals(Action.SKIP, result.getAction());
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class ConcatWorkflowOperationHandlerTest method testConcatOptionalCheck.
@Test
public void testConcatOptionalCheck() throws Exception {
setMockups();
// operation configuration
String targetTags = "engage,rss";
Map<String, String> configurations = new HashMap<String, String>();
configurations.put("source-flavor-part-0", "presentation/source");
configurations.put("source-flavor-part-1", "test/source");
configurations.put("source-flavor-part-1-mandatory", "false");
configurations.put("source-flavor-part-2", "presentation/source");
configurations.put("target-tags", targetTags);
configurations.put("target-flavor", "presenter/concat");
configurations.put("encoding-profile", "concat");
configurations.put("output-resolution", "1900x1080");
// run the operation handler
WorkflowOperationResult result = getWorkflowOperationResult(mp, configurations);
Assert.assertEquals(Action.CONTINUE, result.getAction());
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class ConcatWorkflowOperationHandlerTest method testConcat2EncodedTracksWithFlavor.
@Test
public void testConcat2EncodedTracksWithFlavor() throws Exception {
setMockups();
// operation configuration
String targetTags = "engage,rss";
Map<String, String> configurations = new HashMap<String, String>();
configurations.put("source-flavor-part-0", "presentation/source");
configurations.put("source-flavor-part-1", "presenter/source");
configurations.put("target-tags", targetTags);
configurations.put("target-flavor", "presenter/concat");
configurations.put("encoding-profile", "concat");
configurations.put("output-resolution", "1900x1080");
// run the operation handler
WorkflowOperationResult result = getWorkflowOperationResult(mp, configurations);
// check track metadata
MediaPackage mpNew = result.getMediaPackage();
Track trackEncoded = mpNew.getTrack(ENCODED_TRACK_ID);
Assert.assertEquals("presenter/concat", trackEncoded.getFlavor().toString());
Assert.assertArrayEquals(targetTags.split("\\W"), trackEncoded.getTags());
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class ConcatWorkflowOperationHandlerTest method testConcatMandatoryCheck.
@Test
public void testConcatMandatoryCheck() throws Exception {
setMockups();
// operation configuration
String targetTags = "engage,rss";
Map<String, String> configurations = new HashMap<String, String>();
configurations.put("source-flavor-part-0", "presentation/source");
configurations.put("source-flavor-part-1", "test/source");
configurations.put("target-tags", targetTags);
configurations.put("target-flavor", "presenter/concat");
configurations.put("encoding-profile", "concat");
configurations.put("output-resolution", "1900x1080");
// run the operation handler
WorkflowOperationResult result = getWorkflowOperationResult(mp, configurations);
Assert.assertEquals(Action.SKIP, result.getAction());
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class CompositeWorkflowOperationHandlerTest method testAll.
@Test
public void testAll() throws Exception {
setMockups();
// operation configuration
String targetTags = "engage,compound";
Map<String, String> configurations = new HashMap<String, String>();
configurations.put("source-flavor-upper", "presenter/source");
configurations.put("source-flavor-lower", "presentation/source");
configurations.put("source-flavor-watermark", "watermark/source");
configurations.put("source-url-watermark", getClass().getResource("/watermark.jpg").toExternalForm());
configurations.put("target-tags", targetTags);
configurations.put("target-flavor", "composite/work");
configurations.put("encoding-profile", "composite");
configurations.put("layout", "test");
configurations.put("layout-test", TEST_LAYOUT);
configurations.put("layout-single", TEST_SINGLE_LAYOUT);
configurations.put("output-resolution", "1900x1080");
configurations.put("output-background", "black");
// run the operation handler
WorkflowOperationResult result = getWorkflowOperationResult(mp, configurations);
// check track metadata
MediaPackage mpNew = result.getMediaPackage();
Assert.assertEquals(Action.CONTINUE, result.getAction());
Track trackEncoded = mpNew.getTrack(COMPOUND_TRACK_ID);
Assert.assertEquals("composite/work", trackEncoded.getFlavor().toString());
Assert.assertTrue(Arrays.asList(targetTags.split("\\W")).containsAll(Arrays.asList(trackEncoded.getTags())));
}
Aggregations