1e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray/* 2e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * Copyright (C) 2015 The Android Open Source Project 3e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * 4e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * Licensed under the Apache License, Version 2.0 (the "License"); 5e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * you may not use this file except in compliance with the License. 6e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * You may obtain a copy of the License at 7e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * 8e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * http://www.apache.org/licenses/LICENSE-2.0 9e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * 10e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * Unless required by applicable law or agreed to in writing, software 11e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * distributed under the License is distributed on an "AS IS" BASIS, 12e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * See the License for the specific language governing permissions and 14e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray * limitations under the License. 15e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray */ 16e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray 17e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffrayimport java.lang.reflect.Method; 18e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray 19e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffraypublic class Main { 20e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray static void assertEquals(int expected, int value) { 21e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray if (expected != value) { 22e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray throw new Error("Expected " + expected + ", got " + value); 23e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray } 24e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray } 25e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray 26e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray public static void main(String[] args) throws Exception { 27e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray Class<?> c = Class.forName("InvokeSuper"); 28e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray Method m = c.getMethod("run"); 29e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray assertEquals(42, ((Integer)m.invoke(c.newInstance(), new Object[0])).intValue()); 30e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray } 31e523423a053af5cb55837f07ceae9ff2fd581712Nicolas Geoffray} 32