mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-10 20:15:54 +00:00
Removed pointless @SmallTest etc annotiations.
This commit is contained in:
parent
1786c6286d
commit
1c16b0e709
14 changed files with 3 additions and 38 deletions
|
@ -17,7 +17,6 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
|
|||
super(MainActivity.class);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testOnServiceConnected() {
|
||||
getActivity().onServiceConnected(null, new SyncthingServiceBinder(mService));
|
||||
assertTrue(mService.containsListenerInstance(MainActivity.class));
|
||||
|
|
|
@ -28,7 +28,6 @@ public class BatteryReceiverTest extends AndroidTestCase {
|
|||
super.tearDown();
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testOnReceiveCharging() {
|
||||
PreferenceManager.getDefaultSharedPreferences(mContext)
|
||||
.edit()
|
||||
|
@ -44,7 +43,6 @@ public class BatteryReceiverTest extends AndroidTestCase {
|
|||
mContext.clearReceivedIntents();
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testOnReceiveNotCharging() {
|
||||
PreferenceManager.getDefaultSharedPreferences(mContext)
|
||||
.edit()
|
||||
|
@ -61,7 +59,6 @@ public class BatteryReceiverTest extends AndroidTestCase {
|
|||
mContext.clearReceivedIntents();
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testOnlyRunInForeground() {
|
||||
PreferenceManager.getDefaultSharedPreferences(getContext())
|
||||
.edit()
|
||||
|
|
|
@ -31,7 +31,6 @@ public class BootReceiverTest extends AndroidTestCase {
|
|||
super.tearDown();
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testOnReceiveCharging() {
|
||||
PreferenceManager.getDefaultSharedPreferences(mContext)
|
||||
.edit()
|
||||
|
|
|
@ -20,7 +20,6 @@ public class DeviceStateHolderTest extends AndroidTestCase {
|
|||
mContext = new MockContext(null);
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testIsCharging() {
|
||||
Intent i = new Intent();
|
||||
i.putExtra(DeviceStateHolder.EXTRA_IS_CHARGING, false);
|
||||
|
@ -32,7 +31,6 @@ public class DeviceStateHolderTest extends AndroidTestCase {
|
|||
assertTrue(mReceiver.isCharging());
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testWifiConnected() {
|
||||
Intent i = new Intent();
|
||||
i.putExtra(DeviceStateHolder.EXTRA_HAS_WIFI, false);
|
||||
|
@ -44,7 +42,6 @@ public class DeviceStateHolderTest extends AndroidTestCase {
|
|||
assertTrue(mReceiver.isWifiConnected());
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testonReceiveInitialChargingState() {
|
||||
Intent i = new Intent();
|
||||
mReceiver.onReceive(mContext, i);
|
||||
|
|
|
@ -41,7 +41,6 @@ public class GetTaskTest extends AndroidTestCase {
|
|||
//mServer.shutdown();
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testGetNoParams() throws IOException, InterruptedException {
|
||||
new GetTask("") {
|
||||
@Override
|
||||
|
@ -55,7 +54,6 @@ public class GetTaskTest extends AndroidTestCase {
|
|||
assertEquals(GetTask.URI_CONFIG, uri.getPath());
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testGetParams() throws IOException, InterruptedException {
|
||||
new GetTask("") {
|
||||
@Override
|
||||
|
|
|
@ -35,7 +35,6 @@ public class NetworkReceiverTest extends AndroidTestCase {
|
|||
super.tearDown();
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testOnReceive() {
|
||||
PreferenceManager.getDefaultSharedPreferences(mContext)
|
||||
.edit()
|
||||
|
@ -51,7 +50,6 @@ public class NetworkReceiverTest extends AndroidTestCase {
|
|||
mContext.clearReceivedIntents();
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testOnlyRunInForeground() {
|
||||
PreferenceManager.getDefaultSharedPreferences(getContext())
|
||||
.edit()
|
||||
|
|
|
@ -56,12 +56,10 @@ public class RestApiTest extends AndroidTestCase {
|
|||
ConfigXml.getConfigFile(new MockContext(getContext())).delete();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testGetDevices() {
|
||||
assertNotNull(mApi.getDevices(false));
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testGetSystemInfo() throws InterruptedException {
|
||||
final CountDownLatch latch = new CountDownLatch(1);
|
||||
mApi.getSystemInfo(new RestApi.OnReceiveSystemInfoListener() {
|
||||
|
@ -74,24 +72,20 @@ public class RestApiTest extends AndroidTestCase {
|
|||
latch.await(1, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testGetFolders() {
|
||||
assertNotNull(mApi.getFolders());
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testReadableFileSize() {
|
||||
assertEquals("1 MiB", RestApi.readableFileSize(getContext(), 1048576));
|
||||
assertEquals("1 GiB", RestApi.readableFileSize(getContext(), 1073741824));
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
|
||||
public void testGetReadableTransferRate() {
|
||||
assertEquals("1 MiB/s", RestApi.readableTransferRate(getContext(), 8388608L));
|
||||
assertEquals("1 GiB/s", RestApi.readableTransferRate(getContext(), 8589934592L));
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
|
||||
public void testConvertNotCrashing() {
|
||||
long[] values = new long[]{-1, 0, 1, 2, 4, 8, 16, 1024, 2^10, 2^15, 2^20, 2^25, 2^30};
|
||||
for (long l : values) {
|
||||
|
@ -100,7 +94,6 @@ public class RestApiTest extends AndroidTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testGetConnections() throws InterruptedException {
|
||||
final CountDownLatch latch = new CountDownLatch(1);
|
||||
mApi.getConnections(new RestApi.OnReceiveConnectionsListener() {
|
||||
|
@ -113,7 +106,6 @@ public class RestApiTest extends AndroidTestCase {
|
|||
latch.await(1, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testGetModel() throws InterruptedException {
|
||||
final CountDownLatch latch = new CountDownLatch(1);
|
||||
mApi.getModel("camera", new RestApi.OnReceiveModelListener() {
|
||||
|
@ -126,7 +118,6 @@ public class RestApiTest extends AndroidTestCase {
|
|||
latch.await(1, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testNormalizeDeviceId() throws InterruptedException {
|
||||
final CountDownLatch latch = new CountDownLatch(1);
|
||||
mApi.normalizeDeviceId("p56ioi7m--zjnu2iq-gdr-eydm-2mgtmgl3bxnpq6w5btbbz4tjxzwicq",
|
||||
|
@ -141,7 +132,6 @@ public class RestApiTest extends AndroidTestCase {
|
|||
latch.await(1, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testGetValueEarly() {
|
||||
// Should never throw an exception.
|
||||
mApi.getValue("Options", "ListenAddress");
|
||||
|
|
|
@ -14,7 +14,6 @@ import java.io.File;
|
|||
*/
|
||||
public class SyncthingRunnableTest extends AndroidTestCase {
|
||||
|
||||
@SmallTest
|
||||
public void testRunning() throws InterruptedException {
|
||||
MockContext context = new MockContext(getContext());
|
||||
File testFile = new File(context.getFilesDir(), SyncthingRunnable.UNIT_TEST_PATH);
|
||||
|
|
|
@ -8,7 +8,6 @@ import com.nutomic.syncthingandroid.syncthing.SyncthingServiceBinder;
|
|||
|
||||
public class SyncthingServiceBinderTest extends AndroidTestCase {
|
||||
|
||||
@SmallTest
|
||||
public void testBinder() {
|
||||
SyncthingService service = new SyncthingService();
|
||||
SyncthingServiceBinder binder = new SyncthingServiceBinder(service);
|
||||
|
|
|
@ -44,14 +44,12 @@ public class SyncthingServiceTest extends ServiceTestCase<SyncthingService> {
|
|||
super.tearDown();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testFirstStart() {
|
||||
setContext(mContext);
|
||||
startService(new Intent(mContext, SyncthingService.class));
|
||||
assertTrue(getService().isFirstStart());
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testNotFirstStart() throws IOException {
|
||||
setContext(mContext);
|
||||
startService(new Intent(mContext, SyncthingService.class));
|
||||
|
@ -59,7 +57,6 @@ public class SyncthingServiceTest extends ServiceTestCase<SyncthingService> {
|
|||
assertFalse(getService().isFirstStart());
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testBindService() throws InterruptedException {
|
||||
SyncthingServiceBinder binder = (SyncthingServiceBinder)
|
||||
bindService(new Intent(getContext(), SyncthingService.class));
|
||||
|
|
|
@ -34,7 +34,6 @@ public class ConfigXmlTest extends AndroidTestCase {
|
|||
ConfigXml.getConfigFile(mContext).delete();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
public void testGetWebGuiUrl() {
|
||||
assertTrue(mConfig.getWebGuiUrl().startsWith("https://127.0.0.1:"));
|
||||
}
|
||||
|
@ -44,7 +43,6 @@ public class ConfigXmlTest extends AndroidTestCase {
|
|||
*
|
||||
* This is not ideal, but way less complicated than starting up syncthing and accessing the API.
|
||||
*/
|
||||
@SmallTest
|
||||
public void testCreateCameraFolder() {
|
||||
long oldTime = ConfigXml.getConfigFile(mContext).lastModified();
|
||||
long oldSize = ConfigXml.getConfigFile(mContext).length();
|
||||
|
|
|
@ -7,10 +7,10 @@ import com.nutomic.syncthingandroid.util.ExtendedCheckBoxPreference;
|
|||
|
||||
public class ExtendedCheckBoxPreferenceTest extends AndroidTestCase {
|
||||
|
||||
@SmallTest
|
||||
public void testExtendedCheckBoxPreference() {
|
||||
Object o = new Object();
|
||||
ExtendedCheckBoxPreference cb = new ExtendedCheckBoxPreference(getContext(), o);
|
||||
assertEquals(cb.getObject(), o);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ public class FolderObserverTest extends AndroidTestCase
|
|||
return r;
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testRecursion() throws IOException, InterruptedException {
|
||||
mCurrentTest = "testRecursion";
|
||||
File subFolder = new File(mTestFolder, "subfolder");
|
||||
|
@ -64,7 +63,6 @@ public class FolderObserverTest extends AndroidTestCase
|
|||
fo.stopWatching();
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testRemoveFile() throws IOException, InterruptedException {
|
||||
mCurrentTest = "testRemoveFile";
|
||||
File test = new File(mTestFolder, "test");
|
||||
|
@ -79,7 +77,6 @@ public class FolderObserverTest extends AndroidTestCase
|
|||
fo.stopWatching();
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testMoveDirectoryOut() throws IOException, InterruptedException {
|
||||
mCurrentTest = "testMoveDirectory";
|
||||
File subFolder = new File(mTestFolder, "subfolder");
|
||||
|
@ -97,7 +94,6 @@ public class FolderObserverTest extends AndroidTestCase
|
|||
fo.stopWatching();
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testAddDirectory() throws IOException, InterruptedException {
|
||||
mCurrentTest = "testAddDirectory";
|
||||
File subFolder = new File(mTestFolder, "subfolder");
|
||||
|
|
|
@ -39,7 +39,6 @@ public class FoldersAdapterTest extends AndroidTestCase {
|
|||
mModel.globalBytes = 1073741824;
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testGetViewNoModel() {
|
||||
mAdapter.add(Arrays.asList(mFolder));
|
||||
View v = mAdapter.getView(0, null, null);
|
||||
|
@ -48,7 +47,6 @@ public class FoldersAdapterTest extends AndroidTestCase {
|
|||
assertEquals(mFolder.invalid, ((TextView) v.findViewById(R.id.invalid)).getText());
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testGetViewModel() {
|
||||
mAdapter.add(Arrays.asList(mFolder));
|
||||
mAdapter.onReceiveModel(mFolder.id, mModel);
|
||||
|
|
Loading…
Reference in a new issue