Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
177 additions
and
51 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
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
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
39 changes: 39 additions & 0 deletions
39
...unner/src/main/java/com/bugsnag/android/mazerunner/scenarios/MultiClientOldDirScenario.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,39 @@ | ||
package com.bugsnag.android.mazerunner.scenarios | ||
|
||
import android.content.Context | ||
import com.bugsnag.android.Client | ||
import com.bugsnag.android.Configuration | ||
import com.bugsnag.android.disableAllDelivery | ||
import com.bugsnag.android.writeErrorToOldDir | ||
|
||
/** | ||
* Configures two Bugsnag clients with different API keys. A single error report is written to the | ||
* old directory format, which should then be reported by both clients. | ||
* | ||
*/ | ||
internal class MultiClientOldDirScenario(config: Configuration, | ||
context: Context) : Scenario(config, context) { | ||
var firstClient: Client? = null | ||
var secondClient: Client? = null | ||
|
||
fun configureClients() { | ||
firstClient = Client(context, config) | ||
|
||
Thread.sleep(10) // enforce request order | ||
val secondConfig = Configuration("abc123") | ||
secondConfig.endpoint = config.endpoint | ||
secondConfig.sessionEndpoint = config.sessionEndpoint | ||
secondClient = Client(context, secondConfig) | ||
} | ||
|
||
override fun run() { | ||
configureClients() | ||
|
||
if ("DeliverReport" != eventMetaData) { | ||
disableAllDelivery(firstClient!!) | ||
disableAllDelivery(secondClient!!) | ||
writeErrorToOldDir(firstClient!!) | ||
} | ||
} | ||
|
||
} |
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
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
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
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
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
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
Oops, something went wrong.