public void testRecordVTNested() throws Exception {
String ns = "testRecordVTNested";
// Create a fieldType to be used as a field in a record type to be used as the type for a RecordValueType
FieldType fieldType1 = typeManager.createFieldType(typeManager.newFieldType(typeManager.getValueType("STRING"), new QName(ns, "field1"), Scope.NON_VERSIONED));
// Create a record type to be used as the type for a RecordValueType
RecordType rt1 = typeManager.recordTypeBuilder()
.name(new QName(ns, "rt1"))
.field(fieldType1.getId(), false)
.create();
// Make a RecordValueType with the record type specified
ValueType recordVT1 = typeManager.getValueType("RECORD<{"+ns+"}rt1>");
// Create a fieldType with as value type a RecordValueType
FieldType fieldType2 = typeManager.createFieldType(typeManager.newFieldType(recordVT1, new QName(ns, "field2"), Scope.NON_VERSIONED));
// Create a recordType with a field of this field type
RecordType rt2 = typeManager.recordTypeBuilder()
.name(new QName(ns, "rt2"))
.field(fieldType2.getId(), false)
.create();
// Create a fieldType with as value type a 'nested' RecordValueType
ValueType recordVT2 = typeManager.getValueType("RECORD<{"+ns+"}rt2>");
FieldType fieldType3 = typeManager.createFieldType(typeManager.newFieldType(recordVT2, new QName(ns, "field3"), Scope.NON_VERSIONED));
RecordType rt3 = typeManager.recordTypeBuilder()
.name(new QName(ns, "rt3"))
.field(fieldType3.getId(), false)
.create();
// Make nested records