diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-07-28 08:04:28 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-07-28 08:04:28 +0000 |
commit | bc0919b6fea37a236748fd1f7a480b6aad3baf46 (patch) | |
tree | 3fc6e6c04df85de803f0f408479cdb83b4caa155 /sandbox/travelsample | |
parent | 33f529e64bdf8510fd6b560578ba2e0e55327250 (diff) |
Rename and reorganize
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@680280 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sandbox/travelsample/currency-contribution/META-INF/sca-contribution.xml | 22 | ||||
-rw-r--r-- | sandbox/travelsample/currency-contribution/pom.xml (renamed from sandbox/travelsample/currencyconverter/pom.xml) | 18 | ||||
-rw-r--r-- | sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverter.java (renamed from sandbox/travelsample/currencyconverter/src/main/java/currencyconverter/CurrencyConverter.java) | 9 | ||||
-rw-r--r-- | sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverterImpl.java (renamed from sandbox/travelsample/currencyconverter/src/main/java/currencyconverter/CurrencyConverterImpl.java) | 4 | ||||
-rw-r--r-- | sandbox/travelsample/currencyconverter/src/main/resources/currencyconverter.composite | 29 | ||||
-rw-r--r-- | sandbox/travelsample/currencyconverter/src/test/java/currencyconverter/CurrencyConverterTestCase.java | 47 |
6 files changed, 44 insertions, 85 deletions
diff --git a/sandbox/travelsample/currency-contribution/META-INF/sca-contribution.xml b/sandbox/travelsample/currency-contribution/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..549a3bc7a3 --- /dev/null +++ b/sandbox/travelsample/currency-contribution/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--> +<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"> + <export.java package="scatours.currencyconverter"/> +</contribution>
\ No newline at end of file diff --git a/sandbox/travelsample/currencyconverter/pom.xml b/sandbox/travelsample/currency-contribution/pom.xml index 3209790341..bf0f7adbc6 100644 --- a/sandbox/travelsample/currencyconverter/pom.xml +++ b/sandbox/travelsample/currency-contribution/pom.xml @@ -22,23 +22,23 @@ <parent> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-sca</artifactId> - <version>2.0-incubating-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> + <version>1.4-SNAPSHOT</version> + <!--relativePath>../../pom.xml</relativePath--> </parent> - <artifactId>scatours-currencyconverter</artifactId> - <name>Apache Tuscany SCA Tours Currency Converter Component</name> + <artifactId>scatours-currency-contribution</artifactId> + <name>Apache Tuscany SCA Tours Currency Converter Contribution</name> <dependencies> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-host-embedded</artifactId> - <version>2.0-incubating-SNAPSHOT</version> + <version>1.4-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-implementation-java-runtime</artifactId> - <version>2.0-incubating-SNAPSHOT</version> + <version>1.4-SNAPSHOT</version> <scope>runtime</scope> </dependency> @@ -53,5 +53,11 @@ <build> <finalName>${artifactId}</finalName> + <sourceDirectory>${basedir}/src</sourceDirectory> + <resources> + <resource> + <directory>${basedir}/resources</directory> + </resource> + </resources> </build> </project> diff --git a/sandbox/travelsample/currencyconverter/src/main/java/currencyconverter/CurrencyConverter.java b/sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverter.java index b73f35c40c..9b3851721f 100644 --- a/sandbox/travelsample/currencyconverter/src/main/java/currencyconverter/CurrencyConverter.java +++ b/sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverter.java @@ -16,13 +16,18 @@ * specific language governing permissions and limitations * under the License. */ -package currencyconverter; +package scatours.currencyconverter; /** * The CurrencyConverter service interface */ public interface CurrencyConverter { - double getExchangeRate(String fromCurrency, String toCurrency); + double getExchangeRate(String fromCurrencyCode, + String toCurrencyCode); + + double convert(String fromCurrencyCode, + String toCurrencyCode, + double amount); } diff --git a/sandbox/travelsample/currencyconverter/src/main/java/currencyconverter/CurrencyConverterImpl.java b/sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverterImpl.java index 6769239b56..06d1d23535 100644 --- a/sandbox/travelsample/currencyconverter/src/main/java/currencyconverter/CurrencyConverterImpl.java +++ b/sandbox/travelsample/currency-contribution/src/scatours/currencyconverter/CurrencyConverterImpl.java @@ -16,12 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -package currencyconverter; +package scatours.currencyconverter; +import org.osoa.sca.annotations.Service; /** * An implementation of the CurrencyConverter service */ +@Service(interfaces={CurrencyConverter.class}) public class CurrencyConverterImpl implements CurrencyConverter { public double getExchangeRate(String fromCurrencyCode, String toCurrencyCode){ diff --git a/sandbox/travelsample/currencyconverter/src/main/resources/currencyconverter.composite b/sandbox/travelsample/currencyconverter/src/main/resources/currencyconverter.composite deleted file mode 100644 index ae94401f6c..0000000000 --- a/sandbox/travelsample/currencyconverter/src/main/resources/currencyconverter.composite +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - targetNamespace="http://scatours" - xmlns:sample="http://scatours" - name="currencyconverter"> - - <component name="CurrencyConverterComponent"> - <implementation.java class="currencyconverter.CurrencyConverterImpl"/> - </component> - -</composite> diff --git a/sandbox/travelsample/currencyconverter/src/test/java/currencyconverter/CurrencyConverterTestCase.java b/sandbox/travelsample/currencyconverter/src/test/java/currencyconverter/CurrencyConverterTestCase.java deleted file mode 100644 index 6bdf32dd0d..0000000000 --- a/sandbox/travelsample/currencyconverter/src/test/java/currencyconverter/CurrencyConverterTestCase.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package currencyconverter; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -/** - * This shows how to test the Calculator service component. - */ -public class CurrencyConverterTestCase extends TestCase { - - private CurrencyConverter currencyConverter; - private SCADomain scaDomain; - - @Override - protected void setUp() throws Exception { - scaDomain = SCADomain.newInstance("currencyconverter.composite"); - currencyConverter = scaDomain.getService(CurrencyConverter.class, "CurrencyConverterComponent"); - } - - @Override - protected void tearDown() throws Exception { - scaDomain.close(); - } - - public void testCurrecncyConverter() throws Exception { - System.out.println(currencyConverter.getExchangeRate("GBP", "USD")); - } -} |