Home | History | Annotate | Download | only in src
      1 // Copyright (C) 2017 The Android Open Source Project
      2 //
      3 // Licensed under the Apache License, Version 2.0 (the "License");
      4 // you may not use this file except in compliance with the License.
      5 // You may obtain a copy of the License at
      6 //
      7 //     http://www.apache.org/licenses/LICENSE-2.0
      8 //
      9 // Unless required by applicable law or agreed to in writing, software
     10 // distributed under the License is distributed on an "AS IS" BASIS,
     11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 // See the License for the specific language governing permissions and
     13 // limitations under the License.
     14 
     15 import java.lang.reflect.Method;
     16 import java.util.ArrayList;
     17 
     18 public class Test {
     19   // Returns list of all methods in Generated.java
     20   // This is to avoid having to introspect classes with extra code
     21   // (for example, we ignore <init> methods).
     22   public static Method[] getTestMethods() throws NoSuchMethodException, SecurityException {
     23     ArrayList<Method> all_methods = new ArrayList<Method>();
     24     all_methods.add(A.class.getDeclaredMethod("m_a$$$"));
     25     all_methods.add(A.class.getDeclaredMethod("m_a$$Startup$"));
     26     all_methods.add(A.class.getDeclaredMethod("m_a$Hot$Startup$"));
     27     all_methods.add(A.class.getDeclaredMethod("m_a$$$Poststartup"));
     28     all_methods.add(A.class.getDeclaredMethod("m_a$Hot$$Poststartup"));
     29     all_methods.add(A.class.getDeclaredMethod("m_a$$Startup$Poststartup"));
     30     all_methods.add(A.class.getDeclaredMethod("m_a$Hot$Startup$Poststartup"));
     31     all_methods.add(A.class.getDeclaredMethod("m_b$$$"));
     32     all_methods.add(A.class.getDeclaredMethod("m_b$$Startup$"));
     33     all_methods.add(A.class.getDeclaredMethod("m_b$Hot$Startup$"));
     34     all_methods.add(A.class.getDeclaredMethod("m_b$$$Poststartup"));
     35     all_methods.add(A.class.getDeclaredMethod("m_b$Hot$$Poststartup"));
     36     all_methods.add(A.class.getDeclaredMethod("m_b$$Startup$Poststartup"));
     37     all_methods.add(A.class.getDeclaredMethod("m_b$Hot$Startup$Poststartup"));
     38     all_methods.add(A.class.getDeclaredMethod("m_c$$$"));
     39     all_methods.add(A.class.getDeclaredMethod("m_c$$Startup$"));
     40     all_methods.add(A.class.getDeclaredMethod("m_c$Hot$Startup$"));
     41     all_methods.add(A.class.getDeclaredMethod("m_c$$$Poststartup"));
     42     all_methods.add(A.class.getDeclaredMethod("m_c$Hot$$Poststartup"));
     43     all_methods.add(A.class.getDeclaredMethod("m_c$$Startup$Poststartup"));
     44     all_methods.add(A.class.getDeclaredMethod("m_c$Hot$Startup$Poststartup"));
     45     all_methods.add(B.class.getDeclaredMethod("m_a$$$"));
     46     all_methods.add(B.class.getDeclaredMethod("m_a$$Startup$"));
     47     all_methods.add(B.class.getDeclaredMethod("m_a$Hot$Startup$"));
     48     all_methods.add(B.class.getDeclaredMethod("m_a$$$Poststartup"));
     49     all_methods.add(B.class.getDeclaredMethod("m_a$Hot$$Poststartup"));
     50     all_methods.add(B.class.getDeclaredMethod("m_a$$Startup$Poststartup"));
     51     all_methods.add(B.class.getDeclaredMethod("m_a$Hot$Startup$Poststartup"));
     52     all_methods.add(B.class.getDeclaredMethod("m_b$$$"));
     53     all_methods.add(B.class.getDeclaredMethod("m_b$$Startup$"));
     54     all_methods.add(B.class.getDeclaredMethod("m_b$Hot$Startup$"));
     55     all_methods.add(B.class.getDeclaredMethod("m_b$$$Poststartup"));
     56     all_methods.add(B.class.getDeclaredMethod("m_b$Hot$$Poststartup"));
     57     all_methods.add(B.class.getDeclaredMethod("m_b$$Startup$Poststartup"));
     58     all_methods.add(B.class.getDeclaredMethod("m_b$Hot$Startup$Poststartup"));
     59     all_methods.add(B.class.getDeclaredMethod("m_c$$$"));
     60     all_methods.add(B.class.getDeclaredMethod("m_c$$Startup$"));
     61     all_methods.add(B.class.getDeclaredMethod("m_c$Hot$Startup$"));
     62     all_methods.add(B.class.getDeclaredMethod("m_c$$$Poststartup"));
     63     all_methods.add(B.class.getDeclaredMethod("m_c$Hot$$Poststartup"));
     64     all_methods.add(B.class.getDeclaredMethod("m_c$$Startup$Poststartup"));
     65     all_methods.add(B.class.getDeclaredMethod("m_c$Hot$Startup$Poststartup"));
     66     all_methods.add(C.class.getDeclaredMethod("m_a$$$"));
     67     all_methods.add(C.class.getDeclaredMethod("m_a$$Startup$"));
     68     all_methods.add(C.class.getDeclaredMethod("m_a$Hot$Startup$"));
     69     all_methods.add(C.class.getDeclaredMethod("m_a$$$Poststartup"));
     70     all_methods.add(C.class.getDeclaredMethod("m_a$Hot$$Poststartup"));
     71     all_methods.add(C.class.getDeclaredMethod("m_a$$Startup$Poststartup"));
     72     all_methods.add(C.class.getDeclaredMethod("m_a$Hot$Startup$Poststartup"));
     73     all_methods.add(C.class.getDeclaredMethod("m_b$$$"));
     74     all_methods.add(C.class.getDeclaredMethod("m_b$$Startup$"));
     75     all_methods.add(C.class.getDeclaredMethod("m_b$Hot$Startup$"));
     76     all_methods.add(C.class.getDeclaredMethod("m_b$$$Poststartup"));
     77     all_methods.add(C.class.getDeclaredMethod("m_b$Hot$$Poststartup"));
     78     all_methods.add(C.class.getDeclaredMethod("m_b$$Startup$Poststartup"));
     79     all_methods.add(C.class.getDeclaredMethod("m_b$Hot$Startup$Poststartup"));
     80     all_methods.add(C.class.getDeclaredMethod("m_c$$$"));
     81     all_methods.add(C.class.getDeclaredMethod("m_c$$Startup$"));
     82     all_methods.add(C.class.getDeclaredMethod("m_c$Hot$Startup$"));
     83     all_methods.add(C.class.getDeclaredMethod("m_c$$$Poststartup"));
     84     all_methods.add(C.class.getDeclaredMethod("m_c$Hot$$Poststartup"));
     85     all_methods.add(C.class.getDeclaredMethod("m_c$$Startup$Poststartup"));
     86     all_methods.add(C.class.getDeclaredMethod("m_c$Hot$Startup$Poststartup"));
     87     return all_methods.toArray(new Method[all_methods.size()]);
     88   }
     89 }
     90 
     91