public void testReplacewithField() throws Exception {
doc = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(TEXT_FILE));
TextDocument sourcedoc = TextDocument.newTextDocument();
sourcedoc.addParagraph("Hello1 from SIMPLE source document!");
sourcedoc.addParagraph("Hello2 from source document!");
sourcedoc.addParagraph("Hello3 from source document!");
VariableField variableField = Fields.createUserVariableField(sourcedoc, "test_simple_variable","testReplacewithField");
Assert.assertNotNull(variableField);
TextSpanElement newTextSpanElement = sourcedoc.newParagraph("Update Variable Field:").newTextSpanElement();
variableField.updateField("simple variable content", newTextSpanElement);
newTextSpanElement = sourcedoc.newParagraph("Show Variable Field:").newTextSpanElement();