KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > cglib > proxy > TestNoOp


1 /*
2  * Copyright 2003,2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package net.sf.cglib.proxy;
17
18 import net.sf.cglib.CodeGenTestCase;
19 import java.lang.reflect.*;
20 import java.util.*;
21 import junit.framework.*;
22
23 public class TestNoOp extends CodeGenTestCase {
24     private static class Foo {
25         public Foo() { }
26         public String JavaDoc toString() {
27             return "foo";
28         }
29     }
30     
31     public void testNoOp() {
32         Object JavaDoc obj = Enhancer.create(Foo.class, NoOp.INSTANCE);
33         assertTrue("foo".equals(obj.toString()));
34     }
35
36     public TestNoOp(String JavaDoc testName) {
37         super(testName);
38     }
39     
40     public static void main(String JavaDoc[] args) {
41         junit.textui.TestRunner.run(suite());
42     }
43     
44     public static Test suite() {
45         return new TestSuite(TestNoOp.class);
46     }
47     
48     public void perform(ClassLoader JavaDoc loader) throws Throwable JavaDoc {
49     }
50     
51     public void testFailOnMemoryLeak() throws Throwable JavaDoc {
52     }
53     
54 }
55
Popular Tags