@Test
    public void testBasicDoc() {
        Music music = getMusicBasic();
        Field artist = music.getField("artist");
        assertEquals(artist, new Field("artist", DataType.STRING));
        assertEquals(artist.getDataType(), DataType.STRING);
        StringFieldValue astroburger = new StringFieldValue("Astroburger");
        assertEquals(music.getFieldValue(artist).getWrappedValue(), astroburger.getString());
        assertEquals(music.getFieldValue("year").getWrappedValue(), 2005);
        assertEquals(music.getFieldValue("artist"), astroburger);
        assertEquals(music.getFieldValue(artist), astroburger);
        assertEquals(music.getFieldValue("artist"), astroburger);

        music.setYear(2006);
        assertEquals(music.getFieldValue("year").getWrappedValue(), 2006);
        music.setArtist("Don Bingo's Astroburger");
        assertEquals(artist, new Field("artist", DataType.STRING));
        assertEquals(artist.getDataType(), DataType.STRING);
        assertEquals(music.getFieldValue(artist).getWrappedValue(), "Don Bingo's Astroburger");
        StringFieldValue bingoAstroburger = new StringFieldValue("Don Bingo's Astroburger");
        assertEquals(music.getFieldValue("artist"), bingoAstroburger);
        assertEquals(music.getFieldValue(artist), bingoAstroburger);
        assertEquals(music.getFieldValue("artist"), bingoAstroburger);

        assertNull(music.getFieldValue(new Field("nonexisting")));
        assertNull(music.getFieldValue("nono"));
        assertNull(music.getField("nope"));
        assertNull(music.getFieldValue(new Field("nada")));
        assertNull(music.getFieldValue("zilch"));
        assertNull(music.getFieldValue("zero"));

        assertNull(music.removeFieldValue("nothere"));
        assertNull(music.removeFieldValue(new Field("nothereno")));
        assertNull(music.removeFieldValue(new Field("invalid")));
        assertNull(music.removeFieldValue("goner"));
        assertNull(music.removeFieldValue("absent"));
    }
Tests vespa-documentgen-plugin

@author vegardh
documentgen-test/src/test/java/com/yahoo/vespa/config/DocumentGenPluginTest.java