@Test
    public void testNews7() throws Exception {
        // Testing different variants of increment/decrement/multiply/divide among with alterupdate. In test07.xml there
        // are also some updates that will fail (be skipped).
        VespaXMLFeedReader parser = new VespaXMLFeedReader("src/test/vespaxmlparser/test07.xml", manager);

        FeedOperation op = parser.read();

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

        DocumentUpdate docUpdate = op.getDocumentUpdate();

        List<ValueUpdate> vuList = docUpdate.getFieldUpdate("last_downloaded").getValueUpdates();
        assertEquals(new DoubleFieldValue(2.0), vuList.get(0).getValue());
        assertEquals(new DoubleFieldValue(3.0), vuList.get(1).getValue());
        assertEquals(new DoubleFieldValue(4.0), vuList.get(2).getValue());
        assertEquals(new DoubleFieldValue(5.0), vuList.get(3).getValue());

        assertEquals(new IntegerFieldValue(7), docUpdate.getFieldUpdate("weightedsetint").getValueUpdate(0).getValue());
        assertEquals(new DoubleFieldValue(6.0), ((MapValueUpdate)docUpdate.getFieldUpdate("weightedsetint").getValueUpdate(0))
                .getUpdate().getValue());

        assertEquals(new IntegerFieldValue(9), docUpdate.getFieldUpdate("weightedsetint").getValueUpdate(1).getValue());
        assertEquals(new DoubleFieldValue(8.0), ((MapValueUpdate)docUpdate.getFieldUpdate("weightedsetint").getValueUpdate(1))
                .getUpdate().getValue());

        assertEquals(new IntegerFieldValue(11), docUpdate.getFieldUpdate("intarr").getValueUpdate(0).getValue());
        assertEquals(new DoubleFieldValue(10.0),
                     ((MapValueUpdate)docUpdate.getFieldUpdate("intarr").getValueUpdate(0)).getUpdate().getValue());

        assertEquals(new IntegerFieldValue(13), docUpdate.getFieldUpdate("floatarr").getValueUpdate(0).getValue());
        assertEquals(new DoubleFieldValue(12.0),
                     ((MapValueUpdate)docUpdate.getFieldUpdate("floatarr").getValueUpdate(0)).getUpdate().getValue());

        assertEquals(new IntegerFieldValue(15), docUpdate.getFieldUpdate("floatarr").getValueUpdate(1).getValue());
        assertEquals(new DoubleFieldValue(14.0),
                     ((MapValueUpdate)docUpdate.getFieldUpdate("floatarr").getValueUpdate(1)).getUpdate().getValue());

        // Trying arithmetic on string (b)
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        // "By" as string (c)
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        // Empty key in weighted set of int (d)
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        // No "by" attribute (e)
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        // Float key as string (f)
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
Simple test case for Vespa XML parser.

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