use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class ConfigureByDublinCoreTermWOHTest method testMissingNoDefaultDCTerm.
@Test
public void testMissingNoDefaultDCTerm() throws Exception {
// No Default Value
operation.setConfiguration(ConfigureByDublinCoreTermWOH.DCCATALOG_PROPERTY, "episode");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.DCTERM_PROPERTY, "source");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.MATCH_VALUE_PROPERTY, "Timbuktu");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.COPY_PROPERTY, "false");
operation.setConfiguration("newConfigProperty", "true");
WorkflowOperationResult result = operationHandler.start(instance, null);
Map<String, String> properties = result.getProperties();
Assert.assertTrue(properties == null);
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class ConfigureByDublinCoreTermWOHTest method testMisMatchDefaultDCTerm.
@Test
public void testMisMatchDefaultDCTerm() throws Exception {
// Match != Default Value
operation.setConfiguration(ConfigureByDublinCoreTermWOH.DCCATALOG_PROPERTY, "episode");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.DCTERM_PROPERTY, "source");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.DEFAULT_VALUE_PROPERTY, "Cairo");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.MATCH_VALUE_PROPERTY, "Timbuktu");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.COPY_PROPERTY, "false");
operation.setConfiguration("newConfigProperty", "true");
WorkflowOperationResult result = operationHandler.start(instance, null);
Map<String, String> properties = result.getProperties();
Assert.assertTrue(properties == null);
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class ConfigureByDublinCoreTermWOHTest method testMatchPresentDCTerm.
@Test
public void testMatchPresentDCTerm() throws Exception {
operation.setConfiguration(ConfigureByDublinCoreTermWOH.DCCATALOG_PROPERTY, "episode");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.DCTERM_PROPERTY, "publisher");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.MATCH_VALUE_PROPERTY, "University of Opencast");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.COPY_PROPERTY, "false");
operation.setConfiguration("newConfigProperty", "true");
WorkflowOperationResult result = operationHandler.start(instance, null);
Map<String, String> properties = result.getProperties();
Assert.assertTrue(properties.containsKey("newConfigProperty"));
Assert.assertEquals("true", properties.get("newConfigProperty"));
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class ConfigureByDublinCoreTermWOHTest method testMatchDefaultDCTerm.
@Test
public void testMatchDefaultDCTerm() throws Exception {
// Match == Default Value
operation.setConfiguration(ConfigureByDublinCoreTermWOH.DCCATALOG_PROPERTY, "episode");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.DCTERM_PROPERTY, "source");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.DEFAULT_VALUE_PROPERTY, "Timbuktu");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.MATCH_VALUE_PROPERTY, "Timbuktu");
operation.setConfiguration(ConfigureByDublinCoreTermWOH.COPY_PROPERTY, "false");
operation.setConfiguration("newConfigProperty", "true");
WorkflowOperationResult result = operationHandler.start(instance, null);
Map<String, String> properties = result.getProperties();
Assert.assertTrue(properties.containsKey("newConfigProperty"));
Assert.assertEquals("true", properties.get("newConfigProperty"));
}
use of org.opencastproject.workflow.api.WorkflowOperationResult in project opencast by opencast.
the class DefaultsWorkflowOperationHandlerTest method usesOrganizationLevelPreset.
@Test
public void usesOrganizationLevelPreset() throws WorkflowOperationException, NotFoundException {
Organization organization = EasyMock.createMock(Organization.class);
EasyMock.replay(organization);
String seriesID = "series-ID";
presetProvider = EasyMock.createMock(PresetProvider.class);
EasyMock.expect(presetProvider.getProperty(seriesID, OPT_KEY)).andReturn(ORGANIZATION_PRESET_VALUE);
EasyMock.replay(presetProvider);
// Workflow configuration
Map<String, String> workflowConfiguration = new HashMap<String, String>();
workflowConfiguration.put(OPT_KEY, WORKFLOW_PRESET_VALUE);
WorkflowInstance workflowInstance = setupInstance(organization, seriesID, workflowConfiguration, false);
DefaultsWorkflowOperationHandler handler = new DefaultsWorkflowOperationHandler();
handler.setPresetProvider(presetProvider);
WorkflowOperationResult result = handler.start(workflowInstance, null);
assertEquals(ORGANIZATION_PRESET_VALUE, result.getProperties().get(OPT_KEY));
}
Aggregations