Search in sources :

Example 6 with SubmissionProfile

use of org.javarosa.core.model.SubmissionProfile in project javarosa by opendatakit.

the class XFormParserTest method parseFormWithSubmissionElement.

@Test
public void parseFormWithSubmissionElement() throws IOException {
    // Given & When
    ParseResult parseResult = parse(r("submission-element.xml"));
    // Then
    assertEquals(parseResult.formDef.getTitle(), "Single Submission Element");
    assertNoParseErrors(parseResult);
    SubmissionProfile submissionProfile = parseResult.formDef.getSubmissionProfile();
    assertEquals("http://some.destination.com", submissionProfile.getAction());
    assertEquals("form-data-post", submissionProfile.getMethod());
    assertNull(submissionProfile.getMediaType());
    assertEquals("/data/text", submissionProfile.getRef().getReference().toString());
}
Also used : ParseResult(org.javarosa.xform.parse.FormParserHelper.ParseResult) SubmissionProfile(org.javarosa.core.model.SubmissionProfile) Test(org.junit.Test)

Aggregations

SubmissionProfile (org.javarosa.core.model.SubmissionProfile)6 IDataReference (org.javarosa.core.model.IDataReference)4 FormDef (org.javarosa.core.model.FormDef)3 XPathReference (org.javarosa.model.xform.XPathReference)2 Test (org.junit.Test)2 DataBinding (org.javarosa.core.model.DataBinding)1 IAnswerData (org.javarosa.core.model.data.IAnswerData)1 StringData (org.javarosa.core.model.data.StringData)1 FormInstance (org.javarosa.core.model.instance.FormInstance)1 TreeElement (org.javarosa.core.model.instance.TreeElement)1 DummyReference (org.javarosa.core.model.test.DummyReference)1 ParseResult (org.javarosa.xform.parse.FormParserHelper.ParseResult)1 Element (org.kxml2.kdom.Element)1 ODKIncompleteSubmissionData (org.opendatakit.aggregate.exception.ODKIncompleteSubmissionData)1