taskx/jtulach/against-solution04/test/apifest/CurrencyTest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 11 Oct 2008 13:30:16 +0200
changeset 76 22885b020f15
parent 14 taskx/jtulach/against-solutionXY/test/apifest/CurrencyTest.java@d907b216f8a1
permissions -rw-r--r--
Solution 04 is not source compatible as it added new methods into a subclassable interface
     1 package apifest;
     2 
     3 import java.math.BigDecimal;
     4 import java.util.Currency;
     5 import junit.framework.TestCase;
     6 import org.apidesign.apifest08.currency.Convertor;
     7 import org.apidesign.apifest08.currency.InvalidConversionException;
     8 
     9 
    10 /** Write a test that works with version from task A and fails with version B.
    11  */
    12 public class CurrencyTest extends TestCase {
    13     public CurrencyTest(String n) {
    14         super(n);
    15     }
    16     
    17     public void testCompatibility() throws Exception {
    18         Convertor c = new Convertor() {
    19             public BigDecimal convert(Currency from, Currency to, BigDecimal amount) throws InvalidConversionException {
    20                 return null;
    21             }
    22         };
    23     }
    24 }