test_class.declarator: testOutDir = new File("target/test-out/WebsterChecklistTargetTest")
test_class.modifier: final
test_class.original_string: final File testOutDir = new File("target/test-out/WebsterChecklistTargetTest");
test_class.type: File
test_class.var_name: testOutDir
test_class.file: webster/src/test/java/net/adamcin/oakpal/webster/targets/WebsterChecklistTargetTest.java
test_class.identifier: WebsterChecklistTargetTest
test_case.body: @Test
      public void testFromJson_nodeTypeFilters() throws Exception {
          final File targetFile = new File(testOutDir, "testFromJson_nodeTypeFilters.json");
          if (targetFile.exists()) {
              targetFile.delete();
          }
          final String fooMixin1 = "foo:mixin1";
          final String fooMixin2 = "foo:mixin2";
  
          final List<JcrNs> nsList = Collections.singletonList(JcrNs.create("foo", "http://foo.com"));
          OakMachine.Builder oak = TestUtil.fromPlan(obj()
                  .key("jcrNamespaces", nsList)
                  .key("jcrNodetypes", obj()
                          .key("foo:folder", key("extends", arr("nt:folder")))
                          .key(fooMixin1, key("@", arr("mixin")))
                          .key(fooMixin2, key("@", arr("mixin"))))
                  .key("forcedRoots", arr()
                          .val(new ForcedRoot().withPath("/foo1").withPrimaryType("nt:folder").withMixinTypes("mix:title", fooMixin1))
                          .val(new ForcedRoot().withPath("/foo2").withPrimaryType("nt:unstructured").withMixinTypes(fooMixin1))
                  )
                  .get());
          WebsterChecklistTarget target = WebsterChecklistTarget.fromJson(targetFile, obj()
                  .key("jcrNamespaces", nsList)
                  .key("selectors", arr()
                          .val(key("type", "nodetype").key("args", arr("mix:title")))
                          .val(key("type", "query").key("args", arr("select * from [nt:unstructured] as nun where issamenode([nun], '/foo2')"))))
                  .key("nodeTypeFilters", arr()
                          .val(new Rule(RuleType.INCLUDE, Pattern.compile("foo:mixin.*"))))
                  .key("exportNodeTypes", arr(fooMixin2))
                  .get());
          oak.build().adminInitAndInspect(target::perform);
          assertJsonFile(targetFile, json -> {
              final Checklist checklist = Checklist.fromJson("testFromJson", null, json);
              assertEquals("expect 2 roots", 2, checklist.getForcedRoots().size());
              assertEquals("expect root path", "/foo1", checklist.getForcedRoots().get(0).getPath());
              assertNull("expect no primary type", checklist.getForcedRoots().get(0).getPrimaryType());
              assertEquals("expect mixins", Collections.singletonList(fooMixin1),
                      checklist.getForcedRoots().get(0).getMixinTypes());
              assertEquals("expect root path", "/foo2", checklist.getForcedRoots().get(1).getPath());
              assertNull("expect no primary type", checklist.getForcedRoots().get(1).getPrimaryType());
              assertEquals("expect mixins", Collections.singletonList(fooMixin1),
                      checklist.getForcedRoots().get(1).getMixinTypes());
  
              assertEquals("two types were exported", 2, checklist.getJcrNodetypes().size());
              final NamePathResolver resolver = new DefaultNamePathResolver(JsonCnd.toNamespaceMapping(nsList));
              assertEquals("foo:mixin1 node type was exported", uncheck1(resolver::getQName).apply(fooMixin1),
                      checklist.getJcrNodetypes().get(0).getName());
              assertEquals("foo:mixin2 node type was exported", uncheck1(resolver::getQName).apply(fooMixin2),
                      checklist.getJcrNodetypes().get(1).getName());
          });
      }
test_case.class_method_signature: WebsterChecklistTargetTest.testFromJson_nodeTypeFilters()
test_case.full_signature: @Test public void testFromJson_nodeTypeFilters()
test_case.identifier: testFromJson_nodeTypeFilters
test_case.invocations: exists delete singletonList create fromPlan get key key key obj key key key obj key arr key arr key arr val val arr withMixinTypes withPrimaryType withPath withMixinTypes withPrimaryType withPath fromJson get key key key key obj val val arr key key arr key key arr val arr compile arr adminInitAndInspect build assertJsonFile fromJson assertEquals size getForcedRoots assertEquals getPath get getForcedRoots assertNull getPrimaryType get getForcedRoots assertEquals singletonList getMixinTypes get getForcedRoots assertEquals getPath get getForcedRoots assertNull getPrimaryType get getForcedRoots assertEquals singletonList getMixinTypes get getForcedRoots assertEquals size getJcrNodetypes toNamespaceMapping assertEquals apply uncheck1 getName get getJcrNodetypes assertEquals apply uncheck1 getName get getJcrNodetypes
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFromJson_nodeTypeFilters()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(WebsterChecklistTarget.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(WebsterChecklistTarget.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: KEY_TYPE = "type"
focal_class.modifier: static final
focal_class.original_string: static final String KEY_TYPE = "type";
focal_class.type: String
focal_class.var_name: KEY_TYPE
focal_class.declarator: KEY_ARGS = "args"
focal_class.modifier: static final
focal_class.original_string: static final String KEY_ARGS = "args";
focal_class.type: String
focal_class.var_name: KEY_ARGS
focal_class.declarator: COMPACT_KEY_BY_NODETYPES = "selectNodeTypes"
focal_class.modifier: static final
focal_class.original_string: static final String COMPACT_KEY_BY_NODETYPES = "selectNodeTypes";
focal_class.type: String
focal_class.var_name: COMPACT_KEY_BY_NODETYPES
focal_class.declarator: COMPACT_KEY_BY_PATHS = "selectPaths"
focal_class.modifier: static final
focal_class.original_string: static final String COMPACT_KEY_BY_PATHS = "selectPaths";
focal_class.type: String
focal_class.var_name: COMPACT_KEY_BY_PATHS
focal_class.declarator: COMPACT_KEY_BY_QUERY = "selectQuery"
focal_class.modifier: static final
focal_class.original_string: static final String COMPACT_KEY_BY_QUERY = "selectQuery";
focal_class.type: String
focal_class.var_name: COMPACT_KEY_BY_QUERY
focal_class.declarator: KEY_SELECTORS = "selectors"
focal_class.modifier: static final
focal_class.original_string: static final String KEY_SELECTORS = "selectors";
focal_class.type: String
focal_class.var_name: KEY_SELECTORS
focal_class.declarator: KEY_SCOPE_PATHS = "scopePaths"
focal_class.modifier: static final
focal_class.original_string: static final String KEY_SCOPE_PATHS = "scopePaths";
focal_class.type: String
focal_class.var_name: KEY_SCOPE_PATHS
focal_class.declarator: KEY_NODE_TYPE_FILTERS = "nodeTypeFilters"
focal_class.modifier: static final
focal_class.original_string: static final String KEY_NODE_TYPE_FILTERS = "nodeTypeFilters";
focal_class.type: String
focal_class.var_name: KEY_NODE_TYPE_FILTERS
focal_class.declarator: KEY_JCR_NAMESPACES = "jcrNamespaces"
focal_class.modifier: static final
focal_class.original_string: static final String KEY_JCR_NAMESPACES = "jcrNamespaces";
focal_class.type: String
focal_class.var_name: KEY_JCR_NAMESPACES
focal_class.declarator: KEY_UPDATE_POLICY = "updatePolicy"
focal_class.modifier: static final
focal_class.original_string: static final String KEY_UPDATE_POLICY = "updatePolicy";
focal_class.type: String
focal_class.var_name: KEY_UPDATE_POLICY
focal_class.declarator: KEY_EXPORT_NODETYPES = "exportNodeTypes"
focal_class.modifier: static final
focal_class.original_string: static final String KEY_EXPORT_NODETYPES = "exportNodeTypes";
focal_class.type: String
focal_class.var_name: KEY_EXPORT_NODETYPES
focal_class.declarator: checklist
focal_class.modifier: private final
focal_class.original_string: private final File checklist;
focal_class.type: File
focal_class.var_name: checklist
focal_class.declarator: exporter
focal_class.modifier: private final
focal_class.original_string: private final ChecklistExporter exporter;
focal_class.type: ChecklistExporter
focal_class.var_name: exporter
focal_class.declarator: updatePolicy
focal_class.modifier: private final
focal_class.original_string: private final ChecklistExporter.ForcedRootUpdatePolicy updatePolicy;
focal_class.type: ChecklistExporter.ForcedRootUpdatePolicy
focal_class.var_name: updatePolicy
focal_class.file: webster/src/main/java/net/adamcin/oakpal/webster/targets/WebsterChecklistTarget.java
focal_class.identifier: WebsterChecklistTarget
focal_class.interfaces: implements WebsterTarget
focal_class.class_method_signature: WebsterChecklistTarget.selectorFromJson(final JsonObject json)
focal_class.full_signature: static Selector selectorFromJson(final JsonObject json)
focal_class.identifier: selectorFromJson
focal_class.modifiers: static
focal_class.parameters: (final JsonObject json)
focal_class.return: Selector
focal_class.signature: Selector selectorFromJson(final JsonObject json)
focal_class.class_method_signature: WebsterChecklistTarget.selectorsFromConfigCompactForm(final JsonObject json)
focal_class.full_signature: static List<Selector> selectorsFromConfigCompactForm(final JsonObject json)
focal_class.identifier: selectorsFromConfigCompactForm
focal_class.modifiers: static
focal_class.parameters: (final JsonObject json)
focal_class.return: List<Selector>
focal_class.signature: List<Selector> selectorsFromConfigCompactForm(final JsonObject json)
focal_class.class_method_signature: WebsterChecklistTarget.WebsterChecklistTarget(final File checklist,
                                     final ChecklistExporter exporter,
                                     final ChecklistExporter.ForcedRootUpdatePolicy updatePolicy)
focal_class.full_signature: private  WebsterChecklistTarget(final File checklist,
                                     final ChecklistExporter exporter,
                                     final ChecklistExporter.ForcedRootUpdatePolicy updatePolicy)
focal_class.identifier: WebsterChecklistTarget
focal_class.modifiers: private
focal_class.parameters: (final File checklist,
                                     final ChecklistExporter exporter,
                                     final ChecklistExporter.ForcedRootUpdatePolicy updatePolicy)
focal_class.signature:  WebsterChecklistTarget(final File checklist,
                                     final ChecklistExporter exporter,
                                     final ChecklistExporter.ForcedRootUpdatePolicy updatePolicy)
focal_class.class_method_signature: WebsterChecklistTarget.perform(final Session session)
focal_class.full_signature: @Override public void perform(final Session session)
focal_class.identifier: perform
focal_class.modifiers: @Override public
focal_class.parameters: (final Session session)
focal_class.return: void
focal_class.signature: void perform(final Session session)
focal_class.class_method_signature: WebsterChecklistTarget.fromJson(final File target, final JsonObject config)
focal_class.full_signature: static WebsterChecklistTarget fromJson(final File target, final JsonObject config)
focal_class.identifier: fromJson
focal_class.modifiers: static
focal_class.parameters: (final File target, final JsonObject config)
focal_class.return: WebsterChecklistTarget
focal_class.signature: WebsterChecklistTarget fromJson(final File target, final JsonObject config)
focal_method.body: static WebsterChecklistTarget fromJson(final File target, final JsonObject config) {
          LOGGER.debug("[fromJson] fromJson: {}", config.toString());
          ChecklistExporter.Builder exporter = new ChecklistExporter.Builder();
          WebsterChecklistTarget.selectorsFromConfigCompactForm(config)
                  .forEach(selector -> selector.selectOnExporter(exporter));
          if (config.containsKey(KEY_SELECTORS)) {
              JsonArray ops = config.getJsonArray(KEY_SELECTORS);
              List<Selector> selectors = JavaxJson.mapArrayOfObjects(ops, WebsterChecklistTarget::selectorFromJson);
              selectors.forEach(selector -> selector.selectOnExporter(exporter));
          }
          if (config.containsKey(KEY_SCOPE_PATHS)) {
              List<Rule> scopePaths = Rules.fromJsonArray(config.getJsonArray(KEY_SCOPE_PATHS));
              exporter.withScopePaths(scopePaths);
          }
          if (config.containsKey(KEY_NODE_TYPE_FILTERS)) {
              List<Rule> nodeTypeFilters = Rules.fromJsonArray(config.getJsonArray(KEY_NODE_TYPE_FILTERS));
              exporter.withNodeTypeFilters(nodeTypeFilters);
          }
          if (config.containsKey(KEY_JCR_NAMESPACES)) {
              List<JcrNs> jcrNsList = JavaxJson.mapArrayOfObjects(config.getJsonArray(KEY_JCR_NAMESPACES),
                      JcrNs::fromJson);
              exporter.withJcrNamespaces(jcrNsList);
          }
          if (config.containsKey(KEY_EXPORT_NODETYPES)) {
              List<String> ntList = JavaxJson.mapArrayOfStrings(config.getJsonArray(KEY_EXPORT_NODETYPES));
              exporter.withExportNodeTypes(ntList);
          }
          ChecklistExporter.ForcedRootUpdatePolicy updatePolicy = null;
          if (config.containsKey(KEY_UPDATE_POLICY)) {
              updatePolicy = ChecklistExporter.ForcedRootUpdatePolicy.byName(config.getString(KEY_UPDATE_POLICY));
          }
          return new WebsterChecklistTarget(target, exporter.build(), updatePolicy);
      }
focal_method.class_method_signature: WebsterChecklistTarget.fromJson(final File target, final JsonObject config)
focal_method.full_signature: static WebsterChecklistTarget fromJson(final File target, final JsonObject config)
focal_method.identifier: fromJson
focal_method.invocations: debug toString forEach selectorsFromConfigCompactForm selectOnExporter containsKey getJsonArray mapArrayOfObjects forEach selectOnExporter containsKey fromJsonArray getJsonArray withScopePaths containsKey fromJsonArray getJsonArray withNodeTypeFilters containsKey mapArrayOfObjects getJsonArray withJcrNamespaces containsKey mapArrayOfStrings getJsonArray withExportNodeTypes containsKey byName getString build
focal_method.modifiers: static
focal_method.parameters: (final File target, final JsonObject config)
focal_method.return: WebsterChecklistTarget
focal_method.signature: WebsterChecklistTarget fromJson(final File target, final JsonObject config)