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

8.14 Half of Replicator Tests #116

Merged
merged 3 commits into from
Sep 1, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Address feedback
  • Loading branch information
LaurenNguyen14 committed Aug 31, 2022
commit bbaf7299e381925d3610bc48edec13d0e0f3cae2
9 changes: 4 additions & 5 deletions common/test/java/com/couchbase/lite/BaseCollectionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import org.junit.Before
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import java.util.*

open class BaseCollectionTest : BaseDbTest() {
protected lateinit var testCollection: Collection
Expand Down Expand Up @@ -71,16 +70,16 @@ open class BaseCollectionTest : BaseDbTest() {
@Throws(CouchbaseLiteException::class)
protected fun createDocsInTestCollection(n: Int) {
for (i in 0 until n) {
val doc = MutableDocument(String.format(Locale.US, "doc_%03d", i))
val doc = MutableDocument("doc_${i}")
doc.setValue("key", i)
saveDocInTestCollection(doc)
}
assertEquals(n.toLong(), testCollection.count)
}

protected fun createDocsInCustomizedCollection(n: Int, col: Collection) {
protected fun createDocsInCollection(n: Int, col: Collection) {
for (i in 0 until n) {
val doc = MutableDocument(String.format(Locale.US, "%s_%s_doc_%03d", col.database.name, col.name, i))
val doc = MutableDocument("${col.database.name}_${col.name}_doc_${i}")
doc.setValue("key", i)
saveDocInCollection(doc, col)
}
Expand All @@ -95,7 +94,7 @@ open class BaseCollectionTest : BaseDbTest() {
if (l.trim().isEmpty()) {
return
}
val doc = MutableDocument(String.format(Locale.ENGLISH, "doc-%03d", n++))
val doc = MutableDocument("doc-${n++}")
doc.setData(JSONUtils.fromJSON(JSONObject(l)))

saveDocInCollection(doc, collection)
Expand Down