test_class.declarator: testOutBaseDir = new File("target/test-out/OpearPlanMojoTest")
test_class.modifier: private final
test_class.original_string: private final File testOutBaseDir = new File("target/test-out/OpearPlanMojoTest");
test_class.type: File
test_class.var_name: testOutBaseDir
test_class.file: maven/src/test/java/net/adamcin/oakpal/maven/mojo/OpearPlanMojoTest.java
test_class.identifier: OpearPlanMojoTest
test_case.body: @Test(expected = MojoFailureException.class)
      public void testExecute_failDir() throws Exception {
          final File testOutDir = new File(testOutBaseDir, "testExecute_failDir");
          FileUtils.deleteDirectory(testOutDir);
          OpearPlanMojo mojo = newMojo();
          final MavenProject project = mock(MavenProject.class);
          mojo.project = project;
          final Build build = mock(Build.class);
          when(project.getBuild()).thenReturn(build);
          final File classes = new File(testOutDir, "classes");
          when(build.getOutputDirectory()).thenReturn(classes.getPath());
  
          final MavenSession session = mock(MavenSession.class);
          mojo.session = session;
          final MavenExecutionRequest executionRequest = mock(MavenExecutionRequest.class);
          when(session.getRequest()).thenReturn(executionRequest);
          final RepositorySystem repositorySystem = mock(RepositorySystem.class);
          mojo.repositorySystem = repositorySystem;
  
          mojo.planFile = new File(testOutDir, "opear-plans/plan.json");
          mojo.planFile.mkdirs();
          mojo.execute();
      }
test_case.class_method_signature: OpearPlanMojoTest.testExecute_failDir()
test_case.full_signature: @Test(expected = MojoFailureException.class) public void testExecute_failDir()
test_case.identifier: testExecute_failDir
test_case.invocations: deleteDirectory newMojo mock mock thenReturn when getBuild thenReturn when getOutputDirectory getPath mock mock thenReturn when getRequest mock mkdirs execute
test_case.modifiers: @Test(expected = MojoFailureException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExecute_failDir()
focal_class.declarator: planFile
focal_class.modifier: @Parameter(name = "planFile", defaultValue = "${project.build.directory}/oakpal-plugin/opear-plans/plan.json", required = true)
focal_class.original_string: @Parameter(name = "planFile", defaultValue = "${project.build.directory}/oakpal-plugin/opear-plans/plan.json", required = true)
      File planFile;
focal_class.type: File
focal_class.var_name: planFile
focal_class.declarator: planParams
focal_class.modifier: @Parameter(name = "planParams")
focal_class.original_string: @Parameter(name = "planParams")
      PlanParams planParams;
focal_class.type: PlanParams
focal_class.var_name: planParams
focal_class.file: maven/src/main/java/net/adamcin/oakpal/maven/mojo/OpearPlanMojo.java
focal_class.identifier: OpearPlanMojo
focal_class.interfaces: implements MojoWithPlanParams
focal_class.class_method_signature: OpearPlanMojo.execute()
focal_class.full_signature: @Override public void execute()
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void execute()
focal_class.class_method_signature: OpearPlanMojo.getPlanBuilderParams()
focal_class.full_signature: @Override public PlanBuilderParams getPlanBuilderParams()
focal_class.identifier: getPlanBuilderParams
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: PlanBuilderParams
focal_class.signature: PlanBuilderParams getPlanBuilderParams()
focal_class.superclass: extends AbstractCommonMojo
focal_method.body: @Override
      public void execute() throws MojoFailureException {
          planFile.getParentFile().mkdirs();
  
          final JsonWriterFactory writerFactory =
                  Json.createWriterFactory(Collections.singletonMap(JsonGenerator.PRETTY_PRINTING, true));
          ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
          try (OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(planFile), StandardCharsets.UTF_8);
               JsonWriter writer = writerFactory.createWriter(osw)) {
              Thread.currentThread().setContextClassLoader(createContainerClassLoader());
              OakpalPlan plan = buildPlan();
              writer.writeObject(plan.toJson());
          } catch (IOException e) {
              throw new MojoFailureException("Failed to write plan json to file " + planFile.getAbsolutePath(), e);
          } finally {
              Thread.currentThread().setContextClassLoader(oldCl);
          }
      }
focal_method.class_method_signature: OpearPlanMojo.execute()
focal_method.full_signature: @Override public void execute()
focal_method.identifier: execute
focal_method.invocations: mkdirs getParentFile createWriterFactory singletonMap getContextClassLoader currentThread createWriter setContextClassLoader currentThread createContainerClassLoader buildPlan writeObject toJson getAbsolutePath setContextClassLoader currentThread
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void execute()