Skip to content

Commit afbeaed

Browse files
committed
[CSV-150] Add disabled test JiraCsv150Test
See also apache#68
1 parent be3f01a commit afbeaed

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.commons.csv.issues;
18+
19+
import static org.junit.jupiter.api.Assertions.assertEquals;
20+
21+
import java.io.IOException;
22+
import java.io.StringReader;
23+
24+
import org.apache.commons.csv.CSVFormat;
25+
import org.apache.commons.csv.CSVParser;
26+
import org.junit.jupiter.api.Disabled;
27+
import org.junit.jupiter.api.Test;
28+
29+
@Disabled
30+
public class JiraCsv150Test {
31+
32+
private void testDisable(final CSVFormat csvFormat, final StringReader stringReader) throws IOException {
33+
try (CSVParser csvParser = new CSVParser(stringReader, csvFormat)) {
34+
assertEquals(1, csvParser.getRecords().size());
35+
}
36+
}
37+
38+
@Test
39+
public void testDisableComment() throws IOException {
40+
final StringReader stringReader = new StringReader("\"66\u2441\",,\"\",\"DeutscheBK\ufffe\",\"000\"\r\n");
41+
testDisable(CSVFormat.DEFAULT.builder().setCommentMarker(null).build(), stringReader);
42+
}
43+
44+
@Test
45+
public void testDisableEncapsulation() throws IOException {
46+
final StringReader stringReader = new StringReader("66\u2441,,\"\",\ufffeDeutscheBK,\"000\"\r\n");
47+
testDisable(CSVFormat.DEFAULT.builder().setQuote(null).build(), stringReader);
48+
}
49+
50+
@Test
51+
public void testDisableEscaping() throws IOException {
52+
final StringReader stringReader = new StringReader("\"66\u2441\",,\"\",\"DeutscheBK\ufffe\",\"000\"\r\n");
53+
testDisable(CSVFormat.DEFAULT.builder().setEscape(null).build(), stringReader);
54+
}
55+
}

0 commit comments

Comments
 (0)