lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r1451699 - in /lucene/dev/branches/branch_4x: ./ dev-tools/ lucene/ lucene/analysis/ lucene/analysis/icu/src/java/org/apache/lucene/collation/ lucene/backwards/ lucene/benchmark/ lucene/classification/ lucene/classification/src/ lucene/code...
Date Fri, 01 Mar 2013 19:50:40 GMT
Author: hossman
Date: Fri Mar  1 19:50:38 2013
New Revision: 1451699

URL: http://svn.apache.org/r1451699
Log:
SOLR-4514: better tests for CurrencyField using OpenExchangeRatesOrgProvider (merge r1451691)

Added:
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java
      - copied, changed from r1451691, lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/CurrencyFieldOpenExchangeTest.java
      - copied, changed from r1451691, lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CurrencyFieldOpenExchangeTest.java
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java
      - copied, changed from r1451691, lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java
Removed:
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/CurrencyFieldTest.java
Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/dev-tools/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/BUILD.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/CHANGES.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/JRE_VERSION_MIGRATION.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/LICENSE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/MIGRATE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/README.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/SYSTEM_REQUIREMENTS.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/icu/src/java/org/apache/lucene/collation/ICUCollationKeyFilterFactory.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/backwards/   (props changed)
    lucene/dev/branches/branch_4x/lucene/benchmark/   (props changed)
    lucene/dev/branches/branch_4x/lucene/build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/classification/   (props changed)
    lucene/dev/branches/branch_4x/lucene/classification/build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/classification/ivy.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/classification/src/   (props changed)
    lucene/dev/branches/branch_4x/lucene/codecs/   (props changed)
    lucene/dev/branches/branch_4x/lucene/common-build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.cfs.zip
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.nocfs.zip
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.optimized.cfs.zip
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.optimized.nocfs.zip
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestSort.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestSortDocValues.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestTotalHitCountCollector.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/demo/   (props changed)
    lucene/dev/branches/branch_4x/lucene/facet/   (props changed)
    lucene/dev/branches/branch_4x/lucene/grouping/   (props changed)
    lucene/dev/branches/branch_4x/lucene/highlighter/   (props changed)
    lucene/dev/branches/branch_4x/lucene/ivy-settings.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/join/   (props changed)
    lucene/dev/branches/branch_4x/lucene/licenses/   (props changed)
    lucene/dev/branches/branch_4x/lucene/memory/   (props changed)
    lucene/dev/branches/branch_4x/lucene/misc/   (props changed)
    lucene/dev/branches/branch_4x/lucene/module-build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/queries/   (props changed)
    lucene/dev/branches/branch_4x/lucene/queryparser/   (props changed)
    lucene/dev/branches/branch_4x/lucene/sandbox/   (props changed)
    lucene/dev/branches/branch_4x/lucene/site/   (props changed)
    lucene/dev/branches/branch_4x/lucene/spatial/   (props changed)
    lucene/dev/branches/branch_4x/lucene/suggest/   (props changed)
    lucene/dev/branches/branch_4x/lucene/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/lucene/tools/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/CHANGES.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/LICENSE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/README.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/SYSTEM_REQUIREMENTS.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/build.xml   (props changed)
    lucene/dev/branches/branch_4x/solr/cloud-dev/   (props changed)
    lucene/dev/branches/branch_4x/solr/common-build.xml   (props changed)
    lucene/dev/branches/branch_4x/solr/contrib/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/currency.xml
    lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/open-exchange-rates.json
    lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/schema.xml
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/core/TestConfig.java
  (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/OpenExchangeRatesOrgProviderTest.java
    lucene/dev/branches/branch_4x/solr/example/   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpclient-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpclient-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpcore-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpcore-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpmime-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpmime-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/scripts/   (props changed)
    lucene/dev/branches/branch_4x/solr/site/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/   (props changed)
    lucene/dev/branches/branch_4x/solr/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/solr/testlogging.properties   (props changed)
    lucene/dev/branches/branch_4x/solr/webapp/   (props changed)

Modified: lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/currency.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/currency.xml?rev=1451699&r1=1451698&r2=1451699&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/currency.xml
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/currency.xml
Fri Mar  1 19:50:38 2013
@@ -16,17 +16,20 @@
  limitations under the License.
 -->
 
-<!-- Example exchange rates file.  -->
+<!-- Example exchange rates file, 
+
+
+     NOTE: this data must be kept in sync with ./open-exchange-rates.json
+-->
 
 <currencyConfig version="1.0">
   <rates>
-    <!-- Example -->
-    <rate from="USD" to="JPY" rate="81.29"/>
-
     <!-- Fake rates for testing -->
+    <rate from="USD" to="JPY" rate="81.29"/>
     <rate from="USD" to="EUR" rate="2.5"/>
     <rate from="USD" to="GBP" rate="0.5"/>
     <rate from="EUR" to="GBP" rate="0.5"/>
+    <rate from="MXN" to="USD" rate="0.5"/>
 
     <!-- Asymmetric rate -->
     <rate from="EUR" to="USD" rate="0.5"/>

Modified: lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/open-exchange-rates.json
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/open-exchange-rates.json?rev=1451699&r1=1451698&r2=1451699&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/open-exchange-rates.json
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/open-exchange-rates.json
Fri Mar  1 19:50:38 2013
@@ -1,167 +1,18 @@
 {
-  "disclaimer": "This data is collected from various providers and provided free of charge
for informational purposes only, with no guarantee whatsoever of accuracy, validity, availability
or fitness for any purpose; use at your own risk. Other than that - have fun, and please share/watch/fork
if you think data like this should be free!",
-  "license": "Data collected from various providers with public-facing APIs; copyright may
apply; not for resale; no warranties given.",
+  "disclaimer": "This data is not real, it was synthetically created to match currency.xml.
 It is modeled after the data format available from openexchangerates.org.  See https://openexchangerates.org/documentation
for details",
+  "license": "http://www.apache.org/licenses/LICENSE-2.0",
   "timestamp": 1332070464,
+
+
+  "IMPORTANT NOTE": "In order for tests to work, this data must be kept in sync with ./currency.xml",
+
+
   "base": "USD",
   "rates": {
-    "AED": 3.6732,
-    "AFN": 48.299999,
-    "ALL": 105.919998,
-    "AMD": 388.890015,
-    "ANG": 1.79,
-    "AOA": 94.769997,
-    "ARS": 4.35,
-    "AUD": 0.943931,
-    "AWG": 1.7899,
-    "AZN": 0.7863,
-    "BAM": 1.48775,
-    "BBD": 2,
-    "BDT": 82,
-    "BGN": 1.4962,
-    "BHD": 0.37703,
-    "BIF": 1304.170044,
-    "BMD": 1,
-    "BND": 1.2575,
-    "BOB": 6.91,
-    "BRL": 1.8003,
-    "BSD": 1,
-    "BTN": 50.185001,
-    "BWP": 7.2307,
-    "BYR": 8150,
-    "BZD": 1.9135,
-    "CAD": 0.9921,
-    "CDF": 917.276917,
-    "CHF": 0.9164,
-    "CLF": 0.02146,
-    "CLP": 482.75,
-    "CNY": 6.3239,
-    "COP": 1760,
-    "CRC": 507.600006,
-    "CUP": 1,
-    "CVE": 84.190002,
-    "CZK": 18.606001,
-    "DJF": 179.490005,
-    "DKK": 5.64424,
-    "DOP": 39.025002,
-    "DZD": 74.544998,
-    "EGP": 6.0385,
-    "ETB": 17.720449,
-    "EUR": 0.758956,
-    "FJD": 1.7734,
-    "FKP": 0.6316,
-    "GBP": 0.631373,
-    "GEL": 1.6469,
-    "GHS": 1.7455,
-    "GIP": 0.63165,
-    "GMD": 31.5,
-    "GNF": 7100,
-    "GTQ": 7.6975,
-    "GYD": 203.699997,
-    "HKD": 7.76306,
-    "HNL": 19.055,
-    "HRK": 5.7333,
-    "HTG": 41,
-    "HUF": 219.850006,
-    "IDR": 9118,
-    "IEP": 0.5978,
-    "ILS": 3.7542,
-    "INR": 50.165001,
-    "IQD": 1165.5,
-    "IRR": 12308,
-    "ISK": 127.440002,
-    "JMD": 86.699997,
-    "JOD": 0.7095,
-    "JPY": 83.445,
-    "KES": 83.18,
-    "KGS": 46.699402,
-    "KHR": 4010.300049,
-    "KMF": 373.424255,
-    "KPW": 900,
-    "KRW": 1125.849976,
-    "KWD": 0.27925,
-    "KZT": 147.690002,
-    "LAK": 7993.799805,
-    "LBP": 1504,
-    "LKR": 125.224998,
-    "LRD": 73.459999,
-    "LSL": 7.5768,
-    "LTL": 2.6219,
-    "LVL": 0.5291,
-    "LYD": 1.2572,
-    "MAD": 8.4611,
-    "MDL": 11.89,
-    "MGA": 2155,
-    "MKD": 46.705002,
-    "MMK": 6.51,
-    "MNT": 1322.5,
-    "MOP": 7.9958,
-    "MRO": 293,
-    "MUR": 29.110001,
-    "MVR": 15.36,
-    "MWK": 165.206207,
-    "MXN": 12.6745,
-    "MYR": 3.0575,
-    "MZN": 27.200001,
-    "NAD": 7.58,
-    "NGN": 157.600006,
-    "NIO": 23.215,
-    "NOK": 5.73163,
-    "NPR": 80.620003,
-    "NZD": 1.212269,
-    "OMR": 0.38485,
-    "PAB": 1,
-    "PEN": 2.674,
-    "PGK": 2.0627,
-    "PHP": 43.02,
-    "PKR": 90.800003,
-    "PLN": 3.1285,
-    "PYG": 4245,
-    "QAR": 3.6415,
-    "RON": 3.3256,
-    "RSD": 84.100502,
-    "RUB": 29.2342,
-    "RWF": 606.717468,
-    "SAR": 3.7505,
-    "SBD": 7.075973,
-    "SCR": 14.0447,
-    "SDG": 2.6765,
-    "SEK": 6.74525,
-    "SGD": 1.258,
-    "SHP": 0.63165,
-    "SLL": 4364.5,
-    "SOS": 1629,
-    "SRD": 3.2875,
-    "STD": 18650,
-    "SVC": 8.7475,
-    "SYP": 57.450001,
-    "SZL": 7.5752,
-    "THB": 30.700001,
-    "TJS": 4.7588,
-    "TMT": 2.85,
-    "TND": 1.5178,
-    "TOP": 1.693601,
-    "TRY": 1.796,
-    "TTD": 6.40015,
-    "TWD": 29.532,
-    "TZS": 1595,
-    "UAH": 8.029,
-    "UGX": 2481.699951,
     "USD": 1,
-    "UYU": 19.469999,
-    "UZS": 1835.75,
-    "VEF": 4.295,
-    "VND": 20820,
-    "VUV": 90.199997,
-    "WST": 2.247475,
-    "XAF": 497.898987,
-    "XCD": 2.7,
-    "XDR": 0.652794,
-    "XOF": 498.399994,
-    "XPF": 90.639999,
-    "YER": 216.005005,
-    "ZAR": 7.5688,
-    "ZMK": 5271.5,
-    "ZWD": 378.700012,
-    "ZWL": 322.355011
+    "JPY": 81.29,
+    "EUR": 2.5,
+    "GBP": 0.5,
+    "MXN": 2.0
   }
-}
\ No newline at end of file
+}

Modified: lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/schema.xml?rev=1451699&r1=1451698&r2=1451699&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/schema.xml
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test-files/solr/collection1/conf/schema.xml
Fri Mar  1 19:50:38 2013
@@ -398,7 +398,7 @@
   <!-- Currency type -->
   <fieldType name="currency" class="solr.CurrencyField" currencyConfig="currency.xml"
multiValued="false" />
   <fieldType name="mock_currency" class="solr.CurrencyField" providerClass="solr.MockExchangeRateProvider"
foo="bar" multiValued="false" />
-  <fieldType name="openexchangeratesorg_currency" 
+  <fieldType name="oer_currency" 
              class="solr.CurrencyField" 
              multiValued="false"
              providerClass="solr.OpenExchangeRatesOrgProvider"
@@ -481,6 +481,7 @@
    <!-- Test currency -->
    <field name="amount" type="currency" indexed="true" stored="true" multiValued="false"/>
    <field name="mock_amount" type="mock_currency" indexed="true" stored="true"/>
+   <field name="oer_amount" type="oer_currency" indexed="true" stored="true"/>
 
    <!-- test different combinations of indexed and stored -->
    <field name="bind" type="boolean" indexed="true" stored="false"/>

Copied: lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java
(from r1451691, lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java?p2=lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java&p1=lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java&r1=1451691&r2=1451699&rev=1451699&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java
Fri Mar  1 19:50:38 2013
@@ -16,7 +16,7 @@ package org.apache.solr.schema;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.StorableField;
+import org.apache.lucene.index.IndexableField;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.core.SolrCore;
 import org.junit.BeforeClass;
@@ -98,7 +98,7 @@ public abstract class AbstractCurrencyFi
     FieldType tmp = amount.getType();
     assertTrue(tmp instanceof CurrencyField);
     String currencyValue = "1.50,EUR";
-    List<StorableField> fields = amount.createFields(currencyValue, 2);
+    List<IndexableField> fields = amount.createFields(currencyValue, 2);
     assertEquals(fields.size(), 3);
 
     // First field is currency code, second is value, third is stored.

Copied: lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/CurrencyFieldOpenExchangeTest.java
(from r1451691, lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CurrencyFieldOpenExchangeTest.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/CurrencyFieldOpenExchangeTest.java?p2=lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/CurrencyFieldOpenExchangeTest.java&p1=lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CurrencyFieldOpenExchangeTest.java&r1=1451691&r2=1451699&rev=1451699&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CurrencyFieldOpenExchangeTest.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/CurrencyFieldOpenExchangeTest.java
Fri Mar  1 19:50:38 2013
@@ -16,7 +16,6 @@ package org.apache.solr.schema;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.StorableField;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.core.SolrCore;
 import org.junit.BeforeClass;

Copied: lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java
(from r1451691, lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java?p2=lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java&p1=lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java&r1=1451691&r2=1451699&rev=1451699&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java
Fri Mar  1 19:50:38 2013
@@ -16,7 +16,6 @@ package org.apache.solr.schema;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.StorableField;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.core.SolrCore;
 import org.junit.BeforeClass;

Modified: lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/OpenExchangeRatesOrgProviderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/OpenExchangeRatesOrgProviderTest.java?rev=1451699&r1=1451698&r2=1451699&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/OpenExchangeRatesOrgProviderTest.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/schema/OpenExchangeRatesOrgProviderTest.java
Fri Mar  1 19:50:38 2013
@@ -38,6 +38,9 @@ public class OpenExchangeRatesOrgProvide
   @Override
   @Before
   public void setUp() throws Exception {
+    AbstractCurrencyFieldTest.assumeCurrencySupport
+      ("USD", "EUR", "MXN", "GBP", "JPY");
+
     super.setUp();
     mockParams = new HashMap<String,String>();;
     mockParams.put(OpenExchangeRatesOrgProvider.PARAM_RATES_FILE_LOCATION, "open-exchange-rates.json");
 
@@ -63,14 +66,14 @@ public class OpenExchangeRatesOrgProvide
   public void testList() {
     oerp.init(mockParams);
     oerp.inform(loader);
-    assertEquals(159,     oerp.listAvailableCurrencies().size());
+    assertEquals(5, oerp.listAvailableCurrencies().size());
   }
 
   @Test
   public void testGetExchangeRate() {
     oerp.init(mockParams);
     oerp.inform(loader);
-    assertTrue(5.73163 == oerp.getExchangeRate("USD", "NOK"));    
+    assertEquals(81.29D, oerp.getExchangeRate("USD", "JPY"), 0.0D);    
   }
 
   @Test



Mime
View raw message