WeightTest.java revision f90177629a5b69ca3a80466c0ab55abfeb6d26b2
1/* 2 * Copyright (C) 2007 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 17package android.widget.layout.linear; 18 19import android.app.Activity; 20import android.test.ActivityInstrumentationTestCase; 21import android.test.suitebuilder.annotation.MediumTest; 22import android.test.ViewAsserts; 23import android.test.suitebuilder.annotation.Suppress; 24import android.view.View; 25 26import com.android.frameworks.coretests.R; 27import android.widget.layout.linear.Weight; 28 29@Suppress // Failing. 30public class WeightTest extends ActivityInstrumentationTestCase<Weight> { 31 private View mChild; 32 private View mContainer; 33 34 public WeightTest() { 35 super("com.android.frameworks.coretests", Weight.class); 36 } 37 38 @Override 39 protected void setUp() throws Exception { 40 super.setUp(); 41 42 final Activity activity = getActivity(); 43 mChild = activity.findViewById(R.id.child4); 44 mContainer = activity.findViewById(R.id.layout); 45 } 46 47 @MediumTest 48 public void testPreconditions() { 49 assertNotNull(mChild); 50 assertNotNull(mContainer); 51 } 52 53 @MediumTest 54 public void testLayout() { 55 ViewAsserts.assertRightAligned(mChild, mContainer); 56 } 57} 58