mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-23 04:41:16 +00:00
Made MockSyncthingService a complete stub of SyncthingService.
Now all methods are overriden, and throw UnsupportedOperationException unless used by a test.
This commit is contained in:
parent
19d3399288
commit
30bf0d7bc5
1 changed files with 50 additions and 0 deletions
|
@ -1,5 +1,10 @@
|
|||
package com.nutomic.syncthingandroid.test;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
|
||||
import com.nutomic.syncthingandroid.syncthing.RestApi;
|
||||
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
@ -9,6 +14,46 @@ public class MockSyncthingService extends SyncthingService {
|
|||
|
||||
private LinkedList<OnApiChangeListener> mOnApiChangedListeners = new LinkedList<>();
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerOnWebGuiAvailableListener(OnWebGuiAvailableListener listener) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFirstStart() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestApi getApi() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerOnApiChangeListener(OnApiChangeListener listener) {
|
||||
mOnApiChangedListeners.add(listener);
|
||||
|
@ -23,4 +68,9 @@ public class MockSyncthingService extends SyncthingService {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWebGuiUrl() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue