test_class.declarator: tempFolder = new TemporaryFolder(new File("target"))
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public TemporaryFolder tempFolder = new TemporaryFolder(new File("target"));
test_class.type: TemporaryFolder
test_class.var_name: tempFolder
test_class.declarator: r
test_class.modifier: private
test_class.original_string: private Repository r;
test_class.type: Repository
test_class.var_name: r
test_class.declarator: s
test_class.modifier: private
test_class.original_string: private Session s;
test_class.type: Session
test_class.var_name: s
test_class.file: oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/util/NodeTypeIndexingUtilsTest.java
test_class.identifier: NodeTypeIndexingUtilsTest
test_case.body: @Test
      public void testSynonymsFileCreation() throws Exception {
          File synonymsFile = NodeTypeIndexingUtils.createPrimaryTypeSynonymsFile(tempFolder.newFolder().getPath() +
                  "/pt-synonyms.txt", s);
          assertNotNull(synonymsFile);
          assertTrue(synonymsFile.exists());
      }
test_case.class_method_signature: NodeTypeIndexingUtilsTest.testSynonymsFileCreation()
test_case.full_signature: @Test public void testSynonymsFileCreation()
test_case.identifier: testSynonymsFileCreation
test_case.invocations: createPrimaryTypeSynonymsFile getPath newFolder assertNotNull assertTrue exists
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSynonymsFileCreation()
focal_class.file: oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/util/NodeTypeIndexingUtils.java
focal_class.identifier: NodeTypeIndexingUtils
focal_class.class_method_signature: NodeTypeIndexingUtils.createPrimaryTypeSynonymsFile(String path, Session session)
focal_class.full_signature: public static File createPrimaryTypeSynonymsFile(String path, Session session)
focal_class.identifier: createPrimaryTypeSynonymsFile
focal_class.modifiers: public static
focal_class.parameters: (String path, Session session)
focal_class.return: File
focal_class.signature: File createPrimaryTypeSynonymsFile(String path, Session session)
focal_method.body: public static File createPrimaryTypeSynonymsFile(String path, Session session) throws Exception {
          File file = new File(path);
  
          StringWriter stringWriter = new StringWriter();
          NodeTypeIterator allNodeTypes = session.getWorkspace().getNodeTypeManager().getAllNodeTypes();
          while (allNodeTypes.hasNext()) {
              NodeType nodeType = allNodeTypes.nextNodeType();
              NodeType[] superTypes = nodeType.getSupertypes();
              if (superTypes != null && superTypes.length > 0) {
                  stringWriter.append(nodeType.getName()).append(" => ");
                  for (int i = 0; i < superTypes.length; i++) {
                      stringWriter.append(superTypes[i].getName());
                      if (i < superTypes.length - 1) {
                          stringWriter.append(',');
                      }
                      stringWriter.append(' ');
                  }
                  stringWriter.append('\n');
              }
          }
          FileOutputStream fileOutputStream = new FileOutputStream(file);
          fileOutputStream.write(stringWriter.toString().getBytes("UTF-8"));
          fileOutputStream.flush();
          fileOutputStream.close();
  
          if (file.exists() || file.createNewFile()) {
              return file;
          } else {
              throw new IOException("primary types synonyms file could not be created");
          }
      }
focal_method.class_method_signature: NodeTypeIndexingUtils.createPrimaryTypeSynonymsFile(String path, Session session)
focal_method.full_signature: public static File createPrimaryTypeSynonymsFile(String path, Session session)
focal_method.identifier: createPrimaryTypeSynonymsFile
focal_method.invocations: getAllNodeTypes getNodeTypeManager getWorkspace hasNext nextNodeType getSupertypes append append getName append getName append append append write getBytes toString flush close exists createNewFile
focal_method.modifiers: public static
focal_method.parameters: (String path, Session session)
focal_method.return: File
focal_method.signature: File createPrimaryTypeSynonymsFile(String path, Session session)