test_class.declarator: INPUT_FILE = new File("src/test/resource/resfilter/amdjs/input.js")
test_class.modifier: private static final
test_class.original_string: private static final File INPUT_FILE = new File("src/test/resource/resfilter/amdjs/input.js");
test_class.type: File
test_class.var_name: INPUT_FILE
test_class.declarator: EXPECTED_WRITE_FILE = new File("src/test/resource/resfilter/amdjs/write-output.js")
test_class.modifier: private static final
test_class.original_string: private static final File EXPECTED_WRITE_FILE = new File("src/test/resource/resfilter/amdjs/write-output.js");
test_class.type: File
test_class.var_name: EXPECTED_WRITE_FILE
test_class.declarator: MERGE_INPUT_1_FILE = new File("src/test/resource/resfilter/amdjs/merge-input-1.js")
test_class.modifier: private static final
test_class.original_string: private static final File MERGE_INPUT_1_FILE = new File("src/test/resource/resfilter/amdjs/merge-input-1.js");
test_class.type: File
test_class.var_name: MERGE_INPUT_1_FILE
test_class.declarator: MERGE_INPUT_2_FILE = new File("src/test/resource/resfilter/amdjs/merge-input-2.js")
test_class.modifier: private static final
test_class.original_string: private static final File MERGE_INPUT_2_FILE = new File("src/test/resource/resfilter/amdjs/merge-input-2.js");
test_class.type: File
test_class.var_name: MERGE_INPUT_2_FILE
test_class.declarator: MERGE_INPUT_3_FILE = new File("src/test/resource/resfilter/amdjs/merge-input-3.js")
test_class.modifier: private static final
test_class.original_string: private static final File MERGE_INPUT_3_FILE = new File("src/test/resource/resfilter/amdjs/merge-input-3.js");
test_class.type: File
test_class.var_name: MERGE_INPUT_3_FILE
test_class.declarator: EXPECTED_MERGE_1_FILE = new File("src/test/resource/resfilter/amdjs/merge-output-1.js")
test_class.modifier: private static final
test_class.original_string: private static final File EXPECTED_MERGE_1_FILE = new File("src/test/resource/resfilter/amdjs/merge-output-1.js");
test_class.type: File
test_class.var_name: EXPECTED_MERGE_1_FILE
test_class.declarator: EXPECTED_MERGE_2_FILE = new File("src/test/resource/resfilter/amdjs/merge-output-2.js")
test_class.modifier: private static final
test_class.original_string: private static final File EXPECTED_MERGE_2_FILE = new File("src/test/resource/resfilter/amdjs/merge-output-2.js");
test_class.type: File
test_class.var_name: EXPECTED_MERGE_2_FILE
test_class.declarator: EXPECTED_MERGE_3_FILE = new File("src/test/resource/resfilter/amdjs/merge-output-3.js")
test_class.modifier: private static final
test_class.original_string: private static final File EXPECTED_MERGE_3_FILE = new File("src/test/resource/resfilter/amdjs/merge-output-3.js");
test_class.type: File
test_class.var_name: EXPECTED_MERGE_3_FILE
test_class.declarator: EXPECTED_INPUT_RES_LIST
test_class.modifier: private static final
test_class.original_string: private static final Collection<ResourceString> EXPECTED_INPUT_RES_LIST;
test_class.type: Collection<ResourceString>
test_class.var_name: EXPECTED_INPUT_RES_LIST
test_class.declarator: WRITE_BUNDLE
test_class.modifier: private static
test_class.original_string: private static LanguageBundle WRITE_BUNDLE;
test_class.type: LanguageBundle
test_class.var_name: WRITE_BUNDLE
test_class.declarator: MERGE_BUNDLE
test_class.modifier: private static
test_class.original_string: private static LanguageBundle MERGE_BUNDLE;
test_class.type: LanguageBundle
test_class.var_name: MERGE_BUNDLE
test_class.declarator: res = new AmdJsResource()
test_class.modifier: private static final
test_class.original_string: private static final AmdJsResource res = new AmdJsResource();
test_class.type: AmdJsResource
test_class.var_name: res
test_class.file: gp-res-filter/src/test/java/com/ibm/g11n/pipeline/resfilter/impl/AmdJsResourceTest.java
test_class.identifier: AmdJsResourceTest
test_case.body: @Test
      public void testParse() throws IOException, ResourceFilterException {
          assertTrue("The input test file <" + INPUT_FILE + "> does not exist.", INPUT_FILE.exists());
  
          try (InputStream is = new FileInputStream(INPUT_FILE)) {
              LanguageBundle bundle = res.parse(is, null);
              List<ResourceString> resStrList = new ArrayList<>(bundle.getResourceStrings());
              Collections.sort(resStrList, new ResourceStringComparator());
              assertEquals("ResourceStrings did not match.", EXPECTED_INPUT_RES_LIST, resStrList);
          }
      }
test_case.class_method_signature: AmdJsResourceTest.testParse()
test_case.full_signature: @Test public void testParse()
test_case.identifier: testParse
test_case.invocations: assertTrue exists parse getResourceStrings sort assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParse()
focal_class.file: gp-res-filter/src/main/java/com/ibm/g11n/pipeline/resfilter/impl/AmdJsResource.java
focal_class.identifier: AmdJsResource
focal_class.class_method_signature: AmdJsResource.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: AmdJsResource.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: AmdJsResource.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.class_method_signature: AmdJsResource.escapeString(String str, Character quoteChar)
focal_class.full_signature: static String escapeString(String str, Character quoteChar)
focal_class.identifier: escapeString
focal_class.modifiers: static
focal_class.parameters: (String str, Character quoteChar)
focal_class.return: String
focal_class.signature: String escapeString(String str, Character quoteChar)
focal_class.superclass: extends ResourceFilter
focal_method.body: @Override
      public LanguageBundle parse(InputStream inStream, FilterOptions options)
              throws IOException, ResourceFilterException {
          LanguageBundleBuilder bb = new LanguageBundleBuilder(true);
  
          // TODO: Rhino parse(Reader, String, int) only throws IOException on IO
          // error thrown
          // by Reader. We need to use ErrorReporter used in the Parser
          // constructor,
          // and check the reporter after parse method to detect JavaScript syntax
          // problems.
          try (InputStreamReader reader = new InputStreamReader(new BomInputStream(inStream), "UTF-8")) {
              AstRoot root = new Parser().parse(reader, null, 1);
              KeyValueVisitor visitor = new KeyValueVisitor();
              root.visitAll(visitor);
              LinkedHashMap<String, ValueData> resultMap = visitor.elements;
              for (Entry<String, ValueData> entry : resultMap.entrySet()) {
                  bb.addResourceString(entry.getKey(), entry.getValue().getValue());
              }
          }
  
          return bb.build();
      }
focal_method.class_method_signature: AmdJsResource.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 visitAll entrySet addResourceString getKey getValue getValue 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)