Changeset 2494
- Timestamp:
- Aug 8, 2006, 1:20:26 PM (17 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/util/parser/FlatFileParser.java
r2481 r2494 797 797 throws IOException 798 798 { 799 if (nextData == null )799 if (nextData == null && nextSection == null) 800 800 { 801 801 boolean done = false; -
trunk/src/test/TestFlatFileParser.java
r2409 r2494 1 1 import java.io.InputStream; 2 import java.util.ArrayList;3 2 import java.util.Arrays; 4 import java.util.List; 3 import java.util.HashSet; 4 import java.util.Set; 5 5 import java.util.regex.Pattern; 6 6 … … 115 115 write("--Parse OK (" + file + ")"); 116 116 } 117 catch ( Exceptionex)117 catch (Throwable ex) 118 118 { 119 119 write("--Parse FAILED (" + file + ")"); … … 127 127 try 128 128 { 129 ArrayList<String> sections = new ArrayList<String>(Arrays.asList("[FileInformation]", "[Block1]", "[Block2]", "[Block3]", "[Block4]", "[mapping]"));129 Set<String> sections = new HashSet<String>(Arrays.asList("FileInformation", "Block1", "Block2", "Block3", "Block4", "mapping")); 130 130 InputStream in = FileUtil.getInputStream(new java.io.File(file)); 131 131 ffp.setInputStream(in); … … 134 134 { 135 135 section = ffp.nextSection(); 136 sections.remove(section. line());136 sections.remove(section.name()); 137 137 ffp.parseHeaders(); 138 138 ffp.nextData(); … … 141 141 if (!sections.isEmpty()) 142 142 { 143 write("--Parse sections FAILED didnt find all sections in (" + file + "), missed:" + sections);143 throw new Exception("Didn't find all sections in (" + file + "), missed: " + sections); 144 144 } 145 145 write("--Parse sections OK (" + file + ")"); 146 146 } 147 catch ( Exceptionex)147 catch (Throwable ex) 148 148 { 149 149 write("--Parse sections FAILED (" + file + ")");
Note: See TracChangeset
for help on using the changeset viewer.