# HG changeset patch # User Jaroslav Tulach # Date 1223724616 -7200 # Node ID 22885b020f1510556865749e24f6df994893ae94 # Parent 7bc06ac56dd8a45505d76241b4d929bd8124eb61 Solution 04 is not source compatible as it added new methods into a subclassable interface diff -r 7bc06ac56dd8 -r 22885b020f15 taskx/jtulach/against-solution04/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution04/build.xml Sat Oct 11 13:30:16 2008 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r 7bc06ac56dd8 -r 22885b020f15 taskx/jtulach/against-solution04/nbproject/project.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution04/nbproject/project.xml Sat Oct 11 13:30:16 2008 +0200 @@ -0,0 +1,82 @@ + + + org.netbeans.modules.ant.freeform + + + + jtulach against solution 04 + + build.xml + ../../../ + project.properties + ${apifest}/taskx/common.properties + + + + + java + test + + + + + + compile + + + + clean + + + + test + + + + test + + + + clean + compile + + + + folder + build/tests + + compile + + + + + + test + + + ${ant.script} + + + project.properties + + + + + + + + + + + + + + + test + ${apiA}:${junit.jar} + build/tests + 1.5 + + + + diff -r 7bc06ac56dd8 -r 22885b020f15 taskx/jtulach/against-solution04/project.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution04/project.properties Sat Oct 11 13:30:16 2008 +0200 @@ -0,0 +1,14 @@ + +# name of a project to test +apitotest=solution04 + +# the test shall expose a problem between two versions +# of one API. select the first version - taskA and a second +# version of the of the API taskB +taskA=${apifest}/task1 +taskB=${apifest}/task2 + +# usual locations of API classes for each version +apiA=${taskA}/${apitotest}/build/classes/ +apiB=${taskB}/${apitotest}/build/classes/ + diff -r 7bc06ac56dd8 -r 22885b020f15 taskx/jtulach/against-solution04/test/apifest/CurrencyTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution04/test/apifest/CurrencyTest.java Sat Oct 11 13:30:16 2008 +0200 @@ -0,0 +1,24 @@ +package apifest; + +import java.math.BigDecimal; +import java.util.Currency; +import junit.framework.TestCase; +import org.apidesign.apifest08.currency.Convertor; +import org.apidesign.apifest08.currency.InvalidConversionException; + + +/** Write a test that works with version from task A and fails with version B. + */ +public class CurrencyTest extends TestCase { + public CurrencyTest(String n) { + super(n); + } + + public void testCompatibility() throws Exception { + Convertor c = new Convertor() { + public BigDecimal convert(Currency from, Currency to, BigDecimal amount) throws InvalidConversionException { + return null; + } + }; + } +}