105e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel/* 205e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * Copyright (C) 2014 The Android Open Source Project 305e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * 405e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * Licensed under the Apache License, Version 2.0 (the "License"); 505e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * you may not use this file except in compliance with the License. 605e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * You may obtain a copy of the License at 705e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * 805e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * http://www.apache.org/licenses/LICENSE-2.0 905e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * 1005e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * Unless required by applicable law or agreed to in writing, software 1105e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * distributed under the License is distributed on an "AS IS" BASIS, 1205e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1305e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * See the License for the specific language governing permissions and 1405e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * limitations under the License. 1505e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel */ 1605e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Rousselpackage com.android.framework.multidexlegacyversionedtestapp; 1705e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel 1805e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Rousselimport android.test.ActivityInstrumentationTestCase2; 1905e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel 2005e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel/** 2105e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * Run the tests with: <code>adb shell am instrument -w 2205e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel com.android.framework.multidexlegacyversionedtestapp/android.test.InstrumentationTestRunner 2305e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel</code> 2405e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel */ 2505e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Rousselpublic class MultiDexUpdateTest extends ActivityInstrumentationTestCase2<MainActivity> 2605e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel{ 2705e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel public MultiDexUpdateTest() { 2805e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel super(MainActivity.class); 2905e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel } 3005e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel 3105e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel /** 3205e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * Tests that all classes of the application can be loaded. Verifies also that we load the 3305e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel * correct version of {@link Version} ie the class is the secondary dex file. 3405e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel */ 3505e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel public void testAllClassAvailable() 3605e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel { 3705e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel assertEquals(2, getActivity().getVersion()); 3805e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel } 3905e2a94c8b510131f43a686f5188d4c0f2a5eebdYohann Roussel} 40