0

I'm new to Realm and Android Programming. I have a problem implementing JUnit tests of async login (SyncUser.loginAsync). When I run the test I get the error:

"Asynchronous login is only possible from looper threads. Realm cannot be automatically updated on a thread without a looper."

To solve this problem I found that I should import these classes (Adding Annotation @RunTestInLooperThread for tests to be run in a Looper):

import io.realm.rule.RunInLooperThread;
import io.realm.rule.RunTestInLooperThread;
import io.realm.rule.TestRealmConfigurationFactory;

But the package io.realm.rule.* is not found.

What I should do to import those classes?

I'm using gradle plugin io.realm:realm-gradle-plugin:4.1.0

Thanks in advance for your help.

sina
  • 1,817
  • 1
  • 18
  • 42
Selvaggia
  • 1
  • 1

1 Answers1

1

Those classes are being used by our internal instrumentation tests. They are not distributed in a public manner.

You can however, copy them directly from our Github repo if you need them: https://github.com/realm/realm-java/tree/master/realm/realm-library/src/testUtils/java/io/realm/rule

caitcoo0odes
  • 484
  • 1
  • 6
  • 17
Christian Melchior
  • 19,978
  • 5
  • 62
  • 53