1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.yaml.snakeyaml.reader;
18
19 import java.io.FileReader;
20 import java.io.IOException;
21 import java.io.Reader;
22 import java.util.List;
23
24 import junit.framework.TestCase;
25
26 import org.yaml.snakeyaml.Yaml;
27
28 public class IoReaderTest extends TestCase {
29
30 @SuppressWarnings("unchecked")
31 public void testCheckPrintable() throws IOException {
32 Yaml yaml = new Yaml();
33 Reader reader = new FileReader("src/test/resources/specification/example2_1.yaml");
34 List<String> list = (List<String>) yaml.load(reader);
35 reader.close();
36 assertEquals(3, list.size());
37 }
38
39
40
41
42 public void testBigInput() throws IOException {
43 Yaml yaml = new Yaml();
44 Reader reader = new FileReader("src/test/resources/reader/large.yaml");
45 @SuppressWarnings("unchecked")
46 List<Object> list = (List<Object>) yaml.load(reader);
47 reader.close();
48 assertEquals(37, list.size());
49 }
50 }