fix errors in tests

This commit is contained in:
Milos Kozak 2018-04-02 10:29:19 +02:00
parent 3cfc9c16fe
commit ad74a9ba9a
3 changed files with 7 additions and 7 deletions

View file

@ -20,8 +20,8 @@ public abstract class PluginBase {
DISABLED
}
State state = State.NOT_INITIALIZED;
boolean isFragmentVisible = false;
private State state = State.NOT_INITIALIZED;
private boolean isFragmentVisible = false;
public PluginDescription pluginDescription;
@ -152,7 +152,10 @@ public abstract class PluginBase {
if (getType() == PluginType.PUMP) {
new Thread(() -> {
SystemClock.sleep(3000);
ConfigBuilderPlugin.getCommandQueue().readStatus("Pump driver changed.", null);
try {
ConfigBuilderPlugin.getCommandQueue().readStatus("Pump driver changed.", null);
} catch (Exception ignored) { // Thread fail to start in tests
}
}).start();
}
}

View file

@ -14,9 +14,6 @@ import org.powermock.modules.junit4.PowerMockRunner;
import info.AAPSMocker;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.events.EventTreatmentChange;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpPlugin;

View file

@ -20,7 +20,7 @@ import static org.junit.Assert.assertTrue;
* Created by mike on 20.11.2017.
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest({MainApp.class, DateUtil.class})
@PrepareForTest({MainApp.class})
public class DateUtilTest {
@Test