# HG changeset patch # User Jaroslav Tulach # Date 1223726553 -7200 # Node ID 9a019498f60296fb9f7fa95f715218592195b593 # Parent 3d851a9f2016870e7790c3065cfc4685fe2bb733 Solution 13 is not functionally compatible as its changed behaviour of equals method on one of its API types diff -r 3d851a9f2016 -r 9a019498f602 taskx/jtulach/against-solution13/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution13/build.xml Sat Oct 11 14:02:33 2008 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r 3d851a9f2016 -r 9a019498f602 taskx/jtulach/against-solution13/nbproject/project.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution13/nbproject/project.xml Sat Oct 11 14:02:33 2008 +0200 @@ -0,0 +1,82 @@ + + + org.netbeans.modules.ant.freeform + + + + jtulach against solution 13 + + 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 3d851a9f2016 -r 9a019498f602 taskx/jtulach/against-solution13/project.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution13/project.properties Sat Oct 11 14:02:33 2008 +0200 @@ -0,0 +1,14 @@ + +#for example use: +apitotest=solution13 + +# 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}/task3 + +# usual locations of API classes for each version +apiA=${taskA}/${apitotest}/build/classes/ +apiB=${taskB}/${apitotest}/build/classes/ + diff -r 3d851a9f2016 -r 9a019498f602 taskx/jtulach/against-solution13/test/apifest/CurrencyTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution13/test/apifest/CurrencyTest.java Sat Oct 11 14:02:33 2008 +0200 @@ -0,0 +1,23 @@ +package apifest; + +import junit.framework.TestCase; +import org.apidesign.apifest08.currency.ConvertorCurrency; + + +/** 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 { + ConvertorCurrency cur1 = ConvertorCurrency.getInstance("CZK"); + ConvertorCurrency cur2 = ConvertorCurrency.getInstance("CZK"); + + assertNotSame("Two different instances", cur1, cur2); + if (cur1.equals(cur2)) { + fail("They are even not equal in first version"); + } + } +}