@Test
    public void testFieldPathUpdates() throws Exception {
        // Adding a few new fields to a Document using different syntax
        VespaXMLFeedReader parser = new VespaXMLFeedReader("src/tests/vespaxml/fieldpathupdates.xml", manager);

        FeedOperation op = parser.read();

        assertEquals(FeedOperation.Type.UPDATE, op.getType());

        DocumentUpdate docUpdate = op.getDocumentUpdate();

        assertEquals(20, docUpdate.fieldPathUpdates().size());

        Iterator<FieldPathUpdate> updates = docUpdate.fieldPathUpdates().iterator();
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("url", ass.getOriginalFieldPath());
            assertEquals(new StringFieldValue("assignUrl"), ass.getNewValue());
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("title", ass.getOriginalFieldPath());
            assertEquals(new StringFieldValue("assignTitle"), ass.getNewValue());
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("last_downloaded", ass.getOriginalFieldPath());
            assertEquals("1", ass.getExpression());
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("value_long", ass.getOriginalFieldPath());
            assertEquals("2", ass.getExpression());
        }
        updates.next();  // Skip number 5
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("stringarr", ass.getOriginalFieldPath());
            assertEquals("[assignString1, assignString2]", ass.getNewValue().toString());
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("intarr", ass.getOriginalFieldPath());
            assertEquals("[3, 4]", ass.getNewValue().toString());
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("longarr", ass.getOriginalFieldPath());
            assertEquals("[5, 6]", ass.getNewValue().toString());
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("bytearr", ass.getOriginalFieldPath());
            assertEquals("[7, 8]", ass.getNewValue().toString());
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("floatarr", ass.getOriginalFieldPath());
            assertEquals("[9.0, 10.0]", ass.getNewValue().toString());
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("weightedsetint", ass.getOriginalFieldPath());
            WeightedSet set = (WeightedSet)ass.getNewValue();
            assertEquals(Integer.valueOf(11), set.get(new IntegerFieldValue(11)));
            assertEquals(Integer.valueOf(12), set.get(new IntegerFieldValue(12)));
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("weightedsetstring", ass.getOriginalFieldPath());
            WeightedSet set = (WeightedSet)ass.getNewValue();
            assertEquals(Integer.valueOf(13), set.get(new StringFieldValue("assign13")));
            assertEquals(Integer.valueOf(14), set.get(new StringFieldValue("assign14")));
        }
        {
            AddFieldPathUpdate ass = (AddFieldPathUpdate)updates.next();
            assertEquals("stringarr", ass.getOriginalFieldPath());
            assertEquals("[addString1, addString2]", ass.getNewValues().toString());
        }
        {
            AddFieldPathUpdate ass = (AddFieldPathUpdate)updates.next();
            assertEquals("longarr", ass.getOriginalFieldPath());
            assertEquals("[5]", ass.getNewValues().toString());
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("weightedsetint{13}", ass.getOriginalFieldPath());
            assertEquals("13", ass.getExpression());
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("weightedsetint{14}", ass.getOriginalFieldPath());
            assertEquals("14", ass.getExpression());
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("weightedsetstring{add13}", ass.getOriginalFieldPath());
            assertEquals("1", ass.getExpression());
        }
        {
            AssignFieldPathUpdate ass = (AssignFieldPathUpdate)updates.next();
            assertEquals("weightedsetstring{assign13}", ass.getOriginalFieldPath());
            assertEquals("130", ass.getExpression());
        }
        {
            RemoveFieldPathUpdate ass = (RemoveFieldPathUpdate)updates.next();
            assertEquals("weightedsetstring{assign14}", ass.getOriginalFieldPath());
        }
        {
            RemoveFieldPathUpdate ass = (RemoveFieldPathUpdate)updates.next();
            assertEquals("bytearr", ass.getOriginalFieldPath());
        }
        Document doc = new Document(manager.getDocumentType("news"), new DocumentId("id:ns:news::test"));
        docUpdate.applyTo(doc);
    }
Simple test case for Vespa XML parser.

@author sveina
document/src/test/java/com/yahoo/vespaxmlparser/VespaXMLReaderTestCase.java