@Test
  public void test() {
    PropertiesMap options = new LinkedPropertiesMap();

    resolveAndAssert("1.1.1.foo", "1.1.1.foo", options);
    resolveAndAssert("1.1.1", "1.1.1", options);

    options.put("osgifier.forceContextQualifier", "murks");

    resolveAndAssert("1.1.1.foo", "1.1.1.murks", options);
    resolveAndAssert("1.1.1", "1.1.1.murks", options);
  }
  private String applyGroupIdMapping(final String symbolicName) {
    for (Entry<String, String> entry : groupIdMappings.entrySet()) {
      final PathMatcher matcher = PathMatcher.parsePackagePatterns(entry.getKey());
      if (matcher.isMatch(symbolicName)) {
        PropertiesMap props = new LinkedPropertiesMap(1);
        props.put("bundle.groupId", deriveGroupId(symbolicName));
        props.put("bundle.symbolicName", symbolicName);

        return interpolate(props, entry.getValue());
      }
    }
    return null;
  }
Esempio n. 3
0
  @Test
  public void testModule_With_Custom_Ant_Targets() throws Exception {
    execute();

    final File projectDir = getExampleProjectDir();

    PropertiesMap testProperties = new LinkedPropertiesMap();
    testProperties.load(new File(projectDir, "target/test.properties"));
    assertEquals("generate-resources", testProperties.get("maven.phase"));

    testProperties = new LinkedPropertiesMap();
    testProperties.load(
        new File(projectDir, "org.sourcepit.b2.examples.simple.module/target/test.properties"));
    assertEquals("generate-resources", testProperties.get("maven.phase"));

    testProperties = new LinkedPropertiesMap();
    testProperties.load(
        new File(
            projectDir, "org.sourcepit.b2.examples.simple.module.tests/target/test.properties"));
    assertEquals("generate-test-resources", testProperties.get("maven.phase"));
  }