17c1b078ca84336caba7f811709836562bd5550d6George Mount/* 27c1b078ca84336caba7f811709836562bd5550d6George Mount * Copyright (C) 2015 The Android Open Source Project 37c1b078ca84336caba7f811709836562bd5550d6George Mount * 47c1b078ca84336caba7f811709836562bd5550d6George Mount * Licensed under the Apache License, Version 2.0 (the "License"); 57c1b078ca84336caba7f811709836562bd5550d6George Mount * you may not use this file except in compliance with the License. 67c1b078ca84336caba7f811709836562bd5550d6George Mount * You may obtain a copy of the License at 77c1b078ca84336caba7f811709836562bd5550d6George Mount * 87c1b078ca84336caba7f811709836562bd5550d6George Mount * http://www.apache.org/licenses/LICENSE-2.0 97c1b078ca84336caba7f811709836562bd5550d6George Mount * 107c1b078ca84336caba7f811709836562bd5550d6George Mount * Unless required by applicable law or agreed to in writing, software 117c1b078ca84336caba7f811709836562bd5550d6George Mount * distributed under the License is distributed on an "AS IS" BASIS, 127c1b078ca84336caba7f811709836562bd5550d6George Mount * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 137c1b078ca84336caba7f811709836562bd5550d6George Mount * See the License for the specific language governing permissions and 147c1b078ca84336caba7f811709836562bd5550d6George Mount * limitations under the License. 157c1b078ca84336caba7f811709836562bd5550d6George Mount */ 167c1b078ca84336caba7f811709836562bd5550d6George Mountpackage android.databinding.testapp; 177c1b078ca84336caba7f811709836562bd5550d6George Mount 187c1b078ca84336caba7f811709836562bd5550d6George Mountimport android.databinding.testapp.databinding.DuplicateContextBinding; 197c1b078ca84336caba7f811709836562bd5550d6George Mount 207c1b078ca84336caba7f811709836562bd5550d6George Mountimport android.test.UiThreadTest; 217c1b078ca84336caba7f811709836562bd5550d6George Mountimport android.widget.TextView; 227c1b078ca84336caba7f811709836562bd5550d6George Mount 237c1b078ca84336caba7f811709836562bd5550d6George Mountpublic class DuplicateContextTest extends BaseDataBinderTest<DuplicateContextBinding> { 247c1b078ca84336caba7f811709836562bd5550d6George Mount 257c1b078ca84336caba7f811709836562bd5550d6George Mount public DuplicateContextTest() { 267c1b078ca84336caba7f811709836562bd5550d6George Mount super(DuplicateContextBinding.class); 277c1b078ca84336caba7f811709836562bd5550d6George Mount } 287c1b078ca84336caba7f811709836562bd5550d6George Mount 297c1b078ca84336caba7f811709836562bd5550d6George Mount @UiThreadTest 307c1b078ca84336caba7f811709836562bd5550d6George Mount public void testContext() throws Throwable { 317c1b078ca84336caba7f811709836562bd5550d6George Mount DuplicateContextBinding binding = initBinder(); 327c1b078ca84336caba7f811709836562bd5550d6George Mount binding.setContext("Hello World"); 337c1b078ca84336caba7f811709836562bd5550d6George Mount binding.executePendingBindings(); 347c1b078ca84336caba7f811709836562bd5550d6George Mount assertEquals("Hello World", binding.textView1.getText().toString()); 357c1b078ca84336caba7f811709836562bd5550d6George Mount } 367c1b078ca84336caba7f811709836562bd5550d6George Mount} 37