use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project firebase-android-sdk by firebase.
the class CrashlyticsReportDataCaptureTest method testCaptureReportSessionFields.
@Test
public void testCaptureReportSessionFields() {
final String sessionId = "sessionId";
final long timestamp = System.currentTimeMillis();
final CrashlyticsReport report = dataCapture.captureReportData(sessionId, timestamp);
assertEquals(sessionId, report.getSession().getIdentifier());
assertEquals(timestamp, report.getSession().getStartedAt());
assertEquals(GENERATOR, report.getSession().getGenerator());
assertEquals(GENERATOR_TYPE, report.getSession().getGeneratorType());
}
use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project firebase-android-sdk by firebase.
the class SessionReportingCoordinatorTest method mockReport.
private static CrashlyticsReport mockReport(String sessionId) {
final CrashlyticsReport mockReport = mock(CrashlyticsReport.class);
final CrashlyticsReport.Session mockSession = mock(CrashlyticsReport.Session.class);
when(mockSession.getIdentifier()).thenReturn(sessionId);
when(mockReport.getSession()).thenReturn(mockSession);
return mockReport;
}
use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project firebase-android-sdk by firebase.
the class CrashlyticsReportJsonTransformTest method testReportToJsonAndBack_equals.
@Test
public void testReportToJsonAndBack_equals() throws IOException {
final CrashlyticsReport testReport = makeTestReport(false);
final String testReportJson = transform.reportToJson(testReport);
final CrashlyticsReport reifiedReport = transform.reportFromJson(testReportJson);
assertNotSame(reifiedReport, testReport);
assertEquals(reifiedReport, testReport);
}
use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project firebase-android-sdk by firebase.
the class CrashlyticsReportJsonTransformTest method testReportToJsonAndBack_with_developmentPlatform_equals.
@Test
public void testReportToJsonAndBack_with_developmentPlatform_equals() throws IOException {
final CrashlyticsReport testReport = makeTestReport(true);
final String testReportJson = transform.reportToJson(testReport);
final CrashlyticsReport reifiedReport = transform.reportFromJson(testReportJson);
assertNotSame(reifiedReport, testReport);
assertEquals(reifiedReport, testReport);
}
use of com.google.firebase.crashlytics.internal.model.CrashlyticsReport in project firebase-android-sdk by firebase.
the class CrashlyticsReportPersistenceTest method testLoadFinalizedReports_reportWithUserId_returnsReportWithProperUserId.
public void testLoadFinalizedReports_reportWithUserId_returnsReportWithProperUserId() {
final String sessionId = "testSession";
final String userId = "testUser";
final CrashlyticsReport testReport = makeTestReport(sessionId, userId);
final CrashlyticsReport.Session.Event testEvent = makeTestEvent();
reportPersistence.persistReport(testReport);
reportPersistence.persistEvent(testEvent, sessionId);
reportPersistence.finalizeReports("skippedSession", 0L);
final List<CrashlyticsReportWithSessionId> finalizedReports = reportPersistence.loadFinalizedReports();
assertEquals(1, finalizedReports.size());
final CrashlyticsReport finalizedReport = finalizedReports.get(0).getReport();
assertNotNull(finalizedReport.getSession().getUser());
assertEquals(userId, finalizedReport.getSession().getUser().getIdentifier());
}
Aggregations