timeout reduced
This commit is contained in:
parent
57b6b54604
commit
a9ec9ba5bd
@ -46,7 +46,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
public class CalculatorTestUtils {
|
public class CalculatorTestUtils {
|
||||||
|
|
||||||
// in seconds
|
// in seconds
|
||||||
public static final int TIMEOUT = 15;
|
public static final int TIMEOUT = 3;
|
||||||
|
|
||||||
public static void staticSetUp() throws Exception {
|
public static void staticSetUp() throws Exception {
|
||||||
Locator.getInstance().init(new CalculatorImpl(), newCalculatorEngine(), Mockito.mock(CalculatorClipboard.class), Mockito.mock(CalculatorNotifier.class), Mockito.mock(CalculatorHistory.class), new SystemOutCalculatorLogger(), Mockito.mock(CalculatorPreferenceService.class), Mockito.mock(CalculatorKeyboard.class), Mockito.mock(CalculatorPlotter.class), null);
|
Locator.getInstance().init(new CalculatorImpl(), newCalculatorEngine(), Mockito.mock(CalculatorClipboard.class), Mockito.mock(CalculatorNotifier.class), Mockito.mock(CalculatorHistory.class), new SystemOutCalculatorLogger(), Mockito.mock(CalculatorPreferenceService.class), Mockito.mock(CalculatorKeyboard.class), Mockito.mock(CalculatorPlotter.class), null);
|
||||||
@ -153,7 +153,9 @@ public class CalculatorTestUtils {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCalculatorEvent(@Nonnull CalculatorEventData calculatorEventData, @Nonnull CalculatorEventType calculatorEventType, @Nullable Object data) {
|
public void onCalculatorEvent(@Nonnull CalculatorEventData calculatorEventData, @Nonnull CalculatorEventType calculatorEventType, @Nullable Object data) {
|
||||||
if (this.calculatorEventData != null && calculatorEventData.isSameSequence(this.calculatorEventData)) {
|
waitForEventData();
|
||||||
|
|
||||||
|
if (calculatorEventData.isSameSequence(this.calculatorEventData)) {
|
||||||
if (calculatorEventType == CalculatorEventType.display_state_changed) {
|
if (calculatorEventType == CalculatorEventType.display_state_changed) {
|
||||||
final CalculatorDisplayChangeEventData displayChange = (CalculatorDisplayChangeEventData) data;
|
final CalculatorDisplayChangeEventData displayChange = (CalculatorDisplayChangeEventData) data;
|
||||||
|
|
||||||
@ -169,6 +171,15 @@ public class CalculatorTestUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void waitForEventData() {
|
||||||
|
while (this.calculatorEventData == null) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(200);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public CalculatorDisplayViewState getResult() {
|
public CalculatorDisplayViewState getResult() {
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
Reference in New Issue
Block a user