test_class.declarator: RES_DIR = Paths.get("src/test/resources/").toAbsolutePath()
test_class.modifier: private static final
test_class.original_string: private static final Path RES_DIR = Paths.get("src/test/resources/").toAbsolutePath();
test_class.type: Path
test_class.var_name: RES_DIR
test_class.declarator: projectPath
test_class.modifier: private
test_class.original_string: private Path projectPath;
test_class.type: Path
test_class.var_name: projectPath
test_class.declarator: sourceRoot
test_class.modifier: private
test_class.original_string: private Path sourceRoot;
test_class.type: Path
test_class.var_name: sourceRoot
test_class.declarator: list1 = new ArrayList<>()
test_class.original_string: List<String> list1 = new ArrayList<>();
test_class.type: List<String>
test_class.var_name: list1
test_class.declarator: list2 = new ArrayList<>()
test_class.original_string: List<String> list2 = new ArrayList<>();
test_class.type: List<String>
test_class.var_name: list2
test_class.declarator: filter = new Filter(list1, list2)
test_class.original_string: Filter filter = new Filter(list1, list2);
test_class.type: Filter
test_class.var_name: filter
test_class.file: misc/openapi-ballerina/modules/openapi-to-ballerina-generator/src/test/java/org/ballerinalang/openapi/CodeGeneratorTest.java
test_class.identifier: CodeGeneratorTest
test_case.body: @Test(description = "Test Ballerina client generation")
      public void generateClient() {
          final String pkgName = "client";
          String definitionPath = RES_DIR + File.separator + "petstore.yaml";
          CodeGenerator generator = new CodeGenerator();
          generator.setSrcPackage(pkgName);
          try {
              OpenAPIBallerinaProject ballerinaProject = OpenAPICommandTest.createBalProject(projectPath.toString()
              );
              Path outFile = ballerinaProject.getImplPath().resolve("client")
                      .resolve(Paths.get("openapi_petstore.bal"));
              generator.generateClient(projectPath.toString(), definitionPath, "openapi_petstore",
                      projectPath.toString(), filter);
              if (Files.exists(outFile)) {
                  String result = new String(Files.readAllBytes(outFile));
                  Assert.assertTrue(result.contains("public remote function listPets()"));
              } else {
                  Assert.fail("Client was not generated");
              }
          } catch (IOException | BallerinaOpenApiException e) {
              Assert.fail("Error while generating the service. " + e.getMessage());
          }
      }
test_case.class_method_signature: CodeGeneratorTest.generateClient()
test_case.full_signature: @Test(description = "Test Ballerina client generation") public void generateClient()
test_case.identifier: generateClient
test_case.invocations: setSrcPackage createBalProject toString resolve resolve getImplPath get generateClient toString toString exists readAllBytes assertTrue contains fail fail getMessage
test_case.modifiers: @Test(description = "Test Ballerina client generation") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void generateClient()
focal_class.declarator: srcPackage
focal_class.modifier: private
focal_class.original_string: private String srcPackage;
focal_class.type: String
focal_class.var_name: srcPackage
focal_class.declarator: modelPackage
focal_class.modifier: private
focal_class.original_string: private String modelPackage;
focal_class.type: String
focal_class.var_name: modelPackage
focal_class.declarator: outStream = System.err
focal_class.modifier: private static final
focal_class.original_string: private static final PrintStream outStream = System.err;
focal_class.type: PrintStream
focal_class.var_name: outStream
focal_class.file: misc/openapi-ballerina/modules/openapi-to-ballerina-generator/src/main/java/org/ballerinalang/openapi/CodeGenerator.java
focal_class.identifier: CodeGenerator
focal_class.class_method_signature: CodeGenerator.generate(GenType type, String executionPath, String definitionPath,
                            String reldefinitionPath , String serviceName, String outPath, Filter filter)
focal_class.full_signature: private void generate(GenType type, String executionPath, String definitionPath,
                            String reldefinitionPath , String serviceName, String outPath, Filter filter)
focal_class.identifier: generate
focal_class.modifiers: private
focal_class.parameters: (GenType type, String executionPath, String definitionPath,
                            String reldefinitionPath , String serviceName, String outPath, Filter filter)
focal_class.return: void
focal_class.signature: void generate(GenType type, String executionPath, String definitionPath,
                            String reldefinitionPath , String serviceName, String outPath, Filter filter)
focal_class.class_method_signature: CodeGenerator.generateBothFiles(GenType type, String definitionPath,
                            String reldefinitionPath , String serviceName, String outPath , Filter filter)
focal_class.full_signature: public void generateBothFiles(GenType type, String definitionPath,
                            String reldefinitionPath , String serviceName, String outPath , Filter filter)
focal_class.identifier: generateBothFiles
focal_class.modifiers: public
focal_class.parameters: (GenType type, String definitionPath,
                            String reldefinitionPath , String serviceName, String outPath , Filter filter)
focal_class.return: void
focal_class.signature: void generateBothFiles(GenType type, String definitionPath,
                            String reldefinitionPath , String serviceName, String outPath , Filter filter)
focal_class.class_method_signature: CodeGenerator.distinctByKey(
              Function<? super T, ?> keyExtractor)
focal_class.full_signature: public static Predicate<T> distinctByKey(
              Function<? super T, ?> keyExtractor)
focal_class.identifier: distinctByKey
focal_class.modifiers: public static
focal_class.parameters: (
              Function<? super T, ?> keyExtractor)
focal_class.return: Predicate<T>
focal_class.signature: Predicate<T> distinctByKey(
              Function<? super T, ?> keyExtractor)
focal_class.class_method_signature: CodeGenerator.generateClient(String executionPath, String definitionPath, String serviceName, String outPath,
                                 Filter filter)
focal_class.full_signature: public void generateClient(String executionPath, String definitionPath, String serviceName, String outPath,
                                 Filter filter)
focal_class.identifier: generateClient
focal_class.modifiers: public
focal_class.parameters: (String executionPath, String definitionPath, String serviceName, String outPath,
                                 Filter filter)
focal_class.return: void
focal_class.signature: void generateClient(String executionPath, String definitionPath, String serviceName, String outPath,
                                 Filter filter)
focal_class.class_method_signature: CodeGenerator.generateService(String executionPath, String definitionPath,
                                  String reldefinitionPath, String serviceName, String outPath, Filter filter)
focal_class.full_signature: public void generateService(String executionPath, String definitionPath,
                                  String reldefinitionPath, String serviceName, String outPath, Filter filter)
focal_class.identifier: generateService
focal_class.modifiers: public
focal_class.parameters: (String executionPath, String definitionPath,
                                  String reldefinitionPath, String serviceName, String outPath, Filter filter)
focal_class.return: void
focal_class.signature: void generateService(String executionPath, String definitionPath,
                                  String reldefinitionPath, String serviceName, String outPath, Filter filter)
focal_class.class_method_signature: CodeGenerator.generateBalSource(GenType type, String definitionPath,
                                                String reldefinitionPath, String serviceName, Filter filter)
focal_class.full_signature: public List<GenSrcFile> generateBalSource(GenType type, String definitionPath,
                                                String reldefinitionPath, String serviceName, Filter filter)
focal_class.identifier: generateBalSource
focal_class.modifiers: public
focal_class.parameters: (GenType type, String definitionPath,
                                                String reldefinitionPath, String serviceName, Filter filter)
focal_class.return: List<GenSrcFile>
focal_class.signature: List<GenSrcFile> generateBalSource(GenType type, String definitionPath,
                                                String reldefinitionPath, String serviceName, Filter filter)
focal_class.class_method_signature: CodeGenerator.writeBallerina(Object object, String templateDir, String templateName, String outPath)
focal_class.full_signature: @Deprecated public void writeBallerina(Object object, String templateDir, String templateName, String outPath)
focal_class.identifier: writeBallerina
focal_class.modifiers: @Deprecated public
focal_class.parameters: (Object object, String templateDir, String templateName, String outPath)
focal_class.return: void
focal_class.signature: void writeBallerina(Object object, String templateDir, String templateName, String outPath)
focal_class.class_method_signature: CodeGenerator.compileTemplate(String defaultTemplateDir, String templateName)
focal_class.full_signature: private Template compileTemplate(String defaultTemplateDir, String templateName)
focal_class.identifier: compileTemplate
focal_class.modifiers: private
focal_class.parameters: (String defaultTemplateDir, String templateName)
focal_class.return: Template
focal_class.signature: Template compileTemplate(String defaultTemplateDir, String templateName)
focal_class.class_method_signature: CodeGenerator.writeGeneratedSources(List<GenSrcFile> sources, Path srcPath, Path implPath, GenType type)
focal_class.full_signature: private void writeGeneratedSources(List<GenSrcFile> sources, Path srcPath, Path implPath, GenType type)
focal_class.identifier: writeGeneratedSources
focal_class.modifiers: private
focal_class.parameters: (List<GenSrcFile> sources, Path srcPath, Path implPath, GenType type)
focal_class.return: void
focal_class.signature: void writeGeneratedSources(List<GenSrcFile> sources, Path srcPath, Path implPath, GenType type)
focal_class.class_method_signature: CodeGenerator.setGeneratedFileName(File[] listFiles, GenSrcFile gFile, int duplicateCount)
focal_class.full_signature: private void setGeneratedFileName(File[] listFiles, GenSrcFile gFile, int duplicateCount)
focal_class.identifier: setGeneratedFileName
focal_class.modifiers: private
focal_class.parameters: (File[] listFiles, GenSrcFile gFile, int duplicateCount)
focal_class.return: void
focal_class.signature: void setGeneratedFileName(File[] listFiles, GenSrcFile gFile, int duplicateCount)
focal_class.class_method_signature: CodeGenerator.generateClient(BallerinaOpenApi context)
focal_class.full_signature: private List<GenSrcFile> generateClient(BallerinaOpenApi context)
focal_class.identifier: generateClient
focal_class.modifiers: private
focal_class.parameters: (BallerinaOpenApi context)
focal_class.return: List<GenSrcFile>
focal_class.signature: List<GenSrcFile> generateClient(BallerinaOpenApi context)
focal_class.class_method_signature: CodeGenerator.generateBallerinaService(BallerinaOpenApiType api)
focal_class.full_signature: private List<GenSrcFile> generateBallerinaService(BallerinaOpenApiType api)
focal_class.identifier: generateBallerinaService
focal_class.modifiers: private
focal_class.parameters: (BallerinaOpenApiType api)
focal_class.return: List<GenSrcFile>
focal_class.signature: List<GenSrcFile> generateBallerinaService(BallerinaOpenApiType api)
focal_class.class_method_signature: CodeGenerator.getContent(BallerinaOpenApiType object, String templateDir, String templateName)
focal_class.full_signature: private String getContent(BallerinaOpenApiType object, String templateDir, String templateName)
focal_class.identifier: getContent
focal_class.modifiers: private
focal_class.parameters: (BallerinaOpenApiType object, String templateDir, String templateName)
focal_class.return: String
focal_class.signature: String getContent(BallerinaOpenApiType object, String templateDir, String templateName)
focal_class.class_method_signature: CodeGenerator.getContent(BallerinaOpenApi object, String templateDir, String templateName)
focal_class.full_signature: private String getContent(BallerinaOpenApi object, String templateDir, String templateName)
focal_class.identifier: getContent
focal_class.modifiers: private
focal_class.parameters: (BallerinaOpenApi object, String templateDir, String templateName)
focal_class.return: String
focal_class.signature: String getContent(BallerinaOpenApi object, String templateDir, String templateName)
focal_class.class_method_signature: CodeGenerator.getSrcPackage()
focal_class.full_signature: public String getSrcPackage()
focal_class.identifier: getSrcPackage
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getSrcPackage()
focal_class.class_method_signature: CodeGenerator.setSrcPackage(String srcPackage)
focal_class.full_signature: public void setSrcPackage(String srcPackage)
focal_class.identifier: setSrcPackage
focal_class.modifiers: public
focal_class.parameters: (String srcPackage)
focal_class.return: void
focal_class.signature: void setSrcPackage(String srcPackage)
focal_class.class_method_signature: CodeGenerator.getModelPackage()
focal_class.full_signature: public String getModelPackage()
focal_class.identifier: getModelPackage
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getModelPackage()
focal_class.class_method_signature: CodeGenerator.setModelPackage(String modelPackage)
focal_class.full_signature: public void setModelPackage(String modelPackage)
focal_class.identifier: setModelPackage
focal_class.modifiers: public
focal_class.parameters: (String modelPackage)
focal_class.return: void
focal_class.signature: void setModelPackage(String modelPackage)
focal_method.body: public void generateClient(String executionPath, String definitionPath, String serviceName, String outPath,
                                 Filter filter)
              throws IOException, BallerinaOpenApiException {
          generate(GenType.GEN_CLIENT, executionPath, definitionPath, null, serviceName, outPath, filter);
      }
focal_method.class_method_signature: CodeGenerator.generateClient(String executionPath, String definitionPath, String serviceName, String outPath,
                                 Filter filter)
focal_method.full_signature: public void generateClient(String executionPath, String definitionPath, String serviceName, String outPath,
                                 Filter filter)
focal_method.identifier: generateClient
focal_method.invocations: generate
focal_method.modifiers: public
focal_method.parameters: (String executionPath, String definitionPath, String serviceName, String outPath,
                                 Filter filter)
focal_method.return: void
focal_method.signature: void generateClient(String executionPath, String definitionPath, String serviceName, String outPath,
                                 Filter filter)