1.1 --- a/currency/build.xml Fri Sep 19 23:16:43 2008 +0200
1.2 +++ b/currency/build.xml Sat Sep 20 18:26:55 2008 +0200
1.3 @@ -2,8 +2,8 @@
1.4 <!-- You may freely edit this file. See commented blocks below for -->
1.5 <!-- some examples of how to customize the build. -->
1.6 <!-- (If you delete it and reopen the project it will be recreated.) -->
1.7 -<project name="boolcircuit" default="default" basedir=".">
1.8 - <description>Builds, tests, and runs the project boolcircuit.</description>
1.9 +<project name="currency" default="default" basedir=".">
1.10 + <description>Builds, tests, and runs the project.</description>
1.11 <import file="nbproject/build-impl.xml"/>
1.12 <!--
1.13
1.14 @@ -54,7 +54,7 @@
1.15
1.16 An example of overriding the target for project execution could look like this:
1.17
1.18 - <target name="run" depends="boolcircuit-impl.jar">
1.19 + <target name="run" depends="currency-impl.jar">
1.20 <exec dir="bin" executable="launcher.exe">
1.21 <arg file="${dist.jar}"/>
1.22 </exec>
2.1 --- a/currency/nbproject/build-impl.xml Fri Sep 19 23:16:43 2008 +0200
2.2 +++ b/currency/nbproject/build-impl.xml Sat Sep 20 18:26:55 2008 +0200
2.3 @@ -19,7 +19,7 @@
2.4 - cleanup
2.5
2.6 -->
2.7 -<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="boolcircuit-impl">
2.8 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="Currency_Convertor_Template-impl">
2.9 <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
2.10 <!--
2.11 ======================
3.1 --- a/currency/nbproject/genfiles.properties Fri Sep 19 23:16:43 2008 +0200
3.2 +++ b/currency/nbproject/genfiles.properties Sat Sep 20 18:26:55 2008 +0200
3.3 @@ -3,6 +3,6 @@
3.4 build.xml.stylesheet.CRC32=be360661
3.5 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
3.6 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
3.7 -nbproject/build-impl.xml.data.CRC32=2ab820eb
3.8 -nbproject/build-impl.xml.script.CRC32=2d184ca2
3.9 +nbproject/build-impl.xml.data.CRC32=484fe241
3.10 +nbproject/build-impl.xml.script.CRC32=5f473b16
3.11 nbproject/build-impl.xml.stylesheet.CRC32=e55b27f5
4.1 --- a/currency/nbproject/project.properties Fri Sep 19 23:16:43 2008 +0200
4.2 +++ b/currency/nbproject/project.properties Sat Sep 20 18:26:55 2008 +0200
4.3 @@ -1,5 +1,5 @@
4.4 -application.title=boolcircuit
4.5 -application.vendor=jarda
4.6 +application.title=currency
4.7 +application.vendor=apidesign.org
4.8 auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=8
4.9 auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=80
4.10 auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=default
4.11 @@ -18,7 +18,7 @@
4.12 ${run.test.classpath}
4.13 # This directory is removed when the project is cleaned:
4.14 dist.dir=dist
4.15 -dist.jar=${dist.dir}/boolcircuit.jar
4.16 +dist.jar=${dist.dir}/currency.jar
4.17 dist.javadoc.dir=${dist.dir}/javadoc
4.18 excludes=
4.19 file.reference.junit-4.4.jar=../libs/junit-4.4.jar
5.1 --- a/currency/nbproject/project.xml Fri Sep 19 23:16:43 2008 +0200
5.2 +++ b/currency/nbproject/project.xml Sat Sep 20 18:26:55 2008 +0200
5.3 @@ -3,7 +3,7 @@
5.4 <type>org.netbeans.modules.java.j2seproject</type>
5.5 <configuration>
5.6 <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
5.7 - <name>boolcircuit</name>
5.8 + <name>Currency Convertor Template</name>
5.9 <minimum-ant-version>1.6.5</minimum-ant-version>
5.10 <source-roots>
5.11 <root id="src.dir"/>
6.1 --- a/currency/test/org/apidesign/apifest08/test/Task1Test.java Fri Sep 19 23:16:43 2008 +0200
6.2 +++ b/currency/test/org/apidesign/apifest08/test/Task1Test.java Sat Sep 20 18:26:55 2008 +0200
6.3 @@ -1,8 +1,10 @@
6.4 package org.apidesign.apifest08.test;
6.5
6.6 import junit.framework.TestCase;
6.7 +import org.apidesign.apifest08.currency.Convertor;
6.8
6.9 -/**
6.10 +/** Finish the Convertor API, and then write bodies of methods inside
6.11 + * of this class to match the given tasks.
6.12 */
6.13 public class Task1Test extends TestCase {
6.14 static {
6.15 @@ -20,9 +22,50 @@
6.16 @Override
6.17 protected void tearDown() throws Exception {
6.18 }
6.19 +
6.20 + /** Create convertor that understands two currencies, CZK and
6.21 + * USD. Make 1 USD == 17 CZK.
6.22 + *
6.23 + * @return prepared convertor ready for converting USD to CZK and CZK to USD
6.24 + */
6.25 + public static Convertor createCZKtoUSD() {
6.26 + return null;
6.27 + }
6.28 +
6.29 + /** Create convertor that understands two currencies, CZK and
6.30 + * SKK. Make 100 SKK == 80 CZK.
6.31 + *
6.32 + * @return prepared convertor ready for converting SKK to CZK and CZK to SKK
6.33 + */
6.34 + public static Convertor createSKKtoCZK() {
6.35 + return null;
6.36 + }
6.37
6.38 -
6.39 + /** Use the convertor from <code>createCZKtoUSD</code> method and do few conversions
6.40 + * with it.
6.41 + */
6.42 public void testCurrencyCZKUSD() throws Exception {
6.43 -
6.44 + Convertor c = createCZKtoUSD();
6.45 + // convert $5 to CZK using c:
6.46 + // assertEquals("Result is 85 CZK");
6.47 +
6.48 + // convert $8 to CZK
6.49 + // assertEquals("Result is 136 CZK");
6.50 +
6.51 + // convert 1003CZK to USD
6.52 + // assertEquals("Result is 59 USD");
6.53 + }
6.54 +
6.55 + /** Use the convertor from <code>createSKKtoCZK</code> method and do few conversions
6.56 + * with it.
6.57 + */
6.58 + public void testCurrencySKKCZK() throws Exception {
6.59 + Convertor c = createSKKtoCZK();
6.60 + // convert 16CZK using c:
6.61 + // assertEquals("Result is 20 SKK");
6.62 +
6.63 + // convert 500SKK to CZK
6.64 + // assertEquals("Result is 400 CZK");
6.65 }
6.66 }
6.67 +