org.apache.maven.wagon.http
Class HttpWagonTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.codehaus.plexus.PlexusTestCase
              extended by org.apache.maven.wagon.WagonTestCase
                  extended by org.apache.maven.wagon.StreamingWagonTestCase
                      extended by org.apache.maven.wagon.http.HttpWagonTestCase
All Implemented Interfaces:
Test

public abstract class HttpWagonTestCase
extends StreamingWagonTestCase

Version:
$Id: LightweightHttpWagonTest.java 680764 2008-07-29 16:45:51Z brett $

Nested Class Summary
static class HttpWagonTestCase.SecurityHandlerRequestReponse
           
static class HttpWagonTestCase.TestSecurityHandler
           
 
Field Summary
 
Fields inherited from class org.apache.maven.wagon.WagonTestCase
artifactDestFile, artifactSourceFile, checksumObserver, destFile, localRepository, localRepositoryPath, logger, mockTransferListener, mockTransferListenerControl, POM, resource, sourceFile, testRepository
 
Constructor Summary
HttpWagonTestCase()
           
 
Method Summary
protected  void addConnectors(org.mortbay.jetty.Server server)
           
protected  void createContext(org.mortbay.jetty.Server server, File repositoryDirectory)
           
protected  HttpWagonTestCase.TestSecurityHandler createSecurityHandler()
           
protected  long getExpectedLastModifiedOnGet(Repository repository, Resource resource)
           
protected  File getRepositoryDirectory()
           
protected  String getRepositoryUrl(org.mortbay.jetty.Server server)
           
protected  int getTestRepositoryPort()
          The number of the port which should get used to start the test server
 void runTestSecuredGet(AuthenticationInfo authInfo)
           
 void runTestSecuredPut(AuthenticationInfo authInfo)
           
 void runTestSecuredPut(AuthenticationInfo authInfo, int putNumber)
           
 void runTestSecuredResourceExists(AuthenticationInfo authInfo)
           
protected abstract  void setHttpHeaders(StreamingWagon wagon, Properties properties)
           
protected  void setupWagonTestingFixtures()
           
protected abstract  boolean supportPreemptiveAuthentication()
           
protected  void tearDownWagonTestingFixtures()
           
 void testGet404()
           
 void testGet500()
           
 void testGetForbidden()
           
 void testGzipGet()
           
 void testHttpHeaders()
           
 void testHttpHeadersWithCommonMethods()
          test set of User-Agent as it's done by aether wagon connector with using setHttpHeaders
protected  void testPreemptiveAuthentication(HttpWagonTestCase.TestSecurityHandler sh)
           
 void testProxiedRequest()
           
 void testProxiedRequestWithAuthentication()
           
 void testPut404()
           
 void testPut500()
           
 void testPutForbidden()
           
 void testResourceExists404()
           
 void testResourceExists500()
           
 void testResourceExistsForbidden()
           
 void testSecuredGet()
           
 void testSecuredGetUnauthorized()
           
 void testSecuredGetWrongPassword()
           
 void testSecuredPut()
           
 void testSecuredPutUnauthorized()
           
 void testSecuredPutWrongPassword()
           
 void testSecuredResourceExists()
           
 void testSecuredResourceExistsUnauthorized()
           
 void testSecuredResourceExistsWrongPassword()
           
 void testWagonGetFileList()
          Test Wagon.getFileList(String).
 
Methods inherited from class org.apache.maven.wagon.StreamingWagonTestCase
streamRoundTripTesting, testFailedGetIfNewerToStream, testFailedGetToStream, testStreamingWagon, testWagonGetIfNewerToStreamIsNewer, testWagonGetIfNewerToStreamIsOlder, testWagonGetIfNewerToStreamIsSame
 
Methods inherited from class org.apache.maven.wagon.WagonTestCase
assertGetIfNewerTest, assertNotExists, assertResourcesAreInRemoteSide, connectWagon, createDirectory, createFileRepository, createTransferEvent, customizeContext, disconnectWagon, fileRoundTripTesting, getAuthInfo, getExpectedContentLengthOnGet, getFile, getPermissions, getProtocol, getTestRepositoryUrl, getWagon, message, putFile, putFile, replaceMockForGet, replayMockForPut, setUp, setupGetIfNewerTest, setupRepositories, supportsGetIfNewer, testFailedGet, testFailedGetIfNewer, testWagon, testWagonGetFileListWhenDirectoryDoesNotExist, testWagonGetIfNewerIsNewer, testWagonGetIfNewerIsOlder, testWagonGetIfNewerIsSame, testWagonPutDirectory, testWagonPutDirectoryDeepDestination, testWagonPutDirectoryForDot, testWagonPutDirectoryWhenDirectoryAlreadyExists, testWagonResourceExists, testWagonResourceNotExists, verifyMock
 
Methods inherited from class org.codehaus.plexus.PlexusTestCase
customizeComponentConfiguration, customizeContainerConfiguration, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getConfigurationName, getContainer, getCustomConfigurationName, getResourceAsStream, getTestConfiguration, getTestConfiguration, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, lookup, lookup, release, setupContainer, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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

HttpWagonTestCase

public HttpWagonTestCase()
Method Detail

setupWagonTestingFixtures

protected void setupWagonTestingFixtures()
                                  throws Exception
Overrides:
setupWagonTestingFixtures in class WagonTestCase
Throws:
Exception

getTestRepositoryPort

protected final int getTestRepositoryPort()
Description copied from class: WagonTestCase
The number of the port which should get used to start the test server

Specified by:
getTestRepositoryPort in class WagonTestCase
Returns:
the port number for the test server

createContext

protected void createContext(org.mortbay.jetty.Server server,
                             File repositoryDirectory)
                      throws IOException
Throws:
IOException

tearDownWagonTestingFixtures

protected void tearDownWagonTestingFixtures()
                                     throws Exception
Overrides:
tearDownWagonTestingFixtures in class WagonTestCase
Throws:
Exception

testWagonGetFileList

public void testWagonGetFileList()
                          throws Exception
Description copied from class: WagonTestCase
Test Wagon.getFileList(String).

Overrides:
testWagonGetFileList in class WagonTestCase
Throws:
Exception

testHttpHeaders

public void testHttpHeaders()
                     throws Exception
Throws:
Exception

testHttpHeadersWithCommonMethods

public void testHttpHeadersWithCommonMethods()
                                      throws Exception
test set of User-Agent as it's done by aether wagon connector with using setHttpHeaders

Throws:
Exception

setHttpHeaders

protected abstract void setHttpHeaders(StreamingWagon wagon,
                                       Properties properties)

addConnectors

protected void addConnectors(org.mortbay.jetty.Server server)

getRepositoryUrl

protected String getRepositoryUrl(org.mortbay.jetty.Server server)

testGetForbidden

public void testGetForbidden()
                      throws Exception
Throws:
Exception

testGet404

public void testGet404()
                throws Exception
Throws:
Exception

testGet500

public void testGet500()
                throws Exception
Throws:
Exception

testResourceExistsForbidden

public void testResourceExistsForbidden()
                                 throws Exception
Throws:
Exception

testResourceExists404

public void testResourceExists404()
                           throws Exception
Throws:
Exception

testResourceExists500

public void testResourceExists500()
                           throws Exception
Throws:
Exception

getExpectedLastModifiedOnGet

protected long getExpectedLastModifiedOnGet(Repository repository,
                                            Resource resource)
Overrides:
getExpectedLastModifiedOnGet in class WagonTestCase

getRepositoryDirectory

protected File getRepositoryDirectory()

testGzipGet

public void testGzipGet()
                 throws Exception
Throws:
Exception

testProxiedRequest

public void testProxiedRequest()
                        throws Exception
Throws:
Exception

testProxiedRequestWithAuthentication

public void testProxiedRequestWithAuthentication()
                                          throws Exception
Throws:
Exception

testSecuredGetUnauthorized

public void testSecuredGetUnauthorized()
                                throws Exception
Throws:
Exception

testSecuredGetWrongPassword

public void testSecuredGetWrongPassword()
                                 throws Exception
Throws:
Exception

testSecuredGet

public void testSecuredGet()
                    throws Exception
Throws:
Exception

runTestSecuredGet

public void runTestSecuredGet(AuthenticationInfo authInfo)
                       throws Exception
Throws:
Exception

testSecuredResourceExistsUnauthorized

public void testSecuredResourceExistsUnauthorized()
                                           throws Exception
Throws:
Exception

testSecuredResourceExistsWrongPassword

public void testSecuredResourceExistsWrongPassword()
                                            throws Exception
Throws:
Exception

testSecuredResourceExists

public void testSecuredResourceExists()
                               throws Exception
Throws:
Exception

runTestSecuredResourceExists

public void runTestSecuredResourceExists(AuthenticationInfo authInfo)
                                  throws Exception
Throws:
Exception

testPutForbidden

public void testPutForbidden()
                      throws Exception
Throws:
Exception

testPut404

public void testPut404()
                throws Exception
Throws:
Exception

testPut500

public void testPut500()
                throws Exception
Throws:
Exception

testSecuredPutUnauthorized

public void testSecuredPutUnauthorized()
                                throws Exception
Throws:
Exception

testSecuredPutWrongPassword

public void testSecuredPutWrongPassword()
                                 throws Exception
Throws:
Exception

testSecuredPut

public void testSecuredPut()
                    throws Exception
Throws:
Exception

runTestSecuredPut

public void runTestSecuredPut(AuthenticationInfo authInfo)
                       throws Exception
Throws:
Exception

runTestSecuredPut

public void runTestSecuredPut(AuthenticationInfo authInfo,
                              int putNumber)
                       throws Exception
Throws:
Exception

supportPreemptiveAuthentication

protected abstract boolean supportPreemptiveAuthentication()

testPreemptiveAuthentication

protected void testPreemptiveAuthentication(HttpWagonTestCase.TestSecurityHandler sh)

createSecurityHandler

protected HttpWagonTestCase.TestSecurityHandler createSecurityHandler()


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.