forked from tabulapdf/tabula-java
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTestCell.java
45 lines (33 loc) · 1.01 KB
/
TestCell.java
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
37
38
39
40
41
42
43
44
45
package technology.tabula;
import static org.junit.Assert.*;
import java.util.List;
import java.util.ArrayList;
import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.junit.Test;
public class TestCell {
@Test
public void testIsSpanning() {
Cell cell = new Cell(0, 0, 0, 0);
assertFalse(cell.isSpanning());
cell.setSpanning(true);
assertTrue(cell.isSpanning());
}
@Test
public void testIsPlaceholder() {
Cell cell = new Cell(0, 0, 0, 0);
assertFalse(cell.isPlaceholder());
cell.setPlaceholder(true);
assertTrue(cell.isPlaceholder());
}
@Test
public void testGetTextElements() {
Cell cell = new Cell(0, 0, 0, 0);
assertTrue(cell.getTextElements().isEmpty());
TextElement tElement = new TextElement(0, 0, 0, 0, PDType1Font.HELVETICA_BOLD, 10, "test", 5);
TextChunk tChunk = new TextChunk(tElement);
List<TextChunk> tList = new ArrayList<TextChunk>();
tList.add(tChunk);
cell.setTextElements(tList);
assertEquals("test", cell.getTextElements().get(0).getText());
}
}