@@ -0,0 +1,1593 @@
+package ca.six.aut;%0A%0Aimport android.content.Intent;%0Aimport android.widget.TextView;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.JUnit4;%0Aimport org.robolectric.Robolectric;%0Aimport org.robolectric.RobolectricGradleTestRunner;%0Aimport org.robolectric.RobolectricTestRunner;%0Aimport org.robolectric.annotation.Config;%0A%0Aimport cn.six.aut.BuildConfig;%0Aimport cn.six.aut.R;%0Aimport cn.six.jump.JumpToActivity;%0A%0Aimport static junit.framework.Assert.assertEquals;%0Aimport static junit.framework.Assert.assertNotNull;%0Aimport static junit.framework.Assert.assertNull;%0A%0A/**%0A * Created by songzhw on 2016-09-27%0A */%0A@RunWith(RobolectricTestRunner.class)  // %E4%B8%8D%E7%94%A8%E8%BF%99%E4%B8%AA%EF%BC%8C %E5%B0%B1%E5%9C%A8buildActivity%E6%97%B6%E4%BC%9A%E9%94%99%E7%9A%84%0A@Config(constants = BuildConfig.class) // %E4%BF%AE%E5%A4%8D%E8%AF%B4%E6%89%BE%E4%B8%8D%E5%88%B0AndroidManifest%E7%9A%84warning%0Apublic class Jump2ActivityTest %7B%0A    public JumpToActivity toActivity;%0A    public TextView tv;%0A%0A    @Before%0A    public void setUp()%7B%0A        Intent it = new Intent();%0A        it.putExtra(JumpToActivity.KEY_EXTRA_MESSAGE, %2220160927Test%22);%0A%0A        // Robolectric.buildActivity() will cause tv to be null%0A        toActivity = Robolectric.buildActivity(JumpToActivity.class)%0A                        .withIntent(it).create().get();%0A        tv = (TextView) toActivity.findViewById(R.id.tv_jumpto_display);%0A    %7D%0A%0A    @Test%0A    public void testActvNotNull() %7B%0A        assertNotNull(toActivity);%0A    %7D%0A%0A    @Test%0A    public void testTextAfterShowing()%7B%0A        assertNotNull(tv);%0A        System.out.println(%22szw tv.text = %22+tv.getText());%0A        assertEquals(%2220160927Test%22, tv.getText());%0A    %7D%0A%7D%0A

test the Activity with intent