コード例 #1
0
ファイル: WagonTestCase.java プロジェクト: apache/maven-wagon
  /**
   * Test for an invalid resource.
   *
   * @throws Exception
   * @since 1.0-beta-2
   */
  public void testWagonResourceNotExists() throws Exception {
    setupRepositories();

    setupWagonTestingFixtures();

    Wagon wagon = getWagon();

    wagon.connect(testRepository, getAuthInfo());

    assertFalse(wagon.resourceExists("a/bad/resource/name/that/should/not/exist.txt"));

    wagon.disconnect();

    tearDownWagonTestingFixtures();
  }
コード例 #2
0
ファイル: WagonTestCase.java プロジェクト: apache/maven-wagon
  /**
   * Test for an existing resource.
   *
   * @throws Exception
   * @since 1.0-beta-2
   */
  public void testWagonResourceExists() throws Exception {
    setupRepositories();

    setupWagonTestingFixtures();

    Wagon wagon = getWagon();

    putFile();

    wagon.connect(testRepository, getAuthInfo());

    assertTrue(
        sourceFile.getName() + " does not exist", wagon.resourceExists(sourceFile.getName()));

    wagon.disconnect();

    tearDownWagonTestingFixtures();
  }