1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-02 06:52:55 +01:00
Gadgetbridge/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/TestDeviceService.java
cpfeiffer 77cad5c47f Initial support for testing the DeviceCommunicationService
Lots of support classes to enable local testing, without
a device or an emulator.
2015-08-22 01:09:56 +02:00

26 lines
697 B
Java

package nodomain.freeyourgadget.gadgetbridge.service;
import android.content.Intent;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceService;
import nodomain.freeyourgadget.gadgetbridge.test.GBMockIntent;
public class TestDeviceService extends GBDeviceService {
private final AbstractServiceTestCase<?> mTestCase;
public TestDeviceService(AbstractServiceTestCase<?> testCase) throws Exception {
super(testCase.getContext());
mTestCase = testCase;
}
@Override
protected Intent createIntent() {
return new GBMockIntent();
}
@Override
protected void invokeService(Intent intent) {
mTestCase.startService(intent);
}
}