Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-10518

Need whitebox testing of FieldProperties constants & SchemaField.getNamedPropertyValues(true)

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      SOLR-10439 is an example of a bug in SchemaField.getNamedPropertyValues(true) that could have been caught if we had an automated whitebox test of all known field properties.

      we should add some tests to ensure future bugs like this don't surprise us again...

      • add a static FieldPropertiesExposer extends FieldProperties
        • include a new method to use reflection to expose all protected final static int constants inherited from FieldProperties
        • include new public methods to expose propertyNames[] propertyNameToInt(String) and getPropertyName(int)
      • assert that the number int constants is the same as propertyNames.size
      • loop over all property names and confirm a round trip of getPropertyName(propertyNameToInt(name))
      • loop over all constnats and confirm a round trip of propertyNameToInt(getPropertyName(constant))
      • use the IndexSchema (pointed at some relatively robust kitchen sink of a schema.xml) to loop over every FieldType, SchemaField and DynamicField.getPrototype():
        • for each one, verify that getNamedPropertyValues(true) returns a map with size()==FieldPropertiesExposer.propertyNames.length
          • minus any special cases that are deliberaly excuded, like BINARY.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hossman Chris M. Hostetter
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: