Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

Commit 73f975b

Browse files
committed
Remove useless test.
This tests RxJava behavior instead of SqlBrite.
1 parent aadcba7 commit 73f975b

File tree

1 file changed

+1
-43
lines changed

1 file changed

+1
-43
lines changed

sqlbrite/src/androidTest/java/com/squareup/sqlbrite/BriteDatabaseTest.java

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import android.database.sqlite.SQLiteException;
2323
import android.support.test.InstrumentationRegistry;
2424
import android.support.test.runner.AndroidJUnit4;
25-
import com.google.common.collect.Range;
2625
import com.squareup.sqlbrite.BriteDatabase.Transaction;
2726
import com.squareup.sqlbrite.TestDb.Employee;
2827
import java.io.Closeable;
@@ -31,7 +30,6 @@
3130
import java.util.Arrays;
3231
import java.util.List;
3332
import java.util.concurrent.CountDownLatch;
34-
import java.util.concurrent.TimeUnit;
3533
import org.junit.After;
3634
import org.junit.Before;
3735
import org.junit.Test;
@@ -59,7 +57,7 @@
5957
@RunWith(AndroidJUnit4.class)
6058
public final class BriteDatabaseTest {
6159
private final List<String> logs = new ArrayList<>();
62-
private RecordingObserver o = new RecordingObserver();
60+
private final RecordingObserver o = new RecordingObserver();
6361

6462
private TestDb helper;
6563
private SQLiteDatabase real;
@@ -164,46 +162,6 @@ public final class BriteDatabaseTest {
164162
.isExhausted();
165163
}
166164

167-
@Test public void queryObservesInsertDebounced() {
168-
o = new BlockingRecordingObserver();
169-
170-
db.createQuery(TABLE_EMPLOYEE, SELECT_EMPLOYEES)
171-
.debounce(500, MILLISECONDS)
172-
.subscribe(o);
173-
o.assertCursor()
174-
.hasRow("alice", "Alice Allison")
175-
.hasRow("bob", "Bob Bobberson")
176-
.hasRow("eve", "Eve Evenson")
177-
.isExhausted();
178-
179-
long startNs = System.nanoTime();
180-
181-
// Shotgun 10 inserts which will cause 10 triggers. DO NOT DO THIS IRL! Use a transaction!
182-
for (int i = 0; i < 10; i++) {
183-
db.insert(TABLE_EMPLOYEE, employee("john" + i, "John Johnson " + i));
184-
}
185-
186-
// Only one trigger should have been observed.
187-
o.assertCursor()
188-
.hasRow("alice", "Alice Allison")
189-
.hasRow("bob", "Bob Bobberson")
190-
.hasRow("eve", "Eve Evenson")
191-
.hasRow("john0", "John Johnson 0")
192-
.hasRow("john1", "John Johnson 1")
193-
.hasRow("john2", "John Johnson 2")
194-
.hasRow("john3", "John Johnson 3")
195-
.hasRow("john4", "John Johnson 4")
196-
.hasRow("john5", "John Johnson 5")
197-
.hasRow("john6", "John Johnson 6")
198-
.hasRow("john7", "John Johnson 7")
199-
.hasRow("john8", "John Johnson 8")
200-
.hasRow("john9", "John Johnson 9")
201-
.isExhausted();
202-
203-
long tookNs = System.nanoTime() - startNs;
204-
assertThat(TimeUnit.NANOSECONDS.toMillis(tookNs)).isIn(Range.atLeast(500L));
205-
}
206-
207165
@Test public void queryNotNotifiedWhenInsertFails() {
208166
db.createQuery(TABLE_EMPLOYEE, SELECT_EMPLOYEES).subscribe(o);
209167
o.assertCursor()

0 commit comments

Comments
 (0)