org.apache.maven.it
Class MavenITmng3415JunkRepositoryMetadataTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.maven.it.AbstractMavenIntegrationTestCase
              extended by org.apache.maven.it.MavenITmng3415JunkRepositoryMetadataTest
All Implemented Interfaces:
Test

public class MavenITmng3415JunkRepositoryMetadataTest
extends AbstractMavenIntegrationTestCase

This is a test set for MNG-3415.

Version:
$Id: MavenITmng3415JunkRepositoryMetadataTest.java 1165035 2011-09-04 14:40:36Z hboutemy $

Field Summary
 
Fields inherited from class org.apache.maven.it.AbstractMavenIntegrationTestCase
ALL_MAVEN_VERSIONS
 
Constructor Summary
MavenITmng3415JunkRepositoryMetadataTest()
           
 
Method Summary
 void testitTransferFailed()
          This test simply verifies that when a metadata transfer fails (network error, etc.)
 void testShouldNotRepeatedlyUpdateOnResourceNotFoundException()
          This test simply verifies that when metadata doesn't exist on the remote repository, a basic metadata file is written to the local repository.
 
Methods inherited from class org.apache.maven.it.AbstractMavenIntegrationTestCase
matchesVersionRange, newVerifier, newVerifier, newVerifier, newVerifier, requiresJavaVersion, requiresMavenVersion, runTest, setupLocalRepo
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MavenITmng3415JunkRepositoryMetadataTest

public MavenITmng3415JunkRepositoryMetadataTest()
Method Detail

testitTransferFailed

public void testitTransferFailed()
                          throws Exception
This test simply verifies that when a metadata transfer fails (network error, etc.) no metadata file is written to the local repository. Steps executed to verify this test: 0. Find the local repository directory: a. build the maven-find-local-repo-plugin, then run it, to spit out the path of the local repository in use by default. Read the output file to get this path. (Yes, it's heavy, but it's reliable.) 1. Setup the test: a. Make sure the metadata for the test-repo is NOT in the local repository. b. Make sure the dependency POM IS in the local repository, so we're not distracted by failed builds that are unrelated. c. Create the settings file for use in this test, which contains the invalid remote repository entry. 2. Build the test project the first time a. Verify that a TransferFailedException is in the build output for the test-repo b. Verify that the metadata for the dependency POM is NOT in the local repository afterwards. 3. Build the test project the second time a. See (2.a) and (2.b) above; the same criteria applies here.

Throws:
Exception

testShouldNotRepeatedlyUpdateOnResourceNotFoundException

public void testShouldNotRepeatedlyUpdateOnResourceNotFoundException()
                                                              throws Exception
This test simply verifies that when metadata doesn't exist on the remote repository, a basic metadata file is written to the local repository. Steps executed to verify this test: 0. Find the local repository directory: a. build the maven-find-local-repo-plugin, then run it, to spit out the path of the local repository in use by default. Read the output file to get this path. (Yes, it's heavy, but it's reliable.) 1. Setup the test: a. Make sure the metadata for the test-repo is NOT in the local repository. b. Make sure the dependency POM IS in the local repository, so we're not distracted by failed builds that are unrelated. c. Create the settings file for use in this test, which contains the VALID remote repository entry. 2. Build the test project the first time a. Verify that the remote repository is checked for the metadata file 3. Build the test project the second time a. Verify that the remote repository is NOT checked for the metadata file again b. Verify that the file used for updateInterval calculations was NOT changed from the first build.

Throws:
Exception


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.