-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathBaseTest.java
More file actions
36 lines (26 loc) · 1.25 KB
/
BaseTest.java
File metadata and controls
36 lines (26 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package ch.usi.si.seart.treesitter;
import org.mockito.Mockito;
import java.util.List;
public abstract class BaseTest {
protected static final Language invalid;
protected static final Node empty = new Node.Null();
protected static final Node treeless = new Node(1, 1, 1, 1, 1L, null);
protected static final Point _0_0_ = new Point(0, 0);
protected static final Point _0_1_ = new Point(0, 1);
protected static final Point _1_0_ = new Point(1, 0);
protected static final Point _1_1_ = new Point(1, 1);
protected static final Point _2_2_ = new Point(2, 2);
static {
LibraryLoader.load();
invalid = Mockito.mock(Language.class);
Mockito.when(invalid.name()).thenReturn("INVALID");
Mockito.when(invalid.ordinal()).thenReturn(Language.values().length);
Mockito.when(invalid.getId()).thenReturn(0L);
Mockito.when(invalid.getVersion()).thenReturn(0);
Mockito.when(invalid.getTotalStates()).thenReturn(0);
Mockito.when(invalid.getSymbols()).thenReturn(List.of());
Mockito.when(invalid.getFields()).thenReturn(List.of());
Mockito.when(invalid.getExtensions()).thenReturn(List.of());
Mockito.when(invalid.nextState(Mockito.any())).thenCallRealMethod();
}
}