jeffhao | 5d1ac92 | 2011-09-29 17:41:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 The Android Open Source Project |
| 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 | |
Hiroshi Yamauchi | 75d5053 | 2015-12-04 16:18:49 -0800 | [diff] [blame] | 17 | import java.util.HashMap; |
| 18 | |
jeffhao | 5d1ac92 | 2011-09-29 17:41:15 -0700 | [diff] [blame] | 19 | /** |
| 20 | * Test java.lang.reflect.Proxy |
| 21 | */ |
| 22 | public class Main { |
| 23 | public static void main(String[] args) { |
Ian Rogers | 466bb25 | 2011-10-14 03:29:56 -0700 | [diff] [blame] | 24 | ReturnsAndArgPassing.main(null); |
jeffhao | 5d1ac92 | 2011-09-29 17:41:15 -0700 | [diff] [blame] | 25 | BasicTest.main(null); |
| 26 | Clash.main(null); |
| 27 | Clash2.main(null); |
| 28 | Clash3.main(null); |
| 29 | Clash4.main(null); |
| 30 | WrappedThrow.main(null); |
Ian Rogers | 530f71c | 2013-02-22 23:29:00 -0800 | [diff] [blame] | 31 | NarrowingTest.main(null); |
Andreas Gampe | 96849ce | 2014-06-02 11:23:43 -0700 | [diff] [blame] | 32 | FloatSelect.main(null); |
Andreas Gampe | e806732 | 2015-09-08 17:42:59 -0700 | [diff] [blame] | 33 | NativeProxy.main(args); |
Alex Light | 52c9da0 | 2016-05-09 15:31:18 -0700 | [diff] [blame] | 34 | ConstructorProxy.main(); |
Andreas Gampe | ee29a07 | 2017-11-02 15:28:09 -0700 | [diff] [blame] | 35 | OOMEOnDispatch.main(args); |
jeffhao | 5d1ac92 | 2011-09-29 17:41:15 -0700 | [diff] [blame] | 36 | } |
Hiroshi Yamauchi | 75d5053 | 2015-12-04 16:18:49 -0800 | [diff] [blame] | 37 | |
| 38 | // The following code maps from the actual proxy class names (eg $Proxy2) to their test output |
| 39 | // names (eg $PROXY_CLASS_NAME1$). This is to avoid the flaky test failures due to potentially |
| 40 | // undeterministic proxy class naming. |
| 41 | |
| 42 | public static void registerProxyClassName(String proxyClassName) { |
| 43 | proxyClassNameMap.put(proxyClassName, |
| 44 | "$PROXY_CLASS_NAME" + (uniqueTestProxyClassNum++) + "$"); |
| 45 | } |
| 46 | |
| 47 | public static String replaceProxyClassNamesForOutput(String str) { |
| 48 | for (String key : proxyClassNameMap.keySet()) { |
| 49 | str = str.replace(key, proxyClassNameMap.get(key)); |
| 50 | } |
| 51 | return str; |
| 52 | } |
| 53 | |
| 54 | private static final HashMap<String, String> proxyClassNameMap = new HashMap<String, String>(); |
| 55 | |
| 56 | private static int uniqueTestProxyClassNum = 0; |
jeffhao | 5d1ac92 | 2011-09-29 17:41:15 -0700 | [diff] [blame] | 57 | } |