Android Open Source - Timetable Alarm Dialog Activity Test Case






From Project

Back to project page Timetable.

License

The source code is released under:

GNU General Public License

If you think the Android project Timetable listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.timetable.android.uitests;
//  w ww .ja  va 2  s.  c o m
import java.text.ParseException;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.test.ActivityInstrumentationTestCase2;
import android.test.RenamingDelegatingContext;

import com.timetable.android.Event;
import com.timetable.android.TimetableDatabase;
import com.timetable.android.alarm.AlarmDialogActivity;

/*
 * Class for testing AlarmDialogAcitivty. Just run this test and activity will be started with test event. 
 */
public class AlarmDialogActivityTestCase extends ActivityInstrumentationTestCase2<AlarmDialogActivity> {
  
  public AlarmDialogActivityTestCase() {
    super(AlarmDialogActivity.class);
  }
  
  Activity mActivity;
  
  Context mContext;
  
  @Override
  public void setUp() throws ParseException {
    
    Intent i = new Intent();
    Event event = new Event.Builder()
              .setName("event_name")
              .setDate("13.08.2014")
              .setStartTime("14:31")
              .setAlarmTime("13.08.2014 13:31")
              .build();
    
    i.putExtras(event.convert());
    setActivityIntent(i);
    
    mActivity = getActivity();
    mContext = new RenamingDelegatingContext(mActivity, "TimetableDatabaseTestCase_");
    TimetableDatabase db = TimetableDatabase.getInstance(mContext);
    db.insertEvent(event);
  }
  
  public void testActivity() throws InterruptedException {
  }
  
  @Override 
  public void tearDown() {
    //keep activity alive.
  }
}




Java Source Code List

com.timetable.android.AlarmSoundPreference.java
com.timetable.android.BroadcastActions.java
com.timetable.android.DeviceMuteService.java
com.timetable.android.EventBroadcastSender.java
com.timetable.android.EventChecker.java
com.timetable.android.EventController.java
com.timetable.android.EventPager.java
com.timetable.android.EventPeriod.java
com.timetable.android.EventService.java
com.timetable.android.EventViewProvider.java
com.timetable.android.EventView.java
com.timetable.android.Event.java
com.timetable.android.IllegalEventDataException.java
com.timetable.android.Logger.java
com.timetable.android.ServiceStarter.java
com.timetable.android.TimetableApp.java
com.timetable.android.TimetableDatabase.java
com.timetable.android.activities.EventAddActivity.java
com.timetable.android.activities.EventCopyActivity.java
com.timetable.android.activities.EventDayViewActivity.java
com.timetable.android.activities.EventEditActivity.java
com.timetable.android.activities.SettingsActivity.java
com.timetable.android.alarm.AlarmDialogActivity.java
com.timetable.android.alarm.AlarmService.java
com.timetable.android.alarm.EventAlarm.java
com.timetable.android.uitests.AlarmDialogActivityTestCase.java
com.timetable.android.uitests.EventAddActivityTestCase.java
com.timetable.android.uitests.TimetableUiTestCase.java
com.timetable.android.utils.DateFormatFactory.java
com.timetable.android.utils.DateUtils.java
com.timetable.android.utils.FakeTimeProvider.java
com.timetable.android.utils.SimpleTimeProvider.java
com.timetable.android.utils.TestAlarmStarter.java
com.timetable.android.utils.TimeProvider.java
com.timetable.android.utils.Utils.java