SOLR-11102: Randomize PointFields in schema-rest.xml and all affected tests

This commit is contained in:
Chris Hostetter 2017-07-18 10:50:23 -07:00
parent dd5be42e6c
commit 8ecbb97256
4 changed files with 23 additions and 16 deletions

View File

@ -505,6 +505,7 @@ Other Changes
- SOLR-11105: Randomize PointFields in "cloud-minimal-jmx" and "cloud-minimal-inplace-updates" test configsets (Steve Rowe) - SOLR-11105: Randomize PointFields in "cloud-minimal-jmx" and "cloud-minimal-inplace-updates" test configsets (Steve Rowe)
- SOLR-11109: Randomize PointFields in "cloud-subdirs" and "configset-2" test configsets (Steve Rowe) - SOLR-11109: Randomize PointFields in "cloud-subdirs" and "configset-2" test configsets (Steve Rowe)
- SOLR-11110: Randomize PointFields in "cloud-managed" and "cloud-managed-upgrade" test configsets (Steve Rowe) - SOLR-11110: Randomize PointFields in "cloud-managed" and "cloud-managed-upgrade" test configsets (Steve Rowe)
- SOLR-11102: Randomize PointFields in schema-rest.xml and all affected tests (hossman)
* SOLR-6807: Changed requestDispatcher's handleSelect to default to false, thus ignoring "qt". * SOLR-6807: Changed requestDispatcher's handleSelect to default to false, thus ignoring "qt".
Simplified configs to not refer to handleSelect or "qt". Switch all tests that assumed true to assume false Simplified configs to not refer to handleSelect or "qt". Switch all tests that assumed true to assume false

View File

@ -31,15 +31,15 @@
1.5: omitNorms defaults to true for primitive field types (int, float, boolean, string...) 1.5: omitNorms defaults to true for primitive field types (int, float, boolean, string...)
1.6: useDocValuesAsStored defaults to true. 1.6: useDocValuesAsStored defaults to true.
--> -->
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/> <fieldType name="int" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/> <fieldType name="float" class="${solr.tests.FloatFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/> <fieldType name="long" class="${solr.tests.LongFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/> <fieldType name="double" class="${solr.tests.DoubleFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/> <fieldType name="tint" class="${solr.tests.IntegerFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="8" positionIncrementGap="0"/>
<fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/> <fieldType name="tfloat" class="${solr.tests.FloatFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="8" positionIncrementGap="0"/>
<fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/> <fieldType name="tlong" class="${solr.tests.LongFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="8" positionIncrementGap="0"/>
<fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/> <fieldType name="tdouble" class="${solr.tests.DoubleFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="8" positionIncrementGap="0"/>
<!-- Field type demonstrating an Analyzer failure --> <!-- Field type demonstrating an Analyzer failure -->
<fieldType name="failtype1" class="solr.TextField"> <fieldType name="failtype1" class="solr.TextField">
@ -96,8 +96,8 @@
<!-- format for date is 1995-12-31T23:59:59.999Z and only the fractional <!-- format for date is 1995-12-31T23:59:59.999Z and only the fractional
seconds part (.999) is optional. seconds part (.999) is optional.
--> -->
<fieldType name="date" class="solr.TrieDateField" sortMissingLast="true"/> <fieldType name="date" class="${solr.tests.DateFieldType}" docValues="${solr.tests.numeric.dv}" sortMissingLast="true"/>
<fieldType name="tdate" class="solr.TrieDateField" sortMissingLast="true" precisionStep="6"/> <fieldType name="tdate" class="${solr.tests.DateFieldType}" docValues="${solr.tests.numeric.dv}" sortMissingLast="true" precisionStep="6"/>
<fieldType name="text" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true"> <fieldType name="text" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
<analyzer type="index"> <analyzer type="index">

View File

@ -21,13 +21,14 @@ import org.junit.Test;
public class TestDynamicFieldResource extends SolrRestletTestBase { public class TestDynamicFieldResource extends SolrRestletTestBase {
@Test @Test
public void testGetDynamicField() throws Exception { public void testGetDynamicField() throws Exception {
final boolean expectedDocValues = Boolean.getBoolean(NUMERIC_DOCVALUES_SYSPROP);
assertQ("/schema/dynamicfields/*_i?indent=on&wt=xml&showDefaults=on", assertQ("/schema/dynamicfields/*_i?indent=on&wt=xml&showDefaults=on",
"count(/response/lst[@name='dynamicField']) = 1", "count(/response/lst[@name='dynamicField']) = 1",
"/response/lst[@name='dynamicField']/str[@name='name'] = '*_i'", "/response/lst[@name='dynamicField']/str[@name='name'] = '*_i'",
"/response/lst[@name='dynamicField']/str[@name='type'] = 'int'", "/response/lst[@name='dynamicField']/str[@name='type'] = 'int'",
"/response/lst[@name='dynamicField']/bool[@name='indexed'] = 'true'", "/response/lst[@name='dynamicField']/bool[@name='indexed'] = 'true'",
"/response/lst[@name='dynamicField']/bool[@name='stored'] = 'true'", "/response/lst[@name='dynamicField']/bool[@name='stored'] = 'true'",
"/response/lst[@name='dynamicField']/bool[@name='docValues'] = 'false'", "/response/lst[@name='dynamicField']/bool[@name='docValues'] = '"+expectedDocValues+"'",
"/response/lst[@name='dynamicField']/bool[@name='termVectors'] = 'false'", "/response/lst[@name='dynamicField']/bool[@name='termVectors'] = 'false'",
"/response/lst[@name='dynamicField']/bool[@name='termPositions'] = 'false'", "/response/lst[@name='dynamicField']/bool[@name='termPositions'] = 'false'",
"/response/lst[@name='dynamicField']/bool[@name='termOffsets'] = 'false'", "/response/lst[@name='dynamicField']/bool[@name='termOffsets'] = 'false'",
@ -50,12 +51,13 @@ public class TestDynamicFieldResource extends SolrRestletTestBase {
@Test @Test
public void testJsonGetDynamicField() throws Exception { public void testJsonGetDynamicField() throws Exception {
final boolean expectedDocValues = Boolean.getBoolean(NUMERIC_DOCVALUES_SYSPROP);
assertJQ("/schema/dynamicfields/*_i?indent=on&showDefaults=on", assertJQ("/schema/dynamicfields/*_i?indent=on&showDefaults=on",
"/dynamicField/name=='*_i'", "/dynamicField/name=='*_i'",
"/dynamicField/type=='int'", "/dynamicField/type=='int'",
"/dynamicField/indexed==true", "/dynamicField/indexed==true",
"/dynamicField/stored==true", "/dynamicField/stored==true",
"/dynamicField/docValues==false", "/dynamicField/docValues=="+expectedDocValues,
"/dynamicField/termVectors==false", "/dynamicField/termVectors==false",
"/dynamicField/termPositions==false", "/dynamicField/termPositions==false",
"/dynamicField/termOffsets==false", "/dynamicField/termOffsets==false",

View File

@ -22,15 +22,17 @@ import org.junit.Test;
public class TestFieldTypeResource extends SolrRestletTestBase { public class TestFieldTypeResource extends SolrRestletTestBase {
@Test @Test
public void testGetFieldType() throws Exception { public void testGetFieldType() throws Exception {
final String expectedFloatClass = RANDOMIZED_NUMERIC_FIELDTYPES.get(Float.class);
final boolean expectedDocValues = Boolean.getBoolean(NUMERIC_DOCVALUES_SYSPROP);
assertQ("/schema/fieldtypes/float?indent=on&wt=xml&showDefaults=true", assertQ("/schema/fieldtypes/float?indent=on&wt=xml&showDefaults=true",
"count(/response/lst[@name='fieldType']) = 1", "count(/response/lst[@name='fieldType']) = 1",
"count(/response/lst[@name='fieldType']/*) = 17", "count(/response/lst[@name='fieldType']/*) = 17",
"/response/lst[@name='fieldType']/str[@name='name'] = 'float'", "/response/lst[@name='fieldType']/str[@name='name'] = 'float'",
"/response/lst[@name='fieldType']/str[@name='class'] = 'solr.TrieFloatField'", "/response/lst[@name='fieldType']/str[@name='class'] = '"+expectedFloatClass+"'",
"/response/lst[@name='fieldType']/str[@name='precisionStep'] ='0'", "/response/lst[@name='fieldType']/str[@name='precisionStep'] ='0'",
"/response/lst[@name='fieldType']/bool[@name='indexed'] = 'true'", "/response/lst[@name='fieldType']/bool[@name='indexed'] = 'true'",
"/response/lst[@name='fieldType']/bool[@name='stored'] = 'true'", "/response/lst[@name='fieldType']/bool[@name='stored'] = 'true'",
"/response/lst[@name='fieldType']/bool[@name='docValues'] = 'false'", "/response/lst[@name='fieldType']/bool[@name='docValues'] = '"+expectedDocValues+"'",
"/response/lst[@name='fieldType']/bool[@name='termVectors'] = 'false'", "/response/lst[@name='fieldType']/bool[@name='termVectors'] = 'false'",
"/response/lst[@name='fieldType']/bool[@name='termPositions'] = 'false'", "/response/lst[@name='fieldType']/bool[@name='termPositions'] = 'false'",
"/response/lst[@name='fieldType']/bool[@name='termOffsets'] = 'false'", "/response/lst[@name='fieldType']/bool[@name='termOffsets'] = 'false'",
@ -53,13 +55,15 @@ public class TestFieldTypeResource extends SolrRestletTestBase {
@Test @Test
public void testJsonGetFieldType() throws Exception { public void testJsonGetFieldType() throws Exception {
final String expectedFloatClass = RANDOMIZED_NUMERIC_FIELDTYPES.get(Float.class);
final boolean expectedDocValues = Boolean.getBoolean(NUMERIC_DOCVALUES_SYSPROP);
assertJQ("/schema/fieldtypes/float?indent=on&showDefaults=on", // assertJQ will add "&wt=json" assertJQ("/schema/fieldtypes/float?indent=on&showDefaults=on", // assertJQ will add "&wt=json"
"/fieldType/name=='float'", "/fieldType/name=='float'",
"/fieldType/class=='solr.TrieFloatField'", "/fieldType/class=='"+expectedFloatClass+"'",
"/fieldType/precisionStep=='0'", "/fieldType/precisionStep=='0'",
"/fieldType/indexed==true", "/fieldType/indexed==true",
"/fieldType/stored==true", "/fieldType/stored==true",
"/fieldType/docValues==false", "/fieldType/docValues=="+expectedDocValues,
"/fieldType/termVectors==false", "/fieldType/termVectors==false",
"/fieldType/termPositions==false", "/fieldType/termPositions==false",
"/fieldType/termOffsets==false", "/fieldType/termOffsets==false",