-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add-maze-harness' of https://github.com/bugsnag/bugsnag…
…-android into add-maze-harness
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Feature: Android support | ||
|
||
Scenario: Test handled Android Exception | ||
When I run "BreadcrumbScenario" with the defaults | ||
Then I should receive a request | ||
And the request is a valid for the error reporting API | ||
And the exception "message" equals "BreadcrumbScenario" | ||
And the event "breadcrumbs" is not null | ||
|
||
And the event "breadcrumbs.1.timestamp" is not null | ||
And the event "breadcrumbs.1.name" equals "Another Breadcrumb" | ||
And the event "breadcrumbs.1.type" equals "user" | ||
And the event "breadcrumbs.1.metaData.Foo" equals "Bar" | ||
|
||
And the event "breadcrumbs.0.timestamp" is not null | ||
And the event "breadcrumbs.0.name" equals "Hello Breadcrumb!" | ||
And the event "breadcrumbs.0.type" equals "manual" | ||
And the event "breadcrumbs.0.metaData" is not null |
22 changes: 22 additions & 0 deletions
22
mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/BreadcrumbScenario.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.bugsnag.android.mazerunner.scenarios | ||
|
||
import android.content.Context | ||
import com.bugsnag.android.BreadcrumbType | ||
import com.bugsnag.android.Bugsnag | ||
import com.bugsnag.android.Configuration | ||
import java.util.* | ||
|
||
/** | ||
* Sends a handled exception to Bugsnag, which includes manual breadcrumbs. | ||
*/ | ||
internal class BreadcrumbScenario(config: Configuration, | ||
context: Context) : Scenario(config, context) { | ||
|
||
override fun run() { | ||
super.run() | ||
Bugsnag.leaveBreadcrumb("Hello Breadcrumb!") | ||
Bugsnag.leaveBreadcrumb("Another Breadcrumb", BreadcrumbType.USER, Collections.singletonMap("Foo", "Bar")) | ||
Bugsnag.notify(generateException()) | ||
} | ||
|
||
} |