Beispiel #1
0
 public void testSymlink() throws Exception {
   Executor executor = new TestExecutorBuilder(directories, null).build();
   action.execute(new ActionExecutionContext(executor, null, null, null, null));
   assertTrue(output.isSymbolicLink());
   assertEquals(input, output.resolveSymbolicLinks());
   assertEquals(inputArtifact, action.getPrimaryInput());
   assertEquals(outputArtifact, action.getPrimaryOutput());
 }
Beispiel #2
0
 public void testExecutableSymlink() throws Exception {
   Executor executor = new TestExecutorBuilder(directories, null).build();
   outputArtifact = getBinArtifactWithNoOwner("destination2.txt");
   output = outputArtifact.getPath();
   action = new ExecutableSymlinkAction(NULL_ACTION_OWNER, inputArtifact, outputArtifact);
   assertFalse(input.isExecutable());
   ActionExecutionContext actionExecutionContext =
       new ActionExecutionContext(executor, null, null, null, null);
   try {
     action.execute(actionExecutionContext);
     fail("Expected ActionExecutionException");
   } catch (ActionExecutionException e) {
     MoreAsserts.assertContainsRegex("'input.txt' is not executable", e.getMessage());
   }
   input.setExecutable(true);
   action.execute(actionExecutionContext);
   assertTrue(output.isSymbolicLink());
   assertEquals(input, output.resolveSymbolicLinks());
 }