test_class.file: csv-res-filter/src/test/java/com/ibm/g11n/pipeline/resfilter/csv/TestCSVFilter.java
test_class.identifier: TestCSVFilter
test_case.body: @Test
      public void testParse() {
          TestResourceStringData[] expectedData = {
                  new TestResourceStringData("msg_hello", "Hello", 1),
                  new TestResourceStringData("msg_bye", "Bye", 2)
          };
  
          ResourceFilter filter = ResourceFilterFactory.getResourceFilter(CSVFilter.ID);
          try (InputStream inStream = this.getClass().getResourceAsStream("/test.csv")) {
              LanguageBundle bundle = filter.parse(inStream, new FilterOptions(Locale.ENGLISH));
              List<ResourceString> resStrings = bundle.getSortedResourceStrings();
  
              assertEquals("Number of resource strings", expectedData.length, resStrings.size());
              int idx = 0;
              for (ResourceString resString : resStrings) {
                  String key = resString.getKey();
                  String value = resString.getValue();
                  int seqNum = resString.getSequenceNumber();
  
                  TestResourceStringData expected = expectedData[idx++];
  
                  assertEquals("Resource key at index " + idx, expected.key, key);
                  assertEquals("Resource value at index " + idx, expected.value, value);
                  assertEquals("Resource sequence number at index " + idx, expected.seq, seqNum);
              }
          } catch (IOException e) {
              fail(e.getMessage());
          } catch (ResourceFilterException e) {
              fail(e.getMessage());
          }
      }
test_case.class_method_signature: TestCSVFilter.testParse()
test_case.full_signature: @Test public void testParse()
test_case.identifier: testParse
test_case.invocations: getResourceFilter getResourceAsStream getClass parse getSortedResourceStrings assertEquals size getKey getValue getSequenceNumber assertEquals assertEquals assertEquals fail getMessage fail getMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParse()
focal_class.declarator: ID = "CSV"
focal_class.modifier: public static final
focal_class.original_string: public static final String ID = "CSV";
focal_class.type: String
focal_class.var_name: ID
focal_class.declarator: TYPE = Type.SINGLE
focal_class.modifier: public static final
focal_class.original_string: public static final Type TYPE = Type.SINGLE;
focal_class.type: Type
focal_class.var_name: TYPE
focal_class.file: csv-res-filter/src/main/java/com/ibm/g11n/pipeline/resfilter/csv/CSVFilter.java
focal_class.identifier: CSVFilter
focal_class.class_method_signature: CSVFilter.parse(InputStream inStream, FilterOptions options)
focal_class.full_signature: @Override public LanguageBundle parse(InputStream inStream, FilterOptions options)
focal_class.identifier: parse
focal_class.modifiers: @Override public
focal_class.parameters: (InputStream inStream, FilterOptions options)
focal_class.return: LanguageBundle
focal_class.signature: LanguageBundle parse(InputStream inStream, FilterOptions options)
focal_class.class_method_signature: CSVFilter.write(OutputStream outStream, LanguageBundle languageBundle, FilterOptions options)
focal_class.full_signature: @Override public void write(OutputStream outStream, LanguageBundle languageBundle, FilterOptions options)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (OutputStream outStream, LanguageBundle languageBundle, FilterOptions options)
focal_class.return: void
focal_class.signature: void write(OutputStream outStream, LanguageBundle languageBundle, FilterOptions options)
focal_class.class_method_signature: CSVFilter.merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.full_signature: @Override public void merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.identifier: merge
focal_class.modifiers: @Override public
focal_class.parameters: (InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.return: void
focal_class.signature: void merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.superclass: extends ResourceFilter
focal_method.body: @Override
      public LanguageBundle parse(InputStream inStream, FilterOptions options)
              throws IOException, ResourceFilterException {
          LanguageBundleBuilder bundleBuilder = new LanguageBundleBuilder(true);
          CSVParser parser = CSVParser.parse(inStream, StandardCharsets.UTF_8,
                  CSVFormat.RFC4180.withHeader("key", "value").withSkipHeaderRecord(true));
          for (CSVRecord record : parser) {
              String key = record.get(0);
              String value = record.get(1);
              bundleBuilder.addResourceString(key, value);
          }
          return bundleBuilder.build();
      }
focal_method.class_method_signature: CSVFilter.parse(InputStream inStream, FilterOptions options)
focal_method.full_signature: @Override public LanguageBundle parse(InputStream inStream, FilterOptions options)
focal_method.identifier: parse
focal_method.invocations: parse withSkipHeaderRecord withHeader get get addResourceString build
focal_method.modifiers: @Override public
focal_method.parameters: (InputStream inStream, FilterOptions options)
focal_method.return: LanguageBundle
focal_method.signature: LanguageBundle parse(InputStream inStream, FilterOptions options)