Skip to content

Commit 57e3a18

Browse files
committed
1 parent 8b2230b commit 57e3a18

File tree

6 files changed

+149
-11
lines changed

6 files changed

+149
-11
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://java.sun.com/xml/ns/javaee"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
5+
</beans>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2013, Werner Keil, JUGChennai and others.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
package org.javamoney.shelter.bitcoin.provider;
16+
17+
import javax.money.CurrencyUnit;
18+
import javax.money.MonetaryException;
19+
20+
import org.javamoney.convert.ExchangeRate;
21+
import org.javamoney.moneta.MoneyCurrency;
22+
23+
24+
/**
25+
* @author Werner Keil
26+
*
27+
*/
28+
public class MtGoxV2ConversionDemo {
29+
public static void main(String... arg) throws MonetaryException {
30+
CurrencyUnit btc = BTCCurrency.of();
31+
System.out.println("Currency: " + btc);
32+
MtGoxV2ConversionProvider provider = new MtGoxV2ConversionProvider("USD");
33+
//MtGoxV2ConversionProvider provider = new MtGoxV2ConversionProvider();
34+
//provider.loadRate("USD", true);
35+
ExchangeRate rate = provider.getExchangeRate(MoneyCurrency.of("USD"), btc);
36+
System.out.println("Rate: " + rate);
37+
38+
rate = provider.getExchangeRate(MoneyCurrency.of("EUR"), btc);
39+
System.out.println("Rate2: " + rate);
40+
41+
rate = provider.getExchangeRate(MoneyCurrency.of("CHF"), btc);
42+
System.out.println("Rate3: " + rate);
43+
}
44+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) 2013, Werner Keil, JUGChennai and others.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
package org.javamoney.shelter.bitcoin.provider;
16+
17+
import org.javamoney.convert.ExchangeRateType;
18+
import org.junit.Test;
19+
20+
import static org.junit.Assert.*;
21+
22+
/**
23+
* @author Werner Keil
24+
* @author Rajmahendra Hegde <[email protected]>
25+
*/
26+
public class MtGoxV2ConversionProviderTest {
27+
28+
private static final ExchangeRateType MTGOX_RATE_TYPE = ExchangeRateType
29+
.of("MtGox");
30+
31+
public MtGoxV2ConversionProviderTest() {
32+
}
33+
34+
@Test
35+
public void testMtGoxConversionProviderIsNotNull() {
36+
assertNotNull(MTGOX_RATE_TYPE);
37+
}
38+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://java.sun.com/xml/ns/javaee"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
5+
</beans>

digital-currency/pom.xml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2-
<modelVersion>4.0.0</modelVersion>
3-
<parent>
4-
<groupId>org.javamoney.shelter</groupId>
5-
<artifactId>javamoney-shelter</artifactId>
6-
<version>0.1-SNAPSHOT</version>
7-
</parent>
8-
<artifactId>javamoney-digital-currency</artifactId>
9-
<packaging>pom</packaging>
10-
<name>JavaMoney Digital Currencies</name>
11-
<description>Digital Currency Support</description>
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>org.javamoney.shelter</groupId>
6+
<artifactId>javamoney-shelter</artifactId>
7+
<version>0.1-SNAPSHOT</version>
8+
</parent>
9+
<artifactId>javamoney-digital-currency</artifactId>
10+
<packaging>pom</packaging>
11+
<name>JavaMoney Digital Currencies</name>
12+
<description>Digital Currency Support</description>
13+
14+
<modules>
15+
<module>bitcoin</module>
16+
</modules>
1217
</project>

digital-currency/src/site/site.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<project name="JavaMoney">
3+
<publishDate position="navigation-bottom" format="yyyy-MM-dd"/>
4+
<bannerLeft>
5+
<name>Github.com</name>
6+
<href>http://www.github.com</href>
7+
</bannerLeft>
8+
<bannerRight>
9+
<name>Java Money</name>
10+
<href>http://javamoney.org</href>
11+
</bannerRight>
12+
13+
<body>
14+
<menu name="Java Money">
15+
<item name="Overview" href="index.html"/>
16+
<item name="User guide" href="userguide.html"/>
17+
<!--item name="FAQ" href="faq.html"/-->
18+
<item name="Javadoc" href="apidocs/index.html"/>
19+
<item name="License" href="licensecover.html"/>
20+
<item name="Release notes" href="changes-report.html"/>
21+
<item name="Download" href="http://java.net/projects/javamoney/downloads"/>
22+
</menu>
23+
24+
<menu name="Development">
25+
<item name="GitHub (Source code)" href="https://github.com/JavaMoney/money-examples"/>
26+
<item name="Java.net" href="http://java.net/projects/javamoney/"/>
27+
<item name="Test results" href="surefire-report.html"/>
28+
<item name="Test coverage" href="/cobertura/index.html"/>
29+
<item name="Mailing lists" href="mail-lists.html"/>
30+
<item name="Tasks" href="tasks.html"/>
31+
<item name="Javadoc (Latest)" href="apidocs/index.html"/>
32+
</menu>
33+
34+
<menu ref="reports"/>
35+
</body>
36+
37+
<poweredBy>
38+
<logo name="Java.net" href="http://java.net/projects/javamoney/"
39+
img="http://sourceforge.net/sflogo.php?group_id=274452&amp;type=2" width="125" height="37" />
40+
</poweredBy>
41+
</project>

0 commit comments

Comments
 (0)