Skip to content

Commit fe517d1

Browse files
authored
SOLR-17683: Update test to reflect only one type of Currency Field in Solr. (#3306)
1 parent 7422ad6 commit fe517d1

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

solr/core/src/test-files/solr/collection1/conf/schema.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,11 @@
437437
<fieldType name="xyd" class="solr.PointType" dimension="2" subFieldSuffix="_d1"/>
438438

439439
<!-- Currency type -->
440-
<fieldType name="currency_CFT" class="solr.CurrencyFieldType" amountLongSuffix="_l1_ns" codeStrSuffix="_s1"
440+
<fieldType name="currency" class="solr.CurrencyFieldType" amountLongSuffix="_l1_ns" codeStrSuffix="_s1"
441441
currencyConfig="currency.xml" multiValued="false"/>
442-
<fieldType name="mock_currency_CFT" class="solr.CurrencyFieldType" amountLongSuffix="_l1_ns" codeStrSuffix="_s1"
442+
<fieldType name="mock_currency" class="solr.CurrencyFieldType" amountLongSuffix="_l1_ns" codeStrSuffix="_s1"
443443
providerClass="solr.MockExchangeRateProvider" foo="bar" multiValued="false"/>
444-
<fieldType name="oer_currency_CFT"
444+
<fieldType name="oer_currency"
445445
class="solr.CurrencyFieldType"
446446
amountLongSuffix="_l1_ns"
447447
codeStrSuffix="_s1_ns"
@@ -567,9 +567,9 @@
567567
<field name="work" type="xy" indexed="true" stored="true" multiValued="false"/>
568568

569569
<!-- Test currency -->
570-
<field name="amount_CFT" type="currency_CFT" indexed="true" stored="true" multiValued="false"/>
571-
<field name="mock_amount_CFT" type="mock_currency_CFT" indexed="true" stored="true"/>
572-
<field name="oer_amount_CFT" type="oer_currency_CFT" indexed="true" stored="true"/>
570+
<field name="amount" type="currency" indexed="true" stored="true" multiValued="false"/>
571+
<field name="mock_amount" type="mock_currency" indexed="true" stored="true"/>
572+
<field name="oer_amount" type="oer_currency" indexed="true" stored="true"/>
573573

574574
<!-- test different combinations of indexed and stored -->
575575
<field name="bind" type="boolean" indexed="true" stored="false" docValues="false"/>

solr/core/src/test/org/apache/solr/schema/CurrencyFieldTypeTest.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,13 @@ public CurrencyFieldTypeTest(
4545
this.expectedProviderClass = expectedProviderClass;
4646
}
4747

48-
// remove cft later
4948
@ParametersFactory
5049
public static Iterable<Object[]> parameters() {
5150
return Arrays.asList(
5251
new Object[][] {
53-
{"amount_CFT", FileExchangeRateProvider.class}, // CurrencyFieldType
54-
{"mock_amount_CFT", MockExchangeRateProvider.class}, // CurrencyFieldType
55-
{"oer_amount_CFT", OpenExchangeRatesOrgProvider.class} // CurrencyFieldType
52+
{"amount", FileExchangeRateProvider.class}, // CurrencyFieldType
53+
{"mock_amount", MockExchangeRateProvider.class}, // CurrencyFieldType
54+
{"oer_amount", OpenExchangeRatesOrgProvider.class} // CurrencyFieldType
5655
});
5756
}
5857

solr/core/src/test/org/apache/solr/search/CurrencyRangeFacetCloudTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class CurrencyRangeFacetCloudTest extends SolrCloudTestCase {
3939
private static final String COLLECTION = MethodHandles.lookup().lookupClass().getName();
4040
private static final String CONF = COLLECTION + "_configSet";
4141

42-
private static String FIELD = null; // randomized
42+
private static String FIELD = "amount";
4343

4444
private static final List<String> STR_VALS = Arrays.asList("x0", "x1", "x2");
4545
// NOTE: in our test conversions EUR uses an asymmetric exchange rate
@@ -56,7 +56,6 @@ public class CurrencyRangeFacetCloudTest extends SolrCloudTestCase {
5656
@BeforeClass
5757
public static void setupCluster() throws Exception {
5858
CurrencyFieldTypeTest.assumeCurrencySupport("USD", "EUR", "MXN", "GBP", "JPY", "NOK");
59-
FIELD = usually() ? "amount_CFT" : "amount";
6059

6160
final int numShards = TestUtil.nextInt(random(), 1, 5);
6261
final int numReplicas = 1;
@@ -76,7 +75,7 @@ public static void setupCluster() throws Exception {
7675

7776
// we're indexing each Currency value in 3 docs, each with a diff 'x_s' field value
7877
// use modulo to pick the values, so we don't add the docs in strict order of either VALUES of
79-
// STR_VALS (that way if we want ot filter by id later, it's an independent variable)
78+
// STR_VALS (that way if we want to filter by id later, it's an independent variable)
8079
for (int id = 0; id < NUM_DOCS; id++) {
8180
final String x = STR_VALS.get(id % STR_VALS.size());
8281
final String val = VALUES.get(id % VALUES.size());

solr/test-framework/src/test-files/solr/collection1/conf/schema.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,11 @@
437437
<fieldType name="xyd" class="solr.PointType" dimension="2" subFieldSuffix="_d1"/>
438438

439439
<!-- Currency type -->
440-
<fieldType name="currency_CFT" class="solr.CurrencyFieldType" amountLongSuffix="_l1_ns" codeStrSuffix="_s1"
440+
<fieldType name="currency" class="solr.CurrencyFieldType" amountLongSuffix="_l1_ns" codeStrSuffix="_s1"
441441
currencyConfig="currency.xml" multiValued="false"/>
442-
<fieldType name="mock_currency_CFT" class="solr.CurrencyFieldType" amountLongSuffix="_l1_ns" codeStrSuffix="_s1"
442+
<fieldType name="mock_currency" class="solr.CurrencyFieldType" amountLongSuffix="_l1_ns" codeStrSuffix="_s1"
443443
providerClass="solr.MockExchangeRateProvider" foo="bar" multiValued="false"/>
444-
<fieldType name="oer_currency_CFT"
444+
<fieldType name="oer_currency"
445445
class="solr.CurrencyFieldType"
446446
amountLongSuffix="_l1_ns"
447447
codeStrSuffix="_s1_ns"
@@ -570,9 +570,9 @@
570570
<field name="amount" type="currency" indexed="true" stored="true" multiValued="false"/>
571571
<field name="mock_amount" type="mock_currency" indexed="true" stored="true"/>
572572
<field name="oer_amount" type="oer_currency" indexed="true" stored="true"/>
573-
<field name="amount_CFT" type="currency_CFT" indexed="true" stored="true" multiValued="false"/>
574-
<field name="mock_amount_CFT" type="mock_currency_CFT" indexed="true" stored="true"/>
575-
<field name="oer_amount_CFT" type="oer_currency_CFT" indexed="true" stored="true"/>
573+
<field name="amount" type="currency" indexed="true" stored="true" multiValued="false"/>
574+
<field name="mock_amount" type="mock_currency" indexed="true" stored="true"/>
575+
<field name="oer_amount" type="oer_currency" indexed="true" stored="true"/>
576576

577577
<!-- test different combinations of indexed and stored -->
578578
<field name="bind" type="boolean" indexed="true" stored="false"/>

0 commit comments

Comments
 (0)