1/* 2 * Copyright (C) 2015 The Android Open Source Project 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 * http://www.apache.org/licenses/LICENSE-2.0 7 * Unless required by applicable law or agreed to in writing, software 8 * distributed under the License is distributed on an "AS IS" BASIS, 9 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 * See the License for the specific language governing permissions and 11 * limitations under the License. 12 */ 13 14package android.databinding.testapp; 15 16import android.databinding.testapp.BaseDataBinderTest; 17import android.databinding.testapp.R; 18import android.databinding.testapp.databinding.ObservableWithNotBindableFieldBinding; 19import android.databinding.testapp.vo.ObservableWithNotBindableFieldObject; 20 21import android.test.UiThreadTest; 22 23public class ObservableWithNotBindableFieldObjectTest extends BaseDataBinderTest<ObservableWithNotBindableFieldBinding> { 24 25 26 public ObservableWithNotBindableFieldObjectTest() { 27 super(ObservableWithNotBindableFieldBinding.class); 28 } 29 30 @UiThreadTest 31 public void testSimple() { 32 initBinder(); 33 ObservableWithNotBindableFieldObject obj = new ObservableWithNotBindableFieldObject(); 34 mBinder.setObj(obj); 35 mBinder.executePendingBindings(); 36 assertEquals("", mBinder.textView.getText().toString()); 37 obj.update("100"); 38 mBinder.executePendingBindings(); 39 assertEquals("100", mBinder.textView.getText().toString()); 40 } 41} 42