use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class TagByDublinCoreTermWOHTest method testNoMatchConfiguredDCTerm.
@Test
public void testNoMatchConfiguredDCTerm() throws Exception {
// No Match or Default Value
// without dcterm or default the match should always fail
operation.setConfiguration(TagByDublinCoreTermWOH.SOURCE_FLAVORS_PROPERTY, "dublincore/*");
operation.setConfiguration(TagByDublinCoreTermWOH.DCCATALOG_PROPERTY, "episode");
operation.setConfiguration(TagByDublinCoreTermWOH.DCTERM_PROPERTY, "source");
operation.setConfiguration(TagByDublinCoreTermWOH.TARGET_TAGS_PROPERTY, "tag1,tag2");
operation.setConfiguration(TagByDublinCoreTermWOH.COPY_PROPERTY, "false");
WorkflowOperationResult result = operationHandler.start(instance, null);
MediaPackage resultingMediapackage = result.getMediaPackage();
Catalog catalog = resultingMediapackage.getCatalog("catalog-1");
Assert.assertEquals(1, catalog.getTags().length);
Assert.assertEquals("archive", catalog.getTags()[0]);
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class CopyWorkflowOperationHandlerTest method testCopyWithTwoElementsMatchingFlavorsTags.
@Test
public void testCopyWithTwoElementsMatchingFlavorsTags() throws Exception {
// operation configuration
Map<String, String> configurations = new HashMap<String, String>();
configurations.put(CopyWorkflowOperationHandler.OPT_SOURCE_FLAVORS, "*/source");
configurations.put(CopyWorkflowOperationHandler.OPT_TARGET_DIRECTORY, videoFile.getParent());
configurations.put(CopyWorkflowOperationHandler.OPT_TARGET_FILENAME, "testCopy");
// run the operation handler
try {
WorkflowOperationResult result = getWorkflowOperationResult(mp, configurations);
Assert.assertEquals(Action.CONTINUE, result.getAction());
} catch (WorkflowOperationException e) {
Assert.fail("The workflow should ");
}
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class CloneWorkflowOperationHandlerTest method testWildcardTargetFlavorTypeAndSubtype.
@Test
public void testWildcardTargetFlavorTypeAndSubtype() throws Exception {
// operation configuration
Map<String, String> configurations = new HashMap<String, String>();
configurations.put(CloneWorkflowOperationHandler.OPT_SOURCE_FLAVOR, "*/source");
configurations.put(CloneWorkflowOperationHandler.OPT_TARGET_FLAVOR, "*/*");
// run the operation handler
WorkflowOperationResult result = getWorkflowOperationResult(mp, configurations);
Assert.assertEquals(Action.CONTINUE, result.getAction());
MediaPackageElementFlavor newFlavor = MediaPackageElementFlavor.parseFlavor("presentation/source");
Assert.assertTrue(result.getMediaPackage().getElementsByFlavor(newFlavor).length == 2);
newFlavor = MediaPackageElementFlavor.parseFlavor("presenter/source");
Assert.assertTrue(result.getMediaPackage().getElementsByFlavor(newFlavor).length == 2);
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class CloneWorkflowOperationHandlerTest method testWildcardTargetFlavorSubtype.
@Test
public void testWildcardTargetFlavorSubtype() throws Exception {
// operation configuration
Map<String, String> configurations = new HashMap<String, String>();
configurations.put(CloneWorkflowOperationHandler.OPT_SOURCE_FLAVOR, "*/source");
configurations.put(CloneWorkflowOperationHandler.OPT_TARGET_FLAVOR, "targettype/*");
// run the operation handler
WorkflowOperationResult result = getWorkflowOperationResult(mp, configurations);
Assert.assertEquals(Action.CONTINUE, result.getAction());
MediaPackageElementFlavor newFlavor = MediaPackageElementFlavor.parseFlavor("targettype/source");
Assert.assertTrue(result.getMediaPackage().getElementsByFlavor(newFlavor).length == 2);
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class CloneWorkflowOperationHandlerTest method testWildcardSourceFlavor.
@Test
public void testWildcardSourceFlavor() throws Exception {
// operation configuration
Map<String, String> configurations = new HashMap<String, String>();
configurations.put(CloneWorkflowOperationHandler.OPT_SOURCE_FLAVOR, "*/source");
configurations.put(CloneWorkflowOperationHandler.OPT_TARGET_FLAVOR, "*/target");
// run the operation handler
WorkflowOperationResult result = getWorkflowOperationResult(mp, configurations);
Assert.assertEquals(Action.CONTINUE, result.getAction());
MediaPackageElementFlavor newFlavor = MediaPackageElementFlavor.parseFlavor("*/target");
Assert.assertTrue(result.getMediaPackage().getElementsByFlavor(newFlavor).length == 2);
}
Aggregations