KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > i18n > test > ResourceManagerTestCase


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.excalibur.i18n.test;
9
10 import java.util.MissingResourceException JavaDoc;
11 import org.apache.avalon.excalibur.i18n.ResourceManager;
12 import org.apache.avalon.excalibur.i18n.Resources;
13 import junit.framework.TestCase;
14
15 /**
16  * TestCase for ResourceManager.
17  *
18  * @author <a HREF="mailto:colus@apache.org">Eung-ju Park</a>
19  */

20 public class ResourceManagerTestCase
21     extends TestCase
22 {
23     public ResourceManagerTestCase( final String JavaDoc name )
24     {
25         super( name );
26     }
27
28     public void testClassResources()
29     {
30         try
31         {
32             final Resources resources =
33                 ResourceManager.getClassResources( getClass() );
34
35             resources.getBundle();
36         }
37         catch ( final MissingResourceException JavaDoc mre )
38         {
39             fail( "Unable to find class resource for class " + getClass() );
40         }
41     }
42
43     public void testPackageResources()
44     {
45         try
46         {
47             final Resources resources =
48                 ResourceManager.getPackageResources( getClass() );
49
50             resources.getBundle();
51         }
52         catch ( final MissingResourceException JavaDoc mre )
53         {
54             fail( "Unable to find package resources for class " + getClass() );
55         }
56     }
57 }
58
Popular Tags