@@ -0,0 +1,2289 @@
+/*%0A * ConnectBot: simple, powerful, open-source SSH client for Android%0A * Copyright 2015 Kenny Root, Jeffrey Sharkey%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.connectbot;%0A%0Aimport org.connectbot.service.TerminalManager;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.robolectric.Robolectric;%0Aimport org.robolectric.RobolectricGradleTestRunner;%0Aimport org.robolectric.RuntimeEnvironment;%0Aimport org.robolectric.annotation.Config;%0A%0Aimport android.content.ComponentName;%0Aimport android.content.Intent;%0Aimport android.os.Build;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.spy;%0Aimport static org.mockito.Mockito.when;%0Aimport static org.robolectric.Shadows.shadowOf;%0A%0A@RunWith(RobolectricGradleTestRunner.class)%0A@Config(constants = BuildConfig.class, sdk = Build.VERSION_CODES.KITKAT, packageName = %22org.connectbot%22)%0Apublic class HostListActivityTest %7B%0A%09private void mockBindToService(TerminalManager terminalManager) %7B%0A%09%09TerminalManager.TerminalBinder stubBinder = mock(TerminalManager.TerminalBinder.class);%0A%09%09when(stubBinder.getService()).thenReturn(terminalManager);%0A%09%09shadowOf(RuntimeEnvironment.application).setComponentNameAndServiceForBindService(new ComponentName(%22org.connectbot%22, TerminalManager.class.getName()), stubBinder);%0A%09%7D%0A%0A%09@Test%0A%09public void bindsToTerminalManager() %7B%0A%09%09TerminalManager terminalManager = spy(TerminalManager.class);%0A%09%09mockBindToService(terminalManager);%0A%0A%09%09HostListActivity activity = Robolectric.buildActivity(HostListActivity.class).create().start().get();%0A%0A%09%09Intent serviceIntent = new Intent(activity, TerminalManager.class);%0A%09%09assertThat(shadowOf(activity).getNextStartedService()).isEqualTo(serviceIntent);%0A%09%7D%0A%7D

Add HostListActivity unit test