Exemplo n.º 1
0
  /**
   * 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();
  }
Exemplo n.º 2
0
  /**
   * 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();
  }