@@ -0,0 +1,2412 @@
+package com.mamewo.podplayer0.tests;%0A%0Aimport com.mamewo.podplayer0.MainActivity;%0Aimport com.mamewo.podplayer0.PodplayerActivity;%0Aimport com.mamewo.podplayer0.PodplayerExpActivity;%0A%0Aimport android.app.Activity;%0Aimport android.content.SharedPreferences;%0Aimport android.preference.PreferenceManager;%0Aimport android.test.ActivityInstrumentationTestCase2;%0Aimport android.util.Log;%0Aimport asia.sonix.scirocco.SciroccoSolo;%0A%0Apublic class MainActivityTest%0Aextends ActivityInstrumentationTestCase2%3CMainActivity%3E%0A%7B%0A%09private SciroccoSolo solo_;%0A%09static final%0A%09private String TAG = %22podtest%22;%0A%09%0A%09public MainActivityTest() %7B%0A%09%09super(%22com.mamewo.podplayer0%22, MainActivity.class);%0A%09%7D%0A%09%0A%09@Override%0A%09public void setUp() %7B%0A%09%09solo_ = new SciroccoSolo(getInstrumentation(), getActivity(), %22com.mamewo.podtest%22);%0A%09%7D%0A%09%0A%09@Override%0A%09public void tearDown() throws Exception %7B%0A%09%09try %7B%0A%09%09%09solo_.takeScreenShot();%0A%09%09%09solo_.finalize();%0A%09%09%7D%0A%09%09catch(Throwable e) %7B%0A%09%09%09Log.i(TAG, %22tearDown error%22, e);%0A%09%09%7D%0A%09%09if (! getActivity().isFinishing()) %7B%0A%09%09%09getActivity().finish();%0A%09%09%7D%0A%09%09super.tearDown();%0A%09%7D%0A%09%0A%09public void testStart() %7B%0A%09%09Activity activity = getActivity();%0A%09%09SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(activity);%0A%09%09boolean prevValue = pref.getBoolean(%22use_expandable_ui%22, false);%0A%09%09String activityClass;%0A%09%09if (prevValue) %7B%0A%09%09%09activityClass = PodplayerExpActivity.class.getName();%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09activityClass = PodplayerActivity.class.getName();%0A%09%09%7D%0A//%09%09Activity last = solo_.getActivityMonitor().getLastActivity();%0A%09%09solo_.sleep(3000);%0A%09%09Log.d(TAG, %22testStart: %22 + prevValue + %22 / %22 + activityClass);%0A%09%09//assertEquals(activityClass, last.getClass().getName());%0A%09%09pref.edit().putBoolean(%22use_expandable_ui%22, !prevValue).commit();%0A%09%7D%0A%09%0A%09public void testStart2() %7B%0A%09%09Activity activity = getActivity();%0A%09%09SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(activity);%0A%09%09boolean prevValue = pref.getBoolean(%22use_expandable_ui%22, false);%0A%09%09String activityClass;%0A%09%09if (prevValue) %7B%0A%09%09%09activityClass = PodplayerExpActivity.class.getName();%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09activityClass = PodplayerActivity.class.getName();%0A%09%09%7D%0A//%09%09Activity last = solo_.getActivityMonitor().getLastActivity();%0A%09%09solo_.sleep(3000);%0A%09%09Log.d(TAG, %22testStart: %22 + prevValue + %22 / %22 + activityClass);%0A%09%09//assertEquals(activityClass, last.getClass().getName());%0A%09%09pref.edit().putBoolean(%22use_expandable_ui%22, !prevValue).commit();%0A%09%7D%0A%7D%0A

test MainActivity without assert..