コード例 #1
0
  @Test
  public void testRepository() throws Exception {
    String url = server.addServer("foo", new File("repositories/e342"));

    Verifier verifier =
        getVerifier(
            "/TYCHO319passwordProtectedP2Repository",
            false,
            new File("projects/TYCHO319passwordProtectedP2Repository/settings.xml"));
    verifier.getCliOptions().add("-P=repository");
    verifier.executeGoals(Arrays.asList("package", "-Dp2.repo=" + url));
    verifier.verifyErrorFreeLog();
  }
コード例 #2
0
  @Test
  public void testTargetDefinition() throws Exception {
    String url = server.addServer("foo", new File("repositories/e342"));

    Verifier verifier =
        getVerifier(
            "/TYCHO319passwordProtectedP2Repository",
            false,
            new File("projects/TYCHO319passwordProtectedP2Repository/settings.xml"));

    File platformFile = new File(verifier.getBasedir(), "platform.target");
    Target platform = Target.read(platformFile);
    platform.getLocations().get(0).setRepositoryLocation(url);
    Target.write(platform, platformFile);

    verifier.getCliOptions().add("-P=target-definition");
    verifier.executeGoals(Arrays.asList("package", "-Dp2.repo=" + url));
    verifier.verifyErrorFreeLog();
  }