KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > beans > test > AdaptersTest


1 /*
2  * Copyright (c) 2003-2004, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.beans.test;
8
9
10 import junit.framework.TestCase;
11
12 import com.inversoft.beans.ConversionListenerAdapter;
13 import com.inversoft.beans.PropertyListenerAdapter;
14
15
16 /**
17  * <p>
18  * This class tests the adapter classes for jBeans.
19  * </p>
20  *
21  * @author Brian Pontarelli
22  */

23 public class AdaptersTest extends TestCase {
24
25     /**
26      * Constructs a new <code>AdaptersTest</code>.
27      */

28     public AdaptersTest(String JavaDoc name) {
29         super(name);
30     }
31
32
33     /**
34      * This is really just a compile time test. This won't compile unless the
35      * adapters are not correct.
36      */

37     public void testAll() {
38         ConversionListenerAdapter ca = new ConversionListenerAdapter() {
39         };
40
41         // Lame, but this ensures that no code is in there in a really, really
42
// naive kinda way
43
try {
44             ca.handleFailedConversion(null);
45             ca.handlePostConversion(null);
46             ca.handlePreConversion(null);
47         } catch (Throwable JavaDoc t) {
48             fail(t.toString());
49         }
50
51         PropertyListenerAdapter pa = new PropertyListenerAdapter() {
52         };
53
54         // Lame, but this ensures that no code is in there in a really, really
55
// naive kinda way
56
try {
57             pa.handleGet(null);
58             pa.handleSet(null);
59         } catch (Throwable JavaDoc t) {
60             fail(t.toString());
61         }
62     }
63 }
64
Popular Tags