コード例 #1
0
  public void testFetchProject() throws Exception {
    JcrProductionDeployer deployer = getDeployer();
    DeployID id =
        deployer.deploy(
            new ADeploymentProject(new MockFolder("deployment project"), null),
            Collections.singletonList(project),
            getWorkspaceUser());

    File destDir = new File(TestHelper.FOLDER_TEST, "download");
    instance.fetchDeployment(id, destDir);

    File file1_2 = new File(destDir, PROJECT_NAME + "/" + FOLDER1 + "/" + FILE1_2);
    assertEquals(20L, file1_2.length());
  }
コード例 #2
0
  public void testFetchRedeployedProject() throws Exception {
    JcrProductionDeployer deployer = getDeployer();
    deployer.deploy(
        new ADeploymentProject(new MockFolder("deployment project"), null),
        Collections.singletonList(makeProject2()),
        getWorkspaceUser());

    File destDir = new File(TestHelper.FOLDER_TEST);
    TestHelper.clearDirectory(destDir);

    try {
      deployer.deploy(
          new ADeploymentProject(new MockFolder("deployment project"), null),
          Collections.singletonList(makeProject2()),
          getWorkspaceUser());
      fail("exception expected");
    } catch (DeploymentException e) {
      // ok
    }
  }