@Test
public void testResolve_ServicePackageFolder() throws Exception {

  String servicePackageFolder = "packageDir";
  // specified in child only
  ServiceInfo info = new ServiceInfo();
  ServiceInfo parentInfo = new ServiceInfo();
  ServiceModule child = createServiceModule(info);
  ServiceModule parent = createServiceModule(parentInfo);
  // set in the module constructor from a value obtained from service directory
  assertEquals("packageDir", child.getModuleInfo().getServicePackageFolder());
  parent.getModuleInfo().setServicePackageFolder(null);
  resolveService(child, parent);
  assertEquals(servicePackageFolder, child.getModuleInfo().getServicePackageFolder());
  // specified in parent only
  child = createServiceModule(info);
  parent = createServiceModule(parentInfo);
  parent.getModuleInfo().setServicePackageFolder(servicePackageFolder);
  child.getModuleInfo().setServicePackageFolder(null);
  resolveService(child, parent);
  assertEquals(servicePackageFolder, child.getModuleInfo().getServicePackageFolder());
  // specified in both
  child = createServiceModule(info);
  parent = createServiceModule(parentInfo);
  parent.getModuleInfo().setServicePackageFolder("someOtherDir");
  child.getModuleInfo().setServicePackageFolder(servicePackageFolder);
  resolveService(child, parent);
  assertEquals(servicePackageFolder, child.getModuleInfo().getServicePackageFolder());
}