public abstract class HttpWagonTestCase extends StreamingWagonTestCase
Modifier and Type | Class and Description |
---|---|
static class |
HttpWagonTestCase.HandlerRequestResponse |
static class |
HttpWagonTestCase.PutHandler |
static class |
HttpWagonTestCase.RedirectHandler |
static class |
HttpWagonTestCase.TestSecurityHandler |
Modifier and Type | Field and Description |
---|---|
static int |
SC_TOO_MANY_REQUESTS |
artifactDestFile, artifactSourceFile, checksumObserver, destFile, localRepository, localRepositoryPath, logger, mockTransferListener, POM, resource, sourceFile, TEST_CKSUM, TEST_CONTENT, testRepository, testSkipped
Constructor and Description |
---|
HttpWagonTestCase() |
streamRoundTripTesting, testFailedGetIfNewerToStream, testFailedGetToStream, testStreamingWagon, testWagonGetIfNewerToStreamIsNewer, testWagonGetIfNewerToStreamIsOlder, testWagonGetIfNewerToStreamIsSame
assertGetIfNewerTest, assertNotExists, assertOnTransferProgress, assertResourcesAreInRemoteSide, cksum, connectWagon, createDirectory, createFileRepository, createTransferEvent, customizeContext, disconnectWagon, fileRoundTripTesting, getAuthInfo, getExpectedContentLengthOnGet, getFile, getPermissions, getProtocol, getTestRepositoryUrl, getWagon, isSystemCmd, message, putFile, putFile, replaceMockForGet, replayMockForPut, runTest, setUp, setupGetIfNewerTest, setupRepositories, supportsGetIfNewer, testFailedGet, testFailedGetIfNewer, testWagon, testWagonGetFileList, testWagonGetFileListWhenDirectoryDoesNotExist, testWagonGetIfNewerIsNewer, testWagonGetIfNewerIsOlder, testWagonGetIfNewerIsSame, testWagonPutDirectory, testWagonPutDirectoryDeepDestination, testWagonPutDirectoryForDot, testWagonPutDirectoryWhenDirectoryAlreadyExists, testWagonResourceExists, testWagonResourceNotExists, verifyMock
customizeComponentConfiguration, customizeContainerConfiguration, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getConfigurationName, getContainer, getCustomConfigurationName, getResourceAsStream, getTestConfiguration, getTestConfiguration, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, lookup, lookup, release, setupContainer, tearDown
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, setName, toString
public static final int SC_TOO_MANY_REQUESTS
public HttpWagonTestCase()
protected int getLocalPort(org.eclipse.jetty.server.Server server)
protected void setupWagonTestingFixtures() throws Exception
setupWagonTestingFixtures
in class WagonTestCase
Exception
protected final int getTestRepositoryPort()
protected org.eclipse.jetty.servlet.ServletContextHandler createContext(org.eclipse.jetty.server.Server server, File repositoryDirectory) throws IOException
IOException
protected void tearDownWagonTestingFixtures() throws Exception
tearDownWagonTestingFixtures
in class WagonTestCase
Exception
public void testHttpHeaders() throws Exception
Exception
public void testHttpHeadersWithCommonMethods() throws Exception
Exception
public void testUserAgentHeaderIsPresentByDefault() throws Exception
Exception
public void testUserAgentHeaderIsPresentOnlyOnceIfSetMultipleTimes() throws Exception
Exception
protected abstract void setHttpConfiguration(StreamingWagon wagon, Properties headers, Properties params)
protected org.eclipse.jetty.server.ServerConnector addConnector(org.eclipse.jetty.server.Server server)
protected String getRepositoryUrl(org.eclipse.jetty.server.Server server)
public void testGetForbidden() throws Exception
Exception
public void testGet404() throws Exception
Exception
public void testGet500() throws Exception
Exception
public void testResourceExistsForbidden() throws Exception
Exception
public void testResourceExists404() throws Exception
Exception
public void testResourceExists500() throws Exception
Exception
public void testResourceExists429() throws Exception
Exception
protected long getExpectedLastModifiedOnGet(Repository repository, Resource resource)
getExpectedLastModifiedOnGet
in class WagonTestCase
protected File getRepositoryDirectory()
public void testGzipGet() throws Exception
Exception
public void testProxiedRequest() throws Exception
Exception
public void testProxiedRequestWithAuthentication() throws Exception
Exception
public void testProxiedRequestWithAuthenticationWithProvider() throws Exception
Exception
public void testRedirectGetToStream() throws Exception
Exception
public void testRedirectGet() throws Exception
Exception
public void testRedirectPutFromStreamWithFullUrl() throws Exception
Exception
protected void checkRequestResponseForRedirectPutWithFullUrl(HttpWagonTestCase.RedirectHandler redirectHandler, HttpWagonTestCase.PutHandler putHandler)
public void testRedirectPutFromStreamRelativeUrl() throws Exception
Exception
protected void checkRequestResponseForRedirectPutWithRelativeUrl(HttpWagonTestCase.RedirectHandler redirectHandler, HttpWagonTestCase.PutHandler putHandler)
protected void checkHandlerResult(List<HttpWagonTestCase.HandlerRequestResponse> handlerRequestResponses, int... expectedResponseCodes)
public void testRedirectPutFileWithFullUrl() throws Exception
Exception
public void testRedirectPutFileRelativeUrl() throws Exception
Exception
public void testRedirectPutFailureNonRepeatableStream() throws Exception
Exception
public void testSecuredGetUnauthorized() throws Exception
Exception
public void testSecuredGetWrongPassword() throws Exception
Exception
public void testSecuredGet() throws Exception
Exception
public void runTestSecuredGet(AuthenticationInfo authInfo) throws Exception
Exception
public void testSecuredGetToStream() throws Exception
Exception
public void runTestSecuredGetToStream(AuthenticationInfo authInfo) throws Exception
Exception
public void testSecuredResourceExistsUnauthorized() throws Exception
Exception
public void testSecuredResourceExistsWrongPassword() throws Exception
Exception
public void testSecuredResourceExists() throws Exception
Exception
public void runTestSecuredResourceExists(AuthenticationInfo authInfo) throws Exception
Exception
public void testPutForbidden() throws Exception
Exception
public void testPut404() throws Exception
Exception
public void testPut500() throws Exception
Exception
public void testPut429() throws Exception
Exception
public void testSecuredPutUnauthorized() throws Exception
Exception
public void testSecuredPutWrongPassword() throws Exception
Exception
public void testSecuredPut() throws Exception
Exception
public void runTestSecuredPut(AuthenticationInfo authInfo) throws Exception
Exception
public void runTestSecuredPut(AuthenticationInfo authInfo, int putNumber) throws Exception
Exception
public void testNonSecuredPutFromStream() throws Exception
Exception
public void testSecuredPutFromStream() throws Exception
Exception
public void runTestSecuredPutFromStream(AuthenticationInfo authInfo, int putNumber, boolean addSecurityHandler) throws Exception
Exception
protected abstract boolean supportPreemptiveAuthenticationPut()
protected abstract boolean supportPreemptiveAuthenticationGet()
protected abstract boolean supportProxyPreemptiveAuthentication()
protected void testPreemptiveAuthenticationGet(HttpWagonTestCase.TestSecurityHandler sh, boolean preemptive)
protected void testPreemptiveAuthenticationPut(HttpWagonTestCase.TestSecurityHandler sh, boolean preemptive)
protected void testPreemptiveAuthentication(HttpWagonTestCase.TestSecurityHandler sh, boolean preemptive, int statusCode)
protected HttpWagonTestCase.TestSecurityHandler createSecurityHandler()
protected void verifyWagonExceptionMessage(Exception e, int forStatusCode, String forUrl, String forReasonPhrase)
This implementation represents the most desired assertions, but HttpWagonTestCase sub-classes could override this method if a specific wagon representation makes it impossible to meet these assertions.
e
- an instance of WagonException
forStatusCode
- the response status code that triggered the exceptionforUrl
- the url that triggered the exceptionforReasonPhrase
- the optional status line reason phrase the server returnedCopyright © 2003–2022 The Apache Software Foundation. All rights reserved.