Skip to content
Snippets Groups Projects
Commit 968272f1 authored by Sebastian's avatar Sebastian Committed by Mikolai Gütschow
Browse files

Add three different entry points to start with testing data

parent 2b878fca
Branches tor-0.3.5.11
No related tags found
1 merge request!22Make it possible to start briar with temporary account with a bunch of testing contacts
...@@ -20,7 +20,7 @@ import java.util.logging.Level.INFO ...@@ -20,7 +20,7 @@ import java.util.logging.Level.INFO
import java.util.logging.LogManager import java.util.logging.LogManager
import kotlin.io.path.absolute import kotlin.io.path.absolute
private class TestWithTemporaryAccount { internal class RunWithTemporaryAccount(val customization: BriarDesktopTestApp.() -> Unit) {
@OptIn(ExperimentalComposeUiApi::class) @OptIn(ExperimentalComposeUiApi::class)
fun run() = application { fun run() = application {
...@@ -54,8 +54,7 @@ private class TestWithTemporaryAccount { ...@@ -54,8 +54,7 @@ private class TestWithTemporaryAccount {
lifecycleManager.startServices(dbKey) lifecycleManager.startServices(dbKey)
lifecycleManager.waitForStartup() lifecycleManager.waitForStartup()
app.getDeterministicTestDataCreator().createTestData(5, 20, 50) customization(app)
app.getTestDataCreator().createTestData(5, 20, 50, 4, 4, 10)
// Creating test data happens on a background thread. As we do not get notified about updates to the conact // Creating test data happens on a background thread. As we do not get notified about updates to the conact
// list yet, we need to wait a moment in order for that to finish (hopefully). // list yet, we need to wait a moment in order for that to finish (hopefully).
...@@ -86,5 +85,3 @@ private class TestWithTemporaryAccount { ...@@ -86,5 +85,3 @@ private class TestWithTemporaryAccount {
return dataDir return dataDir
} }
} }
fun main(args: Array<String>) = TestWithTemporaryAccount().run()
package org.briarproject.briar.desktop
fun main(args: Array<String>) = RunWithTemporaryAccount {
getDeterministicTestDataCreator().createTestData(5, 20, 50)
}.run()
package org.briarproject.briar.desktop
fun main(args: Array<String>) = RunWithTemporaryAccount {
getDeterministicTestDataCreator().createTestData(5, 20, 50)
getTestDataCreator().createTestData(5, 20, 50, 4, 4, 10)
}.run()
package org.briarproject.briar.desktop
fun main(args: Array<String>) = RunWithTemporaryAccount {
getTestDataCreator().createTestData(5, 20, 50, 4, 4, 10)
}.run()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment