# HG changeset patch # User Jaroslav Tulach # Date 1224341505 -7200 # Node ID f2a4b0e116c24de9e841de8a7fccb7cfa758ee17 # Parent ec70f883de4a5a6011cde117f0a24aceff90eb15 Slightly unfair, but no permission needing incompatibility in solution 14 diff -r ec70f883de4a -r f2a4b0e116c2 taskx/jtulach/against-solution14/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution14/build.xml Sat Oct 18 16:51:45 2008 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r ec70f883de4a -r f2a4b0e116c2 taskx/jtulach/against-solution14/nbproject/project.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution14/nbproject/project.xml Sat Oct 18 16:51:45 2008 +0200 @@ -0,0 +1,82 @@ + + + org.netbeans.modules.ant.freeform + + + + jtulach against solution 14 + + 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 ec70f883de4a -r f2a4b0e116c2 taskx/jtulach/against-solution14/project.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution14/project.properties Sat Oct 18 16:51:45 2008 +0200 @@ -0,0 +1,14 @@ + +# name of a project to test +apitotest=solution14 + +# 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}/task3 +taskB=${apifest}/task4 + +# usual locations of API classes for each version +apiA=${taskA}/${apitotest}/build/classes/ +apiB=${taskB}/${apitotest}/build/classes/ + diff -r ec70f883de4a -r f2a4b0e116c2 taskx/jtulach/against-solution14/test/apifest/CurrencyTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/jtulach/against-solution14/test/apifest/CurrencyTest.java Sat Oct 18 16:51:45 2008 +0200 @@ -0,0 +1,19 @@ +package apifest; + +import junit.framework.TestCase; +import org.apidesign.apifest08.currency.CurrencyRate; +import org.apidesign.apifest08.currency.CurrencyRateFactory; + + +/** 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 { + CurrencyRate rate = CurrencyRateFactory.getInstance().createCurrencyRate("CZK", "USD", 1, 2); + assertEquals("Implements one interface", 1, rate.getClass().getInterfaces().length); + } +}