};
FreemarkerModel.set(model);
int nsCount = model.getNamespacesToPrefixes().size();
ClassDeclaration declaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.BeanThree");
TypeDefinition typeDef1 = new ComplexTypeDefinition(declaration);
RootElementDeclaration element1 = new RootElementDeclaration(declaration, typeDef1);
String targetNamespace = element1.getNamespace();
assertNull(model.findRootElementDeclaration(element1));
model.add(element1);
SchemaInfo schemaInfo = model.getNamespacesToSchemas().get(targetNamespace);
assertNull("The element form default should not have been set.", schemaInfo.getElementFormDefault());
assertNull("The attribute form default should not have been set.", schemaInfo.getAttributeFormDefault());
assertNotNull("The model should have created a schema information associated with a new type definition.", schemaInfo);
assertTrue(model.rootElements.contains(element1));
assertNotNull(model.findRootElementDeclaration(element1));
assertEquals(targetNamespace, schemaInfo.getNamespace());
nsCount += 1;
assertEquals("There should have been one and only one new namespace added", nsCount, model.getNamespacesToPrefixes().size());
declaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.BeanThree");
ComplexTypeDefinition typeDef2 = new ComplexTypeDefinition(declaration);
RootElementDeclaration element2 = new RootElementDeclaration(declaration, typeDef2);
targetNamespace = element2.getNamespace();
assertNull(model.findRootElementDeclaration(element2));
model.add(element2);
schemaInfo = model.getNamespacesToSchemas().get(targetNamespace);
assertNotNull("The model should have created a schema information associated with a new type definition.", schemaInfo);
assertTrue(model.rootElements.contains(element2));
assertNotNull(model.findRootElementDeclaration(element2));
assertEquals(targetNamespace, schemaInfo.getNamespace());
assertEquals("qualified", schemaInfo.getElementFormDefault());
assertEquals("qualified", schemaInfo.getAttributeFormDefault());
nsCount += 3;
assertEquals("There should have been three new namespaces added, as specified in the package info for the schema.", nsCount, model.getNamespacesToPrefixes().size());
declaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.BeanFour");
ComplexTypeDefinition typeDef3 = new ComplexTypeDefinition(declaration);
RootElementDeclaration element3 = new RootElementDeclaration(declaration, typeDef3);
targetNamespace = element3.getNamespace();
assertNull(model.findRootElementDeclaration(element3));
model.add(element3);
schemaInfo = model.getNamespacesToSchemas().get(targetNamespace);
assertNotNull("The model should have created a schema information associated with a new type definition.", schemaInfo);
assertTrue(model.rootElements.contains(element3));