Skip to content

Commit 1303723

Browse files
committed
Merge branch '2.x' into 3.x
2 parents cfd1b60 + 233c4e4 commit 1303723

File tree

2 files changed

+41
-37
lines changed

2 files changed

+41
-37
lines changed

cbor/src/test/java/tools/jackson/dataformat/cbor/ParseLongAsciiTextTest.java

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package tools.jackson.dataformat.cbor.parse;
2+
3+
import java.nio.charset.StandardCharsets;
4+
5+
import org.junit.jupiter.api.Test;
6+
7+
import tools.jackson.core.JsonParser;
8+
import tools.jackson.core.JsonToken;
9+
import tools.jackson.core.ObjectReadContext;
10+
import tools.jackson.dataformat.cbor.CBORFactory;
11+
import tools.jackson.dataformat.cbor.CBORParser;
12+
import tools.jackson.dataformat.cbor.CBORTestBase;
13+
14+
import static org.junit.jupiter.api.Assertions.assertEquals;
15+
16+
public class ParseLongAsciiTextTest extends CBORTestBase
17+
{
18+
private final CBORFactory CBOR_F = cborFactory();
19+
20+
@Test
21+
public void testLongNonChunkedAsciiText() throws Exception
22+
{
23+
try (JsonParser p = CBOR_F.createParser(ObjectReadContext.empty(),
24+
this.getClass().getResourceAsStream("/data/macbeth-snippet-non-chunked.cbor"))) {
25+
assertEquals(JsonToken.VALUE_STRING, p.nextToken());
26+
String expected = new String(readResource("/data/macbeth-snippet.txt"), "UTF-8");
27+
assertEquals(expected, p.getString());
28+
}
29+
}
30+
31+
@Test
32+
public void testLongChunkedAsciiText() throws Exception
33+
{
34+
try (JsonParser p = CBOR_F.createParser(ObjectReadContext.empty(),
35+
this.getClass().getResourceAsStream("/data/macbeth-snippet-chunked.cbor"))) {
36+
assertEquals(JsonToken.VALUE_STRING, p.nextToken());
37+
String expected = new String(readResource("/data/macbeth-snippet.txt"), StandardCharsets.UTF_8);
38+
assertEquals(expected, p.getString());
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)