testmethods.java

来自「一个关于java 的常用工具包」· Java 代码 · 共 65 行

JAVA
65
字号
package org.jutiltest.java.reflect;import org.jutil.java.reflect.Methods;import org.jutil.junit.JutilTest;import org.jutil.junit.CVSRevision;import org.jutil.java.collections.Visitor;import junit.framework.*;import java.util.List;import java.util.Vector;import java.util.Set;/**  * @path    $Source: /cvsroot/org-jutil/jutil.org/src/org/jutiltest/java/reflect/TestMethods.java,v $ * @date    $Date: 2002/07/20 19:11:33 $ * @state   $State: Exp $ * @author  Marko van Dooren * @release $Name:  $ */public class TestMethods extends JutilTest {    public TestMethods(String name) {    super(name, new CVSRevision("1.8"));  }  public void setUp() {  }      public void testMethods() {    Set set = Methods.getAllApplicableMethods(Object.class);    assertTrue(set.size() == 12);    set = Methods.getAllApplicableMethods(Methods.class);    assertTrue(set.size() == 13);//     set = Methods.getAllApplicableMethods(A.class);//     new Visitor() {//       public void visit(Object element) {//         System.out.println(element);//       }//     }.applyTo(set);//     assertTrue(set.size() == 17);  }  class A {    public void a() {}    public void b() {}    private void c() {}    void d() {}    protected void e() {}  }    }/*<copyright>Copyright (C) 1997-2001. This software is copyrighted by the people and entities mentioned after the "@author" tags above, on behalf of the JUTIL.ORG Project. The copyright is dated by the dates after the "@date" tags above. All rights reserved.This software is published under the terms of the JUTIL.ORG SoftwareLicense version 1.1 or later, a copy of which has been included withthis distribution in the LICENSE file, which can also be found athttp://org-jutil.sourceforge.net/LICENSE. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the JUTIL.ORG Software License for more details.For more information, please see http://org-jutil.sourceforge.net/</copyright>*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?