Exemplo n.º 1
0
 public SVNMoveClient createMoveClient() {
   final SVNMoveClient client =
       new SVNMoveClient(getPool(), myConfiguration.getOptions(myProject));
   client
       .getOperationsFactory()
       .setAuthenticationManager(myConfiguration.getAuthenticationManager(this));
   return client;
 }
Exemplo n.º 2
0
  @Test
  public void testMoveFileOutOfVersionControl() throws Exception {
    // SVNKIT-295
    final TestOptions options = TestOptions.getInstance();

    final SvnOperationFactory svnOperationFactory = new SvnOperationFactory();
    final Sandbox sandbox =
        Sandbox.createWithCleanup(getTestName() + ".testMoveFileOutOfVersionControl", options);
    try {
      final SVNURL url = sandbox.createSvnRepository();

      final CommitBuilder commitBuilder = new CommitBuilder(url);
      commitBuilder.addFile("file");
      commitBuilder.commit();

      final WorkingCopy workingCopy = sandbox.checkoutNewWorkingCopy(url);
      final File file = workingCopy.getFile("file");

      final File unversionedDirectory = workingCopy.getFile("unversionedDirectory");
      final File targetFile = new File(unversionedDirectory, "file");

      final SVNClientManager clientManager = SVNClientManager.newInstance();
      try {
        final SVNMoveClient moveClient = clientManager.getMoveClient();
        moveClient.doMove(file, targetFile);

        final Map<File, SvnStatus> statuses =
            TestUtil.getStatuses(svnOperationFactory, workingCopy.getWorkingCopyDirectory());
        Assert.assertEquals(SVNStatusType.STATUS_DELETED, statuses.get(file).getNodeStatus());
        Assert.assertEquals(
            SVNStatusType.STATUS_UNVERSIONED, statuses.get(unversionedDirectory).getNodeStatus());
        Assert.assertNull(statuses.get(targetFile));
      } finally {
        clientManager.dispose();
      }
    } finally {
      svnOperationFactory.dispose();
      sandbox.dispose();
    }
  }