1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.jdtaus.banking.ri.currencydir.test;
21
22 import java.util.Currency;
23 import java.util.Date;
24 import junit.framework.Assert;
25 import org.jdtaus.banking.ri.currencydir.JaxpCurrencyDirectory;
26 import org.jdtaus.banking.spi.UnsupportedCurrencyException;
27
28
29
30
31
32
33
34 public class JaxpCurrencyDirectory_NoCurrencies_Test extends AbstractJaxpCurrencyDirectoryTest
35 {
36
37 protected ClassLoader getClassLoader()
38 {
39 return this.getClass().getClassLoader();
40 }
41
42 public void testCurrencyConstraints() throws Exception
43 {
44 System.out.println( "Skipped due to empty directory." );
45 }
46
47 public void testGetDtausCode() throws Exception
48 {
49 assert this.getCurrencyMapper() != null;
50
51 try
52 {
53 this.getCurrencyMapper().getDtausCode( null, new Date() );
54 throw new AssertionError();
55 }
56 catch ( NullPointerException e )
57 {
58 Assert.assertNotNull( e.getMessage() );
59 System.out.println( e.toString() );
60 }
61
62 try
63 {
64 this.getCurrencyMapper().getDtausCode( Currency.getInstance( "EUR" ), null );
65 throw new AssertionError();
66 }
67 catch ( NullPointerException e )
68 {
69 Assert.assertNotNull( e.getMessage() );
70 System.out.println( e.toString() );
71 }
72
73 try
74 {
75 this.getCurrencyMapper().getDtausCode( Currency.getInstance( "DEM" ), new Date() );
76 throw new AssertionError();
77 }
78 catch ( UnsupportedCurrencyException e )
79 {
80 Assert.assertNotNull( e.getMessage() );
81 System.out.println( e.toString() );
82 }
83 }
84
85 public void testGetDtausCurrency() throws Exception
86 {
87 assert this.getCurrencyMapper() != null;
88
89 try
90 {
91 this.getCurrencyMapper().getDtausCurrency( '1', null );
92 throw new AssertionError();
93 }
94 catch ( NullPointerException e )
95 {
96 Assert.assertNotNull( e.getMessage() );
97 System.out.println( e.toString() );
98 }
99 }
100
101 }