19e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar/* 29e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar * Copyright (C) 2015 The Android Open Source Project 39e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar * Licensed under the Apache License, Version 2.0 (the "License"); 49e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar * you may not use this file except in compliance with the License. 59e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar * You may obtain a copy of the License at 69e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar * http://www.apache.org/licenses/LICENSE-2.0 79e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar * Unless required by applicable law or agreed to in writing, software 89e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar * distributed under the License is distributed on an "AS IS" BASIS, 99e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 109e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar * See the License for the specific language governing permissions and 119e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar * limitations under the License. 129e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar */ 139e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar 14fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountpackage android.databinding.testapp; 159e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar 16fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountimport android.databinding.testapp.BaseDataBinderTest; 17fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountimport android.databinding.testapp.R; 182e2043d30f95585de2069e1cbb23e022ab0e71c4George Mountimport android.databinding.testapp.databinding.ObservableWithNotBindableFieldBinding; 19fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountimport android.databinding.testapp.vo.ObservableWithNotBindableFieldObject; 209e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar 219e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyarimport android.test.UiThreadTest; 229e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar 234c5cc009bcbcfb19e33fb19db5ec80f83f7b3326George Mountpublic class ObservableWithNotBindableFieldObjectTest extends BaseDataBinderTest<ObservableWithNotBindableFieldBinding> { 249e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar 259e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar 269e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar public ObservableWithNotBindableFieldObjectTest() { 274c5cc009bcbcfb19e33fb19db5ec80f83f7b3326George Mount super(ObservableWithNotBindableFieldBinding.class); 289e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar } 299e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar 309e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar @UiThreadTest 319e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar public void testSimple() { 323f73e3149732132c02f5d19aab7b5da429794058Yigit Boyar initBinder(); 339e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar ObservableWithNotBindableFieldObject obj = new ObservableWithNotBindableFieldObject(); 349e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar mBinder.setObj(obj); 354c5cc009bcbcfb19e33fb19db5ec80f83f7b3326George Mount mBinder.executePendingBindings(); 3634a18e6a231f3b64726bd93e7e097a0d5a75995dGeorge Mount assertEquals("", mBinder.textView.getText().toString()); 379e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar obj.update("100"); 384c5cc009bcbcfb19e33fb19db5ec80f83f7b3326George Mount mBinder.executePendingBindings(); 3934a18e6a231f3b64726bd93e7e097a0d5a75995dGeorge Mount assertEquals("100", mBinder.textView.getText().toString()); 409e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar } 419e20571da789c7d50650513c38d5a333b11b9fd3Yigit Boyar} 42