Skip to content

Commit 35535f4

Browse files
authored
Merge pull request #4679 from EmmanuelMess/emmanuelmess/fix/emulator_3
Fix a encode and encrypt URI emulator tests
2 parents c7965a0 + 48f9830 commit 35535f4

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

app/src/androidTest/java/com/amaze/filemanager/database/UtilsHandlerTest.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import static org.awaitility.Awaitility.await;
2424
import static org.junit.Assert.assertEquals;
25+
import static org.junit.Assert.assertFalse;
2526

2627
import java.io.File;
2728
import java.util.List;
@@ -43,6 +44,8 @@
4344
import androidx.test.filters.Suppress;
4445
import androidx.test.platform.app.InstrumentationRegistry;
4546

47+
import io.reactivex.Completable;
48+
4649
@RunWith(AndroidJUnit4.class)
4750
public class UtilsHandlerTest {
4851

@@ -120,18 +123,19 @@ public void testRepeatedSaveBookmarkShouldNeverThrowException() {
120123
private void performEncryptUriTest(@NonNull final String origPath) {
121124
String encryptedPath = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(origPath);
122125

123-
utilsHandler.saveToDatabase(
124-
new OperationData(
125-
UtilsHandler.Operation.SFTP,
126-
encryptedPath,
127-
"Test",
128-
"00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff",
129-
null,
130-
null));
131-
132-
await().atMost(10, TimeUnit.SECONDS).until(() -> utilsHandler.getSftpList().size() > 0);
133-
134-
List<String[]> result = utilsHandler.getSftpList();
126+
final Completable operation =
127+
utilsHandler.saveToDatabase(
128+
new OperationData(
129+
UtilsHandler.Operation.SFTP,
130+
encryptedPath,
131+
"Test",
132+
"00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff",
133+
null,
134+
null));
135+
operation.blockingAwait();
136+
137+
final List<String[]> result = utilsHandler.getSftpList();
138+
assertFalse(result.isEmpty());
135139
assertEquals(1, result.size());
136140
assertEquals("Test", result.get(0)[0]);
137141
assertEquals(encryptedPath, result.get(0)[1]);

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ org.gradle.parallel=true
2828
android.disableResourceValidation=true
2929
# for macs, omit for other operating systems
3030
# org.gradle.java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home
31+
32+
# Enabled parallel sync for Gradle 9.4+
33+
org.gradle.tooling.parallel=true

0 commit comments

Comments
 (0)