Search in sources :

Example 6 with FormParseInit

use of org.javarosa.core.test.FormParseInit in project javarosa by opendatakit.

the class FormDefTest method setUp.

public void setUp() {
    fpi = new FormParseInit();
    q = fpi.getFirstQuestionDef();
    fep = new FormEntryPrompt(fpi.getFormDef(), fpi.getFormEntryModel().getFormIndex());
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) FormParseInit(org.javarosa.core.test.FormParseInit)

Example 7 with FormParseInit

use of org.javarosa.core.test.FormParseInit in project javarosa by opendatakit.

the class TextFormTests method setUp.

public void setUp() {
    fpi = new FormParseInit();
    q = fpi.getFirstQuestionDef();
    fep = new FormEntryPrompt(fpi.getFormDef(), fpi.getFormEntryModel().getFormIndex());
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) DummyFormEntryPrompt(org.javarosa.core.model.test.DummyFormEntryPrompt) FormParseInit(org.javarosa.core.test.FormParseInit)

Example 8 with FormParseInit

use of org.javarosa.core.test.FormParseInit in project javarosa by opendatakit.

the class FormIndexSerializationTest method testOnFormController.

@Test
public void testOnFormController() throws IOException, ClassNotFoundException {
    FormParseInit formParseInit = new FormParseInit();
    formParseInit.setFormToParse(Paths.get(PathConst.getTestResourcePath().getAbsolutePath(), "formindex-serialization.xml").toString());
    FormEntryController formEntryController = formParseInit.getFormEntryController();
    FormIndex formIndex = formEntryController.getModel().getFormIndex();
    assertFormIndex(formIndex, deserializeFormIndex(serializeObject(formIndex)));
    do {
        formIndex = formEntryController.getModel().incrementIndex(formIndex);
        assertFormIndex(formIndex, deserializeFormIndex(serializeObject(formIndex)));
    } while (!formIndex.isEndOfFormIndex());
}
Also used : FormEntryController(org.javarosa.form.api.FormEntryController) FormIndex(org.javarosa.core.model.FormIndex) FormParseInit(org.javarosa.core.test.FormParseInit) Test(org.junit.Test)

Aggregations

FormParseInit (org.javarosa.core.test.FormParseInit)8 Before (org.junit.Before)3 Test (org.junit.Test)3 FormEntryController (org.javarosa.form.api.FormEntryController)2 FormEntryPrompt (org.javarosa.form.api.FormEntryPrompt)2 IOException (java.io.IOException)1 FormDef (org.javarosa.core.model.FormDef)1 FormIndex (org.javarosa.core.model.FormIndex)1 InstanceInitializationFactory (org.javarosa.core.model.instance.InstanceInitializationFactory)1 TreeElement (org.javarosa.core.model.instance.TreeElement)1 DummyFormEntryPrompt (org.javarosa.core.model.test.DummyFormEntryPrompt)1