# HG changeset patch # User Jaroslav Tulach # Date 1223742311 -7200 # Node ID 0c910349ba679aa31e32470be68ab6f9b71b3176 # Parent 9a019498f60296fb9f7fa95f715218592195b593 Solution 06 is quite good (maybe perfect) from the perspective of binary compatibility. For a while I thought I am going to give up, however then I noticed that there is an added overloaded method. With proper parameters this can cause the previously OK source to become uncompilable. diff -r 9a019498f602 -r 0c910349ba67 taskx/jtulach/against-solution06/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution06/build.xml Sat Oct 11 18:25:11 2008 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r 9a019498f602 -r 0c910349ba67 taskx/jtulach/against-solution06/nbproject/project.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution06/nbproject/project.xml Sat Oct 11 18:25:11 2008 +0200 @@ -0,0 +1,82 @@ + + + org.netbeans.modules.ant.freeform + + + + jtulach against solution 06 + + 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 9a019498f602 -r 0c910349ba67 taskx/jtulach/against-solution06/project.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution06/project.properties Sat Oct 11 18:25:11 2008 +0200 @@ -0,0 +1,14 @@ + +# name of a project to test +apitotest=solution06 + +# 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}/task2 +taskB=${apifest}/task3 + +# usual locations of API classes for each version +apiA=${taskA}/${apitotest}/build/classes/ +apiB=${taskB}/${apitotest}/build/classes/ + diff -r 9a019498f602 -r 0c910349ba67 taskx/jtulach/against-solution06/test/apifest/CurrencyTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution06/test/apifest/CurrencyTest.java Sat Oct 11 18:25:11 2008 +0200 @@ -0,0 +1,20 @@ +package apifest; + +import java.util.Currency; +import junit.framework.TestCase; +import org.apidesign.apifest08.currency.Convertor; + + +/** 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 { + Currency cur1 = Currency.getInstance("CZK"); + Currency cur2 = Currency.getInstance("SKK"); + Convertor c = new Convertor(null, cur1, cur2); + } +}