test_class.declarator: context = new OsgiContext()
test_class.modifier: @Rule
      public final
test_class.original_string: @Rule
      public final OsgiContext context = new OsgiContext();
test_class.type: OsgiContext
test_class.var_name: context
test_class.declarator: service = new MountInfoProviderService()
test_class.modifier: private
test_class.original_string: private MountInfoProviderService service = new MountInfoProviderService();
test_class.type: MountInfoProviderService
test_class.var_name: service
test_class.file: oak-store-composite/src/test/java/org/apache/jackrabbit/oak/composite/MountInfoProviderServiceTest.java
test_class.identifier: MountInfoProviderServiceTest
test_case.body: @Test
      public void mountWithConfig_Paths() throws Exception{
          MockOsgi.activate(service, context.bundleContext(),
                  ImmutableMap.<String, Object>of("mountedPaths", new String[] {"/a", "/b"}));
  
          MountInfoProvider provider = context.getService(MountInfoProvider.class);
          assertEquals(1, provider.getNonDefaultMounts().size());
  
          Mount m = provider.getMountByName(MountInfoProviderService.PROP_MOUNT_NAME_DEFAULT);
          assertNotNull(m);
          Mount defMount = provider.getDefaultMount();
          assertNotNull(defMount);
          assertFalse(m.isReadOnly());
          assertEquals(m, provider.getMountByPath("/a"));
          assertEquals(defMount, provider.getMountByPath("/x"));
      }
test_case.class_method_signature: MountInfoProviderServiceTest.mountWithConfig_Paths()
test_case.full_signature: @Test public void mountWithConfig_Paths()
test_case.identifier: mountWithConfig_Paths
test_case.invocations: activate bundleContext of getService assertEquals size getNonDefaultMounts getMountByName assertNotNull getDefaultMount assertNotNull assertFalse isReadOnly assertEquals getMountByPath assertEquals getMountByPath
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void mountWithConfig_Paths()
focal_class.declarator: PROP_MOUNT_PATHS = "mountedPaths"
focal_class.modifier: @Property(label = "Mounted paths",
              unbounded = PropertyUnbounded.ARRAY,
              description = "Paths which are part of private mount"
      )
      private static final
focal_class.original_string: @Property(label = "Mounted paths",
              unbounded = PropertyUnbounded.ARRAY,
              description = "Paths which are part of private mount"
      )
      private static final String PROP_MOUNT_PATHS = "mountedPaths";
focal_class.type: String
focal_class.var_name: PROP_MOUNT_PATHS
focal_class.declarator: PROP_MOUNT_NAME_DEFAULT = "private"
focal_class.modifier: static final
focal_class.original_string: static final String PROP_MOUNT_NAME_DEFAULT = "private";
focal_class.type: String
focal_class.var_name: PROP_MOUNT_NAME_DEFAULT
focal_class.declarator: PROP_MOUNT_NAME = "mountName"
focal_class.modifier: @Property(label = "Mount name",
              description = "Name of the mount",
              value = PROP_MOUNT_NAME_DEFAULT
      )
      private static final
focal_class.original_string: @Property(label = "Mount name",
              description = "Name of the mount",
              value = PROP_MOUNT_NAME_DEFAULT
      )
      private static final String PROP_MOUNT_NAME = "mountName";
focal_class.type: String
focal_class.var_name: PROP_MOUNT_NAME
focal_class.declarator: PROP_MOUNT_READONLY_DEFAULT = false
focal_class.modifier: private static final
focal_class.original_string: private static final boolean PROP_MOUNT_READONLY_DEFAULT = false;
focal_class.type: boolean
focal_class.var_name: PROP_MOUNT_READONLY_DEFAULT
focal_class.declarator: PROP_MOUNT_READONLY = "readOnlyMount"
focal_class.modifier: @Property(label = "Readonly",
              description = "If enabled then mount would be considered as readonly",
              boolValue = PROP_MOUNT_READONLY_DEFAULT
      )
      private static final
focal_class.original_string: @Property(label = "Readonly",
              description = "If enabled then mount would be considered as readonly",
              boolValue = PROP_MOUNT_READONLY_DEFAULT
      )
      private static final String PROP_MOUNT_READONLY = "readOnlyMount";
focal_class.type: String
focal_class.var_name: PROP_MOUNT_READONLY
focal_class.declarator: PROP_PATHS_SUPPORTING_FRAGMENTS_DEFAULT = new String[] {"/"}
focal_class.modifier: private static final
focal_class.original_string: private static final String[] PROP_PATHS_SUPPORTING_FRAGMENTS_DEFAULT = new String[] {"/"};
focal_class.type: String[]
focal_class.var_name: PROP_PATHS_SUPPORTING_FRAGMENTS_DEFAULT
focal_class.declarator: PROP_PATHS_SUPPORTING_FRAGMENTS = "pathsSupportingFragments"
focal_class.modifier: @Property(label = "Paths supporting fragments",
              unbounded = PropertyUnbounded.ARRAY,
              description = "oak:mount-* under this paths will be included to mounts",
              value = {"/"}
      )
      private static final
focal_class.original_string: @Property(label = "Paths supporting fragments",
              unbounded = PropertyUnbounded.ARRAY,
              description = "oak:mount-* under this paths will be included to mounts",
              value = {"/"}
      )
      private static final String PROP_PATHS_SUPPORTING_FRAGMENTS = "pathsSupportingFragments";
focal_class.type: String
focal_class.var_name: PROP_PATHS_SUPPORTING_FRAGMENTS
focal_class.declarator: log = LoggerFactory.getLogger(getClass())
focal_class.modifier: private final
focal_class.original_string: private final Logger log = LoggerFactory.getLogger(getClass());
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: reg
focal_class.modifier: private
focal_class.original_string: private ServiceRegistration reg;
focal_class.type: ServiceRegistration
focal_class.var_name: reg
focal_class.file: oak-store-composite/src/main/java/org/apache/jackrabbit/oak/composite/MountInfoProviderService.java
focal_class.identifier: MountInfoProviderService
focal_class.class_method_signature: MountInfoProviderService.activate(BundleContext bundleContext, Map<String, ?> config)
focal_class.full_signature: @Activate private void activate(BundleContext bundleContext, Map<String, ?> config)
focal_class.identifier: activate
focal_class.modifiers: @Activate private
focal_class.parameters: (BundleContext bundleContext, Map<String, ?> config)
focal_class.return: void
focal_class.signature: void activate(BundleContext bundleContext, Map<String, ?> config)
focal_class.class_method_signature: MountInfoProviderService.trim(String[] array)
focal_class.full_signature: private static List<String> trim(String[] array)
focal_class.identifier: trim
focal_class.modifiers: private static
focal_class.parameters: (String[] array)
focal_class.return: List<String>
focal_class.signature: List<String> trim(String[] array)
focal_class.class_method_signature: MountInfoProviderService.deactivate()
focal_class.full_signature: @Deactivate private void deactivate()
focal_class.identifier: deactivate
focal_class.modifiers: @Deactivate private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void deactivate()
focal_method.body: @Activate
      private void activate(BundleContext bundleContext, Map<String, ?> config) {
          String[] paths = PropertiesUtil.toStringArray(config.get(PROP_MOUNT_PATHS));
          String mountName = PropertiesUtil.toString(config.get(PROP_MOUNT_NAME), PROP_MOUNT_NAME_DEFAULT);
          boolean readOnly = PropertiesUtil.toBoolean(config.get(PROP_MOUNT_READONLY), PROP_MOUNT_READONLY_DEFAULT);
          String[] pathsSupportingFragments = PropertiesUtil.toStringArray(config.get(PROP_PATHS_SUPPORTING_FRAGMENTS), PROP_PATHS_SUPPORTING_FRAGMENTS_DEFAULT);
  
          MountInfoProvider mip = Mounts.defaultMountInfoProvider();
          if (paths != null) {
              mip = Mounts.newBuilder()
                      .mount(mountName.trim(), readOnly, trim(pathsSupportingFragments), trim(paths))
                      .build();
              log.info("Enabling mount for {}", mip);
          } else {
              log.info("No mount config provided. Mounting would be disabled");
          }
  
          reg = bundleContext.registerService(MountInfoProvider.class.getName(), mip, null);
      }
focal_method.class_method_signature: MountInfoProviderService.activate(BundleContext bundleContext, Map<String, ?> config)
focal_method.full_signature: @Activate private void activate(BundleContext bundleContext, Map<String, ?> config)
focal_method.identifier: activate
focal_method.invocations: toStringArray get toString get toBoolean get toStringArray get defaultMountInfoProvider build mount newBuilder trim trim trim info info registerService getName
focal_method.modifiers: @Activate private
focal_method.parameters: (BundleContext bundleContext, Map<String, ?> config)
focal_method.return: void
focal_method.signature: void activate(BundleContext bundleContext, Map<String, ?> config)