public void testRefreshBasicSchema() throws ResourceException {
    MWXmlSchema basicSchema = this.loadSchema("BasicSchema");
    int originalAttributeCount = basicSchema.attributeCount();
    int originalElementCount = basicSchema.elementCount();
    int originalTypeCount = basicSchema.typeCount();
    int originalGroupCount = basicSchema.modelGroupDefinitionCount();

    basicSchema.reload();

    assertTrue(
        "The number of attributes changed.",
        basicSchema.attributeCount() == originalAttributeCount);
    assertTrue(
        "The number of elements changed.", basicSchema.elementCount() == originalElementCount);
    assertTrue("The number of types changed.", basicSchema.typeCount() == originalTypeCount);
    assertTrue(
        "The number of groups changed.",
        basicSchema.modelGroupDefinitionCount() == originalGroupCount);

    this.reloadSchema(basicSchema, "BasicSchemaWithComponentsRemoved");

    assertTrue(
        "The number of attributes did not decrease.",
        basicSchema.attributeCount() < originalAttributeCount);
    assertTrue(
        "The number of elements did not decrease.",
        basicSchema.elementCount() < originalElementCount);
    assertTrue(
        "The number of types did not decrease.", basicSchema.typeCount() < originalTypeCount);
    assertTrue(
        "The number of groups did not decrease.",
        basicSchema.modelGroupDefinitionCount() < originalGroupCount);

    this.reloadSchema(basicSchema, "BasicSchemaWithComponentsAdded");

    assertTrue(
        "The number of attributes did not increase.",
        basicSchema.attributeCount() > originalAttributeCount);
    assertTrue(
        "The number of elements did not increase.",
        basicSchema.elementCount() > originalElementCount);
    assertTrue(
        "The number of types did not increase.", basicSchema.typeCount() > originalTypeCount);
    assertTrue(
        "The number of groups did not increase.",
        basicSchema.modelGroupDefinitionCount() > originalGroupCount);
  }