1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-26 21:01:32 +00:00

Fixed unit test compilation errors.

This commit is contained in:
Felix Ableitner 2015-04-01 23:20:36 +02:00
parent eb10eaae9d
commit 4e8dba4819
2 changed files with 3 additions and 15 deletions

View file

@ -3,7 +3,6 @@ package com.nutomic.syncthingandroid.test.syncthing;
import android.test.AndroidTestCase;
import com.nutomic.syncthingandroid.syncthing.PollWebGuiAvailableTask;
import com.nutomic.syncthingandroid.syncthing.PostTask;
import com.nutomic.syncthingandroid.syncthing.SyncthingRunnable;
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
import com.nutomic.syncthingandroid.test.MockContext;
@ -14,8 +13,6 @@ import java.util.concurrent.TimeUnit;
public class PollWebGuiAvailableTaskTest extends AndroidTestCase {
private SyncthingRunnable mSyncthing;
private ConfigXml mConfig;
@Override
@ -33,7 +30,7 @@ public class PollWebGuiAvailableTaskTest extends AndroidTestCase {
}
public void testPolling() throws InterruptedException {
mSyncthing = new SyncthingRunnable(new MockContext(null),
new SyncthingRunnable(new MockContext(null),
getContext().getApplicationInfo().dataDir + "/" + SyncthingService.BINARY_NAME);
final CountDownLatch latch = new CountDownLatch(1);
@ -45,7 +42,6 @@ public class PollWebGuiAvailableTaskTest extends AndroidTestCase {
}.execute(mConfig.getWebGuiUrl());
latch.await(1, TimeUnit.SECONDS);
new PostTask().execute(mConfig.getWebGuiUrl(), PostTask.URI_SHUTDOWN, mConfig.getApiKey());
SyncthingRunnable.killSyncthing();
}
}

View file

@ -5,7 +5,6 @@ import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;
import com.nutomic.syncthingandroid.syncthing.PollWebGuiAvailableTask;
import com.nutomic.syncthingandroid.syncthing.PostTask;
import com.nutomic.syncthingandroid.syncthing.RestApi;
import com.nutomic.syncthingandroid.syncthing.SyncthingRunnable;
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
@ -57,14 +56,7 @@ public class RestApiTest extends AndroidTestCase {
super.tearDown();
final CountDownLatch latch = new CountDownLatch(1);
new PostTask() {
@Override
protected void onPostExecute(Boolean aBoolean) {
assertTrue(aBoolean);
latch.countDown();
}
}.execute(mConfig.getWebGuiUrl(), PostTask.URI_SHUTDOWN, mConfig.getApiKey());
latch.await(1, TimeUnit.SECONDS);
SyncthingRunnable.killSyncthing();
ConfigXml.getConfigFile(new MockContext(getContext())).delete();
}