@Test
    public void testNews6() throws Exception {
        // A document containing fields with invalid values. Different variants are used All of the updates specified in
        // XML-file should be skipped and not added to queue Except the three of them
        VespaXMLFeedReader parser = new VespaXMLFeedReader("src/test/vespaxmlparser/test06.xml", manager);

        // long value with txt
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        // empty string
        FeedOperation op = parser.read();
        assertEquals("id:ns:news::http://news6b", op.getDocumentPut().getDocument().getId().toString());

        // int array with text
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        // long array with whitespace
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        // byte array with value
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        // float array with string
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        // weighted set of int with string
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        // weighted set of int with string as weight
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        // weighted set of string with string as weight
        try {
            parser.read();
            fail();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        op = parser.read();
        assertEquals("id:ns:news::http://news6j", op.getDocumentPut().getDocument().getId().toString());

        op = parser.read();
        assertEquals(FeedOperation.Type.INVALID, op.getType());
    }
Simple test case for Vespa XML parser.

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