lundi 3 juillet 2017

Android Test: how to test if a "synchronized static" method could block itself in multi-thread?

i've got a simple class to test in Android environment

public class ClassToTest {
    public synchronized static void func1() {....}
}

i should test: func1() can run in ONLY ONE thread, and in other threads its calls should be blocked.

how to write this JUNIT test case?

many thanks!

Aucun commentaire:

Enregistrer un commentaire