taskx/psmid/against-solution13/test/apifest/CurrencyTest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 25 Oct 2008 20:53:00 +0200
changeset 84 2ae6e4aa7aef
permissions -rw-r--r--
Solutions by Petr Smid
     1 package apifest;
     2 
     3 import junit.framework.TestCase;
     4 import org.apidesign.apifest08.currency.ConvertorCurrency;
     5 import org.apidesign.apifest08.currency.ExchangeRate;
     6 import org.apidesign.apifest08.currency.ExchangeRateProvider;
     7 
     8 
     9 /** Write a test that works with version from task A and fails with version B.
    10  */
    11 
    12 public class CurrencyTest extends TestCase {
    13 
    14 
    15     public CurrencyTest(String n) {
    16         super(n);
    17     }
    18     
    19     public void testCompatibility() throws Exception {
    20        ExchangeRateProvider e = new ExchangeRateProvider(null, null, null, null) {
    21            private ExchangeRate getExchangeRate(ConvertorCurrency a, ConvertorCurrency b) { //in version B it shouln't compile
    22                return null;
    23            }
    24        };
    25     }
    26 }