~ubuntu-branches/ubuntu/precise/commons-csv/precise

« back to all changes in this revision

Viewing changes to src/test/org/apache/commons/csv/CSVStrategyTest.java

  • Committer: Bazaar Package Importer
  • Author(s): Jan-Pascal van Best
  • Date: 2008-09-10 20:58:00 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080910205800-ohoq6075nafu8n2b
Tags: upstream-0.1-SNAPSHOT+svn678580
ImportĀ upstreamĀ versionĀ 0.1-SNAPSHOT+svn678580

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 */
17
17
package org.apache.commons.csv;
18
18
 
19
 
import java.io.IOException;
20
 
import java.io.Reader;
21
19
import java.io.StringReader;
22
 
import java.util.Arrays;
23
20
 
24
 
import junit.framework.Test;
25
21
import junit.framework.TestCase;
26
 
import junit.framework.TestSuite;
27
22
 
28
23
/**
29
24
 * CSVStrategyTest
35
30
 * has problems...).
36
31
 */
37
32
public class CSVStrategyTest extends TestCase {
38
 
  
39
 
  /**
40
 
   * Constructor for JUnit.
41
 
   * @param name Name to be used in JUnit Test Environment
42
 
   */
43
 
  public CSVStrategyTest(String name) {
44
 
    super(name);
45
 
  }
46
 
 
47
 
  /**
48
 
   * Returns a Test suite for JUnit.
49
 
   * @return Test suite for JUnit
50
 
   */
51
 
  public static Test suite() {
52
 
    return new TestSuite(CSVStrategyTest.class);
53
 
  }
54
 
 
55
33
 
56
34
  // ======================================================
57
35
  //   getters / setters
91
69
    // default settings
92
70
    assertEquals(strategy.getDelimiter(), ',');
93
71
    assertEquals(strategy.getEncapsulator(), '"');
94
 
    assertEquals(strategy.getCommentStart(), '\0');
 
72
    assertEquals(strategy.getCommentStart(), CSVStrategy.COMMENTS_DISABLED);
95
73
    assertEquals(true,  strategy.getIgnoreLeadingWhitespaces());
96
74
    assertEquals(false, strategy.getUnicodeEscapeInterpretation());
97
75
    assertEquals(true,  strategy.getIgnoreEmptyLines());
99
77
    parser.setStrategy(CSVStrategy.DEFAULT_STRATEGY);
100
78
    assertEquals(strategy.getDelimiter(), ',');
101
79
    assertEquals(strategy.getEncapsulator(), '"');
102
 
    assertEquals(strategy.getCommentStart(), '\0');
 
80
    assertEquals(strategy.getCommentStart(), CSVStrategy.COMMENTS_DISABLED);
103
81
    assertEquals(true,  strategy.getIgnoreLeadingWhitespaces());
104
82
    assertEquals(false, strategy.getUnicodeEscapeInterpretation());
105
83
    assertEquals(true,  strategy.getIgnoreEmptyLines());
109
87
    CSVStrategy strategy = CSVStrategy.EXCEL_STRATEGY;
110
88
    assertEquals(strategy.getDelimiter(), ',');
111
89
    assertEquals(strategy.getEncapsulator(), '"');
112
 
    assertEquals(strategy.getCommentStart(), '\0');
 
90
    assertEquals(strategy.getCommentStart(), CSVStrategy.COMMENTS_DISABLED);
113
91
    assertEquals(false,  strategy.getIgnoreLeadingWhitespaces());
114
92
    assertEquals(false, strategy.getUnicodeEscapeInterpretation());
115
93
    assertEquals(false, strategy.getIgnoreEmptyLines());