Search in sources :

Example 1 with EditingInfo

use of org.opencastproject.adminui.endpoint.ToolsEndpoint.EditingInfo in project opencast by opencast.

the class ToolsEndpointTest method testEditingInfoParse.

/**
 * Test method for {@link ToolsEndpoint.EditingInfo#parse(JSONObject)}
 */
@Test
public void testEditingInfoParse() throws Exception {
    JSONParser parser = new JSONParser();
    final EditingInfo editingInfo = ToolsEndpoint.EditingInfo.parse((JSONObject) parser.parse(IOUtils.toString(getClass().getResourceAsStream("/tools/POST-editor.json"))));
    final List<Tuple<Long, Long>> segments = editingInfo.getConcatSegments();
    assertEquals(4, segments.size());
    assertTrue(segments.contains(Tuple.tuple(0L, 2449L)));
    assertTrue(segments.contains(Tuple.tuple(4922L, 11284L)));
    assertTrue(segments.contains(Tuple.tuple(14721L, 15963L)));
    assertTrue(segments.contains(Tuple.tuple(15963L, 20132L)));
    final List<String> tracks = editingInfo.getConcatTracks();
    assertEquals(1, tracks.size());
    assertEquals(some("cut-workflow"), editingInfo.getPostProcessingWorkflow());
}
Also used : EditingInfo(org.opencastproject.adminui.endpoint.ToolsEndpoint.EditingInfo) JSONParser(org.json.simple.parser.JSONParser) Tuple(org.opencastproject.util.data.Tuple) Test(org.junit.Test)

Aggregations

JSONParser (org.json.simple.parser.JSONParser)1 Test (org.junit.Test)1 EditingInfo (org.opencastproject.adminui.endpoint.ToolsEndpoint.EditingInfo)1 Tuple (org.opencastproject.util.data.Tuple)1