# HG changeset patch # User Jaroslav Tulach # Date 1223724334 -7200 # Node ID e8b0f13fd4fb1811be81f192a8acbf2b797096a3 # Parent c6b50876b5cfbfc60afd8b2cc0f94c8494a621ac Solution 02 is not backward compatible as it changed return type of one method in ConvertorFactory class diff -r c6b50876b5cf -r e8b0f13fd4fb taskx/jtulach/against-solution02/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution02/build.xml Sat Oct 11 13:25:34 2008 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r c6b50876b5cf -r e8b0f13fd4fb taskx/jtulach/against-solution02/nbproject/project.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution02/nbproject/project.xml Sat Oct 11 13:25:34 2008 +0200 @@ -0,0 +1,82 @@ + + + org.netbeans.modules.ant.freeform + + + + jtulach against solution 02 + + 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 c6b50876b5cf -r e8b0f13fd4fb taskx/jtulach/against-solution02/project.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution02/project.properties Sat Oct 11 13:25:34 2008 +0200 @@ -0,0 +1,14 @@ + +# name of a project to test +apitotest=solution02 + +# 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 c6b50876b5cf -r e8b0f13fd4fb taskx/jtulach/against-solution02/test/apifest/CurrencyTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution02/test/apifest/CurrencyTest.java Sat Oct 11 13:25:34 2008 +0200 @@ -0,0 +1,30 @@ +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.ConvertorFactory; +import org.apidesign.apifest08.currency.Money; + + +/** 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 { + Money m = new Money() { + public BigDecimal getAmount() { + return new BigDecimal(1); + } + + public Currency getCurrency() { + return Currency.getInstance("CZK"); + } + }; + Convertor c = ConvertorFactory.createConvertor(m, m); + } +}