wuxw7
2018-04-13 3de85d01308c5efa0bc77d4a02fdc9a16d5aa9fb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.java110.order.type;
 
import com.java110.order.AppTest;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.ibatis.plugin.Signature;
 
import java.io.IOException;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
 
/**
 * Created by wuxw on 2017/4/14.
 */
public class TypeTest
 
    extends TestCase
    {
        /**
         * Create the test case
         *
         * @param testName name of the test case
         */
    public TypeTest( String testName )
        {
            super( testName );
        }
 
        /**
         * @return the suite of tests being tested
         */
    public static Test suite()
    {
        return new TestSuite( TypeTest.class );
    }
 
        /**
         *
         * @since 1.7
         * @throws Exception
         */
    public void testType() throws Exception{
       Object obj = Class.forName("com.java110.order.type.CustDispatchListener").newInstance();
        Type[] types = obj.getClass().getGenericInterfaces();
       System.out.println(((ParameterizedType)types[0]).getActualTypeArguments()[0].getTypeName());
    }
}