@Override
 protected void setUp() throws Exception {
   super.setUp();
   mainActivityIntent = new Intent(getInstrumentation().getTargetContext(), MainActivity.class);
   startActivity(mainActivityIntent, null, null);
   mainActivity = getActivity();
 }
 @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);
 }
Ejemplo n.º 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);
  }
Ejemplo n.º 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();
 }
 @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);
 }
Ejemplo n.º 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);
  }
  @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);
  }
Ejemplo n.º 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();
  }
Ejemplo n.º 9
0
  @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);
  }
  @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();
  }
Ejemplo n.º 12
0
 @Override
 public void tearDown() throws Exception {
   super.tearDown();
   setActivity(null);
 }
Ejemplo n.º 13
0
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   intent = new Intent(getInstrumentation().getTargetContext(), BaseTestActivity.class);
 }
Ejemplo n.º 14
0
 protected void tearDown() throws Exception {
   super.tearDown();
 }
 protected void setUp() throws Exception {
   super.setUp();
   mLaunchIntent = new Intent(getInstrumentation().getTargetContext(), WeekProgressActivity.class);
   startActivity(mLaunchIntent, null, null);
   mActivity = getActivity();
 }