您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

RemoteDeleteCommandTest.java 1.1KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (C) 2015, Kaloyan Raev <kaloyan.r@zend.com> and others
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.api;
  11. import static org.junit.Assert.assertTrue;
  12. import org.eclipse.jgit.transport.RemoteConfig;
  13. import org.junit.Test;
  14. public class RemoteDeleteCommandTest extends AbstractRemoteCommandTest {
  15. @Test
  16. public void testDelete() throws Exception {
  17. // setup an initial remote
  18. RemoteConfig remoteConfig = setupRemote();
  19. // execute the command to remove the remote
  20. RemoteRemoveCommand cmd = Git.wrap(db).remoteRemove();
  21. cmd.setRemoteName(REMOTE_NAME);
  22. RemoteConfig remote = cmd.call();
  23. // assert that the removed remote is the initial remote
  24. assertRemoteConfigEquals(remoteConfig, remote);
  25. // assert that there are no remotes left
  26. assertTrue(RemoteConfig.getAllRemoteConfigs(db.getConfig()).isEmpty());
  27. }
  28. }