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()); }
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 } }