use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.
the class StandupTimer method storeMeetingStats.
private void storeMeetingStats() {
if (team != null) {
long meetingEndTime = System.currentTimeMillis();
if (individualStatusEndTime == 0) {
individualStatusEndTime = meetingEndTime;
}
try {
Meeting meeting = new Meeting(team, new Date(meetingStartTime), completedParticipants, (int) ((individualStatusEndTime - individualStatusStartTime) / 1000), (int) ((meetingEndTime - meetingStartTime) / 1000), quickestStatus, longestStatus);
persistMeeting(meeting);
} catch (IllegalArgumentException e) {
Logger.e("Could not store the meeting in the database. " + e);
}
}
}
use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.
the class MeetingTest method test_delete_a_meeting.
@MediumTest
public void test_delete_a_meeting() {
Team team = new Team("Test Team");
Meeting meeting = new Meeting(team, new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120);
meeting = meeting.save(mContext);
assertEquals(1, Meeting.findAllByTeam(team, mContext).size());
meeting.delete(mContext);
assertEquals(0, Meeting.findAllByTeam(team, mContext).size());
}
use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.
the class TeamTest method test_deleting_a_team_deletes_its_meetings_as_well.
@MediumTest
public void test_deleting_a_team_deletes_its_meetings_as_well() {
Team team = Team.create("Test Team", mContext);
new Meeting(team, new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
new Meeting(team, new GregorianCalendar(2010, 1, 4, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
;
assertFalse(Meeting.findAllByTeam(team, mContext).isEmpty());
team.delete(mContext);
assertEquals(0, Team.findAllTeamNames(mContext).size());
assertTrue(Meeting.findAllByTeam(team, mContext).isEmpty());
}
use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.
the class MeetingDAOTest method test_delete_a_single_meeting.
@MediumTest
public void test_delete_a_single_meeting() {
Meeting meeting = new Meeting(new Team("Test Team"), new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120);
meeting = dao.save(meeting);
meeting = dao.findById(meeting.getId());
assertNotNull(meeting.getId());
dao.delete(meeting);
meeting = dao.findById(meeting.getId());
assertNull(meeting);
}
use of net.johnpwood.android.standuptimer.model.Meeting in project standup-timer by jwood.
the class MeetingDAO method findById.
public Meeting findById(Long id) {
Cursor cursor = null;
Meeting meeting = null;
try {
SQLiteDatabase db = getReadableDatabase();
cursor = db.query(MEETINGS_TABLE_NAME, MEETINGS_ALL_COLUMS, _ID + " = ?", new String[] { id.toString() }, null, null, null);
if (cursor.getCount() == 1) {
if (cursor.moveToFirst()) {
meeting = createMeetingFromCursorData(cursor);
}
}
} finally {
closeCursor(cursor);
}
return meeting;
}
Aggregations