Created
January 10, 2012 21:32
-
-
Save livando/1591323 to your computer and use it in GitHub Desktop.
EnterMedia ingest without http
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testVisualDataIngest() throws Exception { | |
String testname = "ingest"; | |
String sourcepath = "test/" + testname + ".mp4"; | |
PostMethod method = getIngestPostMethod(sourcepath, testname); | |
assertEquals(200, getClient().executeMethod(method)); | |
Element root = getXml(method.getResponseBodyAsStream()); | |
assertTrue(root.elements().size() > 0); | |
String id = ((Element) root.elements().get(0)).attributeValue("id"); | |
assertNotNull(id); | |
} | |
private PostMethod getIngestPostMethod(String sourcepath, String testname){ | |
PostMethod method = new PostMethod(getServerUrl() | |
+ getDefaultApplicationId() + "/services/rest/importassets.xml"); | |
method.addParameter("catalogid", getDefaultCatalogId()); | |
method.addParameter("sourcepath", sourcepath); | |
method.addParameter("field", "caption"); | |
method.addParameter("caption.value", testname); | |
method.addParameter("field", "editstatus"); | |
method.addParameter("editstatus.value", "1"); | |
return method; | |
} | |
protected String getServerUrl() { | |
return QA; | |
} | |
protected String getDefaultCatalogId() { | |
return "media/catalogs/client1"; | |
} | |
protected String getDefaultApplicationId() { | |
return "media"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment