@Test
    public void testSetUnknownType() {
        StructDataType type = new StructDataType("teststr");
        type.addField(new Field("int", 0, DataType.INT));

        Struct struct = new Struct(type);
        try {
            struct.setFieldValue(new Field("alien", DataType.STRING), new StringFieldValue("foo"));
            fail("Alien type worked");
        } catch (IllegalArgumentException expected) {
            assertTrue(expected.getMessage().matches(".*No such field.*"));
        }
    }
@author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
document/src/test/java/com/yahoo/document/datatypes/StructTestCase.java