コード例 #1
0
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   mainActivityIntent = new Intent(getInstrumentation().getTargetContext(), MainActivity.class);
   startActivity(mainActivityIntent, null, null);
   mainActivity = getActivity();
 }
コード例 #2
0
 @Override
 protected void tearDown() throws Exception {
   super.tearDown();
   DefaultDialogData.getInstance().removeConversation(mConversation.getId());
   assertEquals(
       "Not reset", mConversationCount, DefaultDialogData.getInstance().getConversations().size());
   System.setProperty("dexmaker.dexcache", mOldProperty);
 }
コード例 #3
0
  protected void setUp() throws Exception {
    super.setUp();

    intent = new Intent(getInstrumentation().getTargetContext(), PlaybackActivity.class);

    intent.putExtra("video", "test.prr");

    startActivity(intent, null, null);
  }
コード例 #4
0
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   mInstrumentation = getInstrumentation();
   mContext = mInstrumentation.getContext();
   mIntent = new Intent(Intent.ACTION_MAIN);
   mIntent.setComponent(new ComponentName(mContext, Configuration.class.getName()));
   mActivity = startActivity(mIntent, null, null);
   preferenceScreen = mActivity.getPreferenceScreen();
 }
コード例 #5
0
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   ContextThemeWrapper context =
       new ContextThemeWrapper(getInstrumentation().getTargetContext(), R.style.AppTheme);
   setActivityContext(context);
   mLaunchIntent = new Intent(getInstrumentation().getTargetContext(), LoginActivity.class);
   startActivity(mLaunchIntent, null, null);
   username = (EditText) getActivity().findViewById(R.id.email);
   password = (EditText) getActivity().findViewById(R.id.password);
 }
コード例 #6
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    targetContext = getInstrumentation().getTargetContext();

    // set theme for AppCompat support
    ContextThemeWrapper context = new ContextThemeWrapper(targetContext, R.style.AppTheme);
    setActivityContext(context);

    Intent intent = new Intent(getInstrumentation().getTargetContext(), MainActivity.class);

    this.startActivity(intent, null, null);
  }
コード例 #7
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    this.startActivity(
        new Intent(
            QuestionEditActivity.ADD_QUESTION_ACTION,
            Uri.parse("kotoba://kotoba.fiive.net/question/new")),
        null,
        null);
    QuestionEditActivity activity = getActivity();
    new DatabaseCleaner().cleanDatabase(getInstrumentation().getTargetContext());
    dataService = new DataService(getInstrumentation().getTargetContext());

    screen = QuestionEditScreen.screenForUnitTests(activity);
    screen.onActivityCreated(null);
  }
コード例 #8
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    rContext = getInstrumentation().getTargetContext();

    // set theme for AppCompat support
    setActivityContext(new ContextThemeWrapper(rContext, R.style.AppTheme));

    // onCreate() will be called for the activity
    startActivity(new Intent(rContext, RegisterActivity.class), null, null);

    // fetch the fragment manager from the activity
    rFragmentManager = getActivity().getSupportFragmentManager();

    // start the activity
    this.getActivity().onStart();
  }
コード例 #9
0
ファイル: MenuActivityTest.java プロジェクト: 42Spikes/F2S
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    // Set a mock context to simulate service binding.
    setActivityContext(
        new ContextWrapper(getInstrumentation().getTargetContext()) {

          @Override
          public boolean stopService(Intent intent) {
            assertEquals(StopwatchService.class.getName(), intent.getComponent().getClassName());
            mServiceStopped = true;
            return true;
          }
        });

    mActivityIntent = new Intent(getInstrumentation().getTargetContext(), MenuActivity.class);
  }
コード例 #10
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    mConversationCount = DefaultDialogData.getInstance().getConversations().size();

    mInstrumentation = getInstrumentation();

    hackMockito();
    mockContact();

    mConversation = DefaultDialogData.getInstance().createOrGetConversation(mContact);

    Intent intent = new Intent(getInstrumentation().getTargetContext(), ConversationActivity.class);
    intent.putExtra(DialogueConversation.CONVERSATION_ID, mConversation.getId());

    startActivity(intent, null, null);
    mActivity = getActivity();

    mMessageList = (ListView) mActivity.findViewById(R.id.message_List);
    mMessageContent = (EditText) mActivity.findViewById(R.id.new_message_content);
    mSendButton = (Button) mActivity.findViewById(R.id.send_message_button);
  }
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    activity = getActivity();
  }
コード例 #12
0
 @Override
 public void tearDown() throws Exception {
   super.tearDown();
   setActivity(null);
 }
コード例 #13
0
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   intent = new Intent(getInstrumentation().getTargetContext(), BaseTestActivity.class);
 }
コード例 #14
0
 protected void tearDown() throws Exception {
   super.tearDown();
 }
コード例 #15
0
 protected void setUp() throws Exception {
   super.setUp();
   mLaunchIntent = new Intent(getInstrumentation().getTargetContext(), WeekProgressActivity.class);
   startActivity(mLaunchIntent, null, null);
   mActivity = getActivity();
 }