mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Shifted the ApacheHttpClientMediaWikiApiTest to run using Robolectric (as a unit test) rather than on-device.
This commit is contained in:
parent
c035b368c4
commit
ddce34bc90
2 changed files with 10 additions and 7 deletions
|
|
@ -1,12 +1,13 @@
|
|||
package fr.free.nrw.commons.mwapi;
|
||||
|
||||
import android.os.Build;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
|
@ -25,11 +26,8 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/*
|
||||
* XML for individual tests was captured by hand from the API sandbox -
|
||||
* https://en.wikipedia.org/wiki/Special:ApiSandbox
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@Config(constants = BuildConfig.class)
|
||||
public class ApacheHttpClientMediaWikiApiTest {
|
||||
|
||||
private ApacheHttpClientMediaWikiApi testObject;
|
||||
|
|
@ -226,4 +224,4 @@ public class ApacheHttpClientMediaWikiApiTest {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue