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 testWrite() throws IOException, ResourceFilterException {
          File tempFile = File.createTempFile(this.getClass().getSimpleName(), ".js");
          tempFile.deleteOnExit();
  
          try (OutputStream os = new FileOutputStream(tempFile)) {
              res.write(os, WRITE_BUNDLE, null);
              os.flush();
              assertTrue(ResourceTestUtil.compareFiles(EXPECTED_WRITE_FILE, tempFile));
          }
      }
test_case.class_method_signature: AmdJsResourceTest.testWrite()
test_case.full_signature: @Test public void testWrite()
test_case.identifier: testWrite
test_case.invocations: createTempFile getSimpleName getClass deleteOnExit write flush assertTrue compareFiles
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWrite()
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 void write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options) throws IOException, ResourceFilterException {
          try (OutputStreamWriter writer = new OutputStreamWriter(new BufferedOutputStream(outStream), StandardCharsets.UTF_8)) {
              writer.write("define({\n");
              boolean first = true;
              final Character quote = '"';
              for (ResourceString res : languageBundle.getSortedResourceStrings()) {
                  if (first) {
                      first = false;
                  } else {
                      writer.write(",\n");
                  }
                  writer.write(quote + escapeString(res.getKey(), quote) + quote + ": ");
                  writer.write(quote + escapeString(res.getValue(), quote) + quote);
              }
              writer.write("\n});\n");
          }
      }
focal_method.class_method_signature: AmdJsResource.write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_method.full_signature: @Override public void write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_method.identifier: write
focal_method.invocations: write getSortedResourceStrings write write escapeString getKey write escapeString getValue write
focal_method.modifiers: @Override public
focal_method.parameters: (OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_method.return: void
focal_method.signature: void write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)