Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unhandled exception scenarios #249

Merged
merged 2 commits into from
Feb 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions features/unhandled_exception.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Feature: Android support

Scenario: Test Unhandled Android Exception with Session
When I run "UnhandledExceptionScenario" with the defaults
Then I should receive a request
And the request is a valid for the error reporting API
And the "Bugsnag-API-Key" header equals "a35a2a72bd230ac0aa0f52715bbdc6aa"
And the payload field "notifier.name" equals "Android Bugsnag Notifier"
And the payload field "events" is an array with 1 element
And the exception "errorClass" equals "java.lang.RuntimeException"
And the exception "message" equals "UnhandledExceptionScenario"
11 changes: 11 additions & 0 deletions features/unhandled_exception_java.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Feature: Android support

Scenario: Test Unhandled Android Exception with Session
When I run "UnhandledExceptionJavaScenario" with the defaults
Then I should receive a request
And the request is a valid for the error reporting API
And the "Bugsnag-API-Key" header equals "a35a2a72bd230ac0aa0f52715bbdc6aa"
And the payload field "notifier.name" equals "Android Bugsnag Notifier"
And the payload field "events" is an array with 1 element
And the exception "errorClass" equals "java.lang.RuntimeException"
And the exception "message" equals "UnhandledExceptionJavaScenario"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.bugsnag.android.mazerunner.scenarios;

/**
* Sends an unhandled exception to Bugsnag.
*/
public class UnhandledExceptionJavaScenario extends Scenario {

@Override
public void run() {
throw new RuntimeException("UnhandledExceptionJavaScenario");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.bugsnag.android.mazerunner.scenarios

/**
* Sends an unhandled exception to Bugsnag.
*/
internal class UnhandledExceptionScenario : Scenario() {

override fun run() {
throw generateException()
}

}