test_class.file: core/src/test/java/net/adamcin/oakpal/core/opear/AdhocOpearTest.java
test_class.identifier: AdhocOpearTest
test_case.body: @Test
      public void testFromPlanFile() {
          final File planFile = new File("src/test/resources/OpearFileTest/folders_on_classpath/plan.json");
          Result<AdhocOpear> opearResult = AdhocOpear.fromPlanFile(planFile, null);
  
          assertFalse("opear should not be a failure", opearResult.isFailure());
          AdhocOpear opear = opearResult.getOrDefault(null);
          assertNotNull("opear is not null", opear);
  
          assertEquals("expect planFile is referenced by default plan url",
                  planFile.getAbsolutePath(),
                  Fun.tryOrOptional0(() -> new File(opear.getDefaultPlan().toURI()).getAbsolutePath()).get().orElse(""));
  
          assertEquals("expect planFile is referenced by specific plan referenced by empty plan name",
                  planFile.getAbsolutePath(), opear.getSpecificPlan("")
                          .flatMap(Fun.result1(URL::toURI))
                          .map(Fun.compose1(File::new, File::getAbsolutePath)).getOrDefault(""));
  
          final ClassLoader parent = getClass().getClassLoader();
          final ClassLoader planCl = opear.getPlanClassLoader(parent);
          assertNotSame("not same classloader", parent, planCl);
          assertSame("expect same parent", parent, planCl.getParent());
  
          assertTrue("expect instance of URLClassLoader", planCl instanceof URLClassLoader);
          final URL firstUrl = ((URLClassLoader) planCl).getURLs()[0];
  
          assertEquals("expect planFile parent is referenced by first url",
                  planFile.getParentFile().getAbsolutePath(),
                  Fun.tryOrOptional0(() -> new File(firstUrl.toURI()).getAbsolutePath()).get().orElse(""));
      }
test_case.class_method_signature: AdhocOpearTest.testFromPlanFile()
test_case.full_signature: @Test public void testFromPlanFile()
test_case.identifier: testFromPlanFile
test_case.invocations: fromPlanFile assertFalse isFailure getOrDefault assertNotNull assertEquals getAbsolutePath orElse get tryOrOptional0 getAbsolutePath toURI getDefaultPlan assertEquals getAbsolutePath getOrDefault map flatMap getSpecificPlan result1 compose1 getClassLoader getClass getPlanClassLoader assertNotSame assertSame getParent assertTrue getURLs assertEquals getAbsolutePath getParentFile orElse get tryOrOptional0 getAbsolutePath toURI
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFromPlanFile()
focal_class.declarator: planFileUrl
focal_class.modifier: private final
focal_class.original_string: private final URL planFileUrl;
focal_class.type: URL
focal_class.var_name: planFileUrl
focal_class.declarator: baseUrl
focal_class.modifier: private final
focal_class.original_string: private final URL baseUrl;
focal_class.type: URL
focal_class.var_name: baseUrl
focal_class.file: core/src/main/java/net/adamcin/oakpal/core/opear/AdhocOpear.java
focal_class.identifier: AdhocOpear
focal_class.interfaces: implements Opear
focal_class.class_method_signature: AdhocOpear.AdhocOpear(final @NotNull URL planFileUrl, final @NotNull URL baseUrl)
focal_class.full_signature: public  AdhocOpear(final @NotNull URL planFileUrl, final @NotNull URL baseUrl)
focal_class.identifier: AdhocOpear
focal_class.modifiers: public
focal_class.parameters: (final @NotNull URL planFileUrl, final @NotNull URL baseUrl)
focal_class.signature:  AdhocOpear(final @NotNull URL planFileUrl, final @NotNull URL baseUrl)
focal_class.class_method_signature: AdhocOpear.getDefaultPlan()
focal_class.full_signature: @Override public URL getDefaultPlan()
focal_class.identifier: getDefaultPlan
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: URL
focal_class.signature: URL getDefaultPlan()
focal_class.class_method_signature: AdhocOpear.getSpecificPlan(final @NotNull String planName)
focal_class.full_signature: @Override public Result<URL> getSpecificPlan(final @NotNull String planName)
focal_class.identifier: getSpecificPlan
focal_class.modifiers: @Override public
focal_class.parameters: (final @NotNull String planName)
focal_class.return: Result<URL>
focal_class.signature: Result<URL> getSpecificPlan(final @NotNull String planName)
focal_class.class_method_signature: AdhocOpear.getPlanClassLoader(final @NotNull ClassLoader parent)
focal_class.full_signature: @Override public ClassLoader getPlanClassLoader(final @NotNull ClassLoader parent)
focal_class.identifier: getPlanClassLoader
focal_class.modifiers: @Override public
focal_class.parameters: (final @NotNull ClassLoader parent)
focal_class.return: ClassLoader
focal_class.signature: ClassLoader getPlanClassLoader(final @NotNull ClassLoader parent)
focal_class.class_method_signature: AdhocOpear.fromPlanFile(final @NotNull File planFile, final @Nullable File baseDir)
focal_class.full_signature: public static Result<AdhocOpear> fromPlanFile(final @NotNull File planFile, final @Nullable File baseDir)
focal_class.identifier: fromPlanFile
focal_class.modifiers: public static
focal_class.parameters: (final @NotNull File planFile, final @Nullable File baseDir)
focal_class.return: Result<AdhocOpear>
focal_class.signature: Result<AdhocOpear> fromPlanFile(final @NotNull File planFile, final @Nullable File baseDir)
focal_method.body: public static Result<AdhocOpear> fromPlanFile(final @NotNull File planFile, final @Nullable File baseDir) {
          final Function<File, Result<URL>> fnFileUrl = compose1(File::toURI, result1(URI::toURL));
          final Result<URL> planFileUrlResult = fnFileUrl.apply(planFile);
          return planFileUrlResult
                  .flatMap(planFileUrl -> fnFileUrl.apply(Optional.ofNullable(baseDir).orElse(planFile.getParentFile()))
                          .flatMap(baseUrl ->
                                  OakpalPlan.fromJson(planFileUrl).map(plan ->
                                          new AdhocOpear(planFileUrl, baseUrl))));
      }
focal_method.class_method_signature: AdhocOpear.fromPlanFile(final @NotNull File planFile, final @Nullable File baseDir)
focal_method.full_signature: public static Result<AdhocOpear> fromPlanFile(final @NotNull File planFile, final @Nullable File baseDir)
focal_method.identifier: fromPlanFile
focal_method.invocations: compose1 result1 apply flatMap flatMap apply orElse ofNullable getParentFile map fromJson
focal_method.modifiers: public static
focal_method.parameters: (final @NotNull File planFile, final @Nullable File baseDir)
focal_method.return: Result<AdhocOpear>
focal_method.signature: Result<AdhocOpear> fromPlanFile(final @NotNull File planFile, final @Nullable File baseDir)