@Before
    public void setUp() throws Exception {
        parserFactory = new JsonFactory();
        types = new DocumentTypeManager();
        {
            DocumentType x = new DocumentType("smoke");
            x.addField(new Field("something", DataType.STRING));
            x.addField(new Field("nalle", DataType.STRING));
            x.addField(new Field("field1", DataType.STRING));
            x.addField(new Field("field2", DataType.STRING));
            x.addField(new Field("int1", DataType.INT));
            x.addField(new Field("flag", DataType.BOOL));
            x.addField(new Field("tensor1", DataType.getTensor(TensorType.fromSpec("tensor(x{})"))));
            types.registerDocumentType(x);
        }
        {
            DocumentType x = new DocumentType("mirrors");
            StructDataType woo = new StructDataType("woo");
            woo.addField(new Field("sandra", DataType.STRING));
            woo.addField(new Field("cloud", DataType.STRING));
            x.addField(new Field("skuggsjaa", woo));
            types.registerDocumentType(x);
        }
        {
            DocumentType x = new DocumentType("testarray");
            DataType d = new ArrayDataType(DataType.STRING);
            x.addField(new Field("actualarray", d));
            types.registerDocumentType(x);
        }
        {
            DocumentType x = new DocumentType("testset");
            DataType d = new WeightedSetDataType(DataType.STRING, true, true);
            x.addField(new Field("actualset", d));
            types.registerDocumentType(x);
        }
        {
            DocumentType x = new DocumentType("testmap");
            DataType d = new MapDataType(DataType.STRING, DataType.STRING);
            x.addField(new Field("actualmap", d));
            types.registerDocumentType(x);
        }
        {
            DocumentType x = new DocumentType("testraw");
            DataType d = DataType.RAW;
            x.addField(new Field("actualraw", d));
            types.registerDocumentType(x);
        }
        {
            DocumentType x = new DocumentType("testMapStringToArrayOfInt");
            DataType value = new ArrayDataType(DataType.INT);
            DataType d = new MapDataType(DataType.STRING, value);
            x.addField(new Field("actualMapStringToArrayOfInt", d));
            types.registerDocumentType(x);
        }
        {
            DocumentType x = new DocumentType("testArrayOfArrayOfInt");
            DataType inner = new ArrayDataType(DataType.INT);
            DataType outer = new ArrayDataType(inner);
            x.addField(new Field("arrayOfArrayOfInt", outer));
            types.registerDocumentType(x);
        }
        {
            DocumentType x = new DocumentType("testsinglepos");
            DataType d = PositionDataType.INSTANCE;
            x.addField(new Field("singlepos", d));
            x.addField(new Field("geopos", new GeoPosType(8)));
            types.registerDocumentType(x);
        }
        {
            DocumentType x = new DocumentType("testtensor");
            x.addField(new Field("sparse_single_dimension_tensor",
                                 new TensorDataType(new TensorType.Builder().mapped("x").build())));
            x.addField(new Field("sparse_tensor",
                                 new TensorDataType(new TensorType.Builder().mapped("x").mapped("y").build())));
            x.addField(new Field("dense_tensor",
                    new TensorDataType(new TensorType.Builder().indexed("x", 2).indexed("y", 3).build())));
            x.addField(new Field("dense_int8_tensor",
                    new TensorDataType(TensorType.fromSpec("tensor<int8>(x[2],y[3])"))));
            x.addField(new Field("dense_float_tensor",
                    new TensorDataType(TensorType.fromSpec("tensor<float>(y[3])"))));
            x.addField(new Field("dense_unbound_tensor",
                    new TensorDataType(new TensorType.Builder().indexed("x").indexed("y").build())));
            x.addField(new Field("mixed_tensor",
                    new TensorDataType(new TensorType.Builder().mapped("x").indexed("y", 3).build())));
            x.addField(new Field("mixed_bfloat16_tensor",
                    new TensorDataType(TensorType.fromSpec("tensor<bfloat16>(x{},y[3])"))));
            x.addField(new Field("mixed_tensor_adv",
                    new TensorDataType(new TensorType.Builder().mapped("x").mapped("y").mapped("z").indexed("a", 3).build())));
            types.registerDocumentType(x);
        }
        {
            DocumentType x = new DocumentType("testpredicate");
            x.addField(new Field("boolean", DataType.PREDICATE));
            types.registerDocumentType(x);
        }
        {
            DocumentType x = new DocumentType("testint");
            x.addField(new Field("integerfield", DataType.INT));
            types.registerDocumentType(x);
        }
        {
            DocumentType x = new DocumentType("testnull");
            x.addField(new Field("intfield", DataType.INT));
            x.addField(new Field("stringfield", DataType.STRING));
            x.addField(new Field("arrayfield", new ArrayDataType(DataType.STRING)));
            x.addField(new Field("weightedsetfield", new WeightedSetDataType(DataType.STRING, true, true)));
            x.addField(new Field("mapfield",  new MapDataType(DataType.STRING, DataType.STRING)));
            x.addField(new Field("tensorfield", new TensorDataType(new TensorType.Builder().indexed("x").build())));
            types.registerDocumentType(x);
        }
    }
Basic test of JSON streams to Vespa document instances.

@author Steinar Knutsen
@author bratseth
document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java