Class HttpTransporterTest
java.lang.Object
org.eclipse.aether.internal.test.util.http.HttpTransporterTest
@TestMethodOrder(org.junit.jupiter.api.MethodOrderer.MethodName.class)
public abstract class HttpTransporterTest
extends Object
Common set of tests against Http transporter.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.aether.repository.Authenticationprotected Runnableprotected static SSLContextprotected org.eclipse.aether.spi.connector.transport.http.HttpTransporterFactoryprotected HttpServerprotected static final longprotected org.eclipse.aether.repository.Proxyprotected Fileprotected org.eclipse.aether.DefaultRepositorySystemSessionprotected Pathprotected org.eclipse.aether.spi.connector.transport.http.HttpTransporter -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpTransporterTest(Supplier<org.eclipse.aether.spi.connector.transport.http.HttpTransporterFactory> transporterFactorySupplier) -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidafterAll()protected static voidprotected booleanIndicates whether the transporter implementation closes all connections when the transporter is closed.protected booleanprotected org.eclipse.aether.repository.RemoteRepositoryprotected voidnewTransporter(String url) protected PathWrites a file with the given relative name and content into the repository directory served by the test server.protected voidsetUp(org.junit.jupiter.api.TestInfo testInfo) protected static org.eclipse.aether.spi.connector.transport.http.ChecksumExtractorProvides compression algorithms supported by the transporter implementation.protected booleanIndicates whether the transporter implementation supports HTTP/2.protected booleanIndicates whether the transporter implementation supports HTTP/3.protected booleanIndicates whether the transporter implementation supports preemptive authentication (i.e., sending credentials with the first request).protected booleanprotected voidtearDown()protected FileCreates a file with the given content in the per-test temporary directory.protected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidtestGet_WithCompression(String encoding) protected voidprotected voidtestPeek()protected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidtestRetryLogging_HttpStatus(int status) protected voidtestRetryLogging_HttpStatusWithRetryAfter(int status) protected voidprotected voidprotected voidtestRetryLogging_NoRetry(int retryCount) protected voidprotected void
-
Field Details
-
defaultSslContext
-
session
-
factory
-
transporter
-
closer
-
tempDir
-
repoDir
-
httpServer
-
auth
-
proxy
-
OLD_FILE_TIMESTAMP
- See Also:
-
-
Constructor Details
-
HttpTransporterTest
protected HttpTransporterTest(Supplier<org.eclipse.aether.spi.connector.transport.http.HttpTransporterFactory> transporterFactorySupplier)
-
-
Method Details
-
beforeAll
- Throws:
NoSuchAlgorithmException
-
afterAll
-
standardChecksumExtractor
protected static org.eclipse.aether.spi.connector.transport.http.ChecksumExtractor standardChecksumExtractor() -
newRepo
-
newTransporter
- Throws:
Exception
-
setUp
-
repoFile
Writes a file with the given relative name and content into the repository directory served by the test server.- Throws:
IOException
-
tempFile
Creates a file with the given content in the per-test temporary directory.- Throws:
IOException
-
tearDown
-
closesAllConnectionsOnTransporterClose
Indicates whether the transporter implementation closes all connections when the transporter is closed.- Returns:
trueif all connections are closed on transporter close,falseotherwise.
-
supportsPreemptiveAuth
Indicates whether the transporter implementation supports preemptive authentication (i.e., sending credentials with the first request).- Returns:
trueif preemptive authentication is supported,falseotherwise.
-
supportsHttp3
Indicates whether the transporter implementation supports HTTP/3.- Returns:
trueif HTTP/3 is supported,falseotherwise.
-
supportsHttp2
Indicates whether the transporter implementation supports HTTP/2.- Returns:
trueif HTTP/2 is supported,falseotherwise.
-
testClassify
-
testPeek
-
testPeek_DoesNotAcceptRfc9457
- Throws:
Exception
-
testRetryHandler_defaultCount_positive
- Throws:
Exception
-
supportsRetryLogging
-
testRetryLogging_HttpStatus
@ParameterizedTest @ValueSource(ints={429,503}) protected void testRetryLogging_HttpStatus(int status) throws Exception - Throws:
Exception
-
testRetryLogging_HttpStatusWithRetryAfter
@ParameterizedTest @ValueSource(ints={429,503}) protected void testRetryLogging_HttpStatusWithRetryAfter(int status) throws Exception - Throws:
Exception
-
testRetryLogging_IoException
- Throws:
Exception
-
testRetryLogging_NoRetry
@ParameterizedTest @ValueSource(ints={0,1}) protected void testRetryLogging_NoRetry(int retryCount) throws Exception - Throws:
Exception
-
testRetryLogging_IntervalTooLong
- Throws:
Exception
-
testRetryHandler_defaultCount_negative
- Throws:
Exception
-
testRetryHandler_tooManyRequests_explicitCount_positive
- Throws:
Exception
-
testRetryHandler_tooManyRequests_withRetryAfterHeader_explicitCount_positive
@Test protected void testRetryHandler_tooManyRequests_withRetryAfterHeader_explicitCount_positive() throws Exception- Throws:
Exception
-
testRetryHandler_tooManyRequests_explicitCount_negative
- Throws:
Exception
-
testRetryHandler_explicitCount_positive
- Throws:
Exception
-
testRetryHandler_disabled
- Throws:
Exception
-
testPeek_NotFound
- Throws:
Exception
-
testPeek_Closed
- Throws:
Exception
-
testPeek_Authenticated
- Throws:
Exception
-
testPeek_Unauthenticated
- Throws:
Exception
-
testPeek_ProxyAuthenticated
- Throws:
Exception
-
testPeek_ProxyUnauthenticated
- Throws:
Exception
-
testPeek_SSL
- Throws:
Exception
-
testPeek_Redirect
- Throws:
Exception
-
testGet_ToMemory
- Throws:
Exception
-
testGet_ToFile
- Throws:
Exception
-
testGet_ToFileTimestamp
- Throws:
Exception
-
testGet_AcceptsRfc9457
- Throws:
Exception
-
testGet_ParseRfc9457
- Throws:
Exception
-
supportedCompressionAlgorithms
Provides compression algorithms supported by the transporter implementation. This should be the string value passed in theAccept-Encodingheader.- Returns:
- stream of supported compression algorithm names
- See Also:
-
exposeContentCodingInTransportProperties
-
testGet_WithCompression
@ParameterizedTest @ValueSource(strings={"br","gzip","zstd"}) protected void testGet_WithCompression(String encoding) throws Exception - Throws:
Exception
-
testGet_EmptyResource
- Throws:
Exception
-
testGet_EncodedResourcePath
- Throws:
Exception
-
testGet_Authenticated
- Throws:
Exception
-
testGet_Unauthenticated
- Throws:
Exception
-
testGet_ProxyAuthenticated
- Throws:
Exception
-
testGet_ProxyUnauthenticated
- Throws:
Exception
-
testGet_RFC9457Response
- Throws:
Exception
-
testGet_RFC9457Response_with_missing_fields
- Throws:
Exception
-
testGet_SSL
- Throws:
Exception
-
testGet_SSL_WithServerErrors
- Throws:
Exception
-
testGet_HTTPS_Unknown_SecurityMode
- Throws:
Exception
-
testGet_HTTPS_Insecure_SecurityMode
- Throws:
Exception
-
testGet_HTTPS_HTTP2Only_Insecure_SecurityMode
- Throws:
Exception
-
testGet_HTTP3Only
- Throws:
Exception
-
testGet_HTTP3
- Throws:
Exception
-
testGet_HTTP3FallbackToHTTP2
- Throws:
Exception
-
testGet_Redirect
- Throws:
Exception
-
testGet_Redirect_ModeNone
- Throws:
Exception
-
testGet_Redirect_ModeSameAuthority
- Throws:
Exception
-
testGet_Redirect_ModeSameAuthorityRefusesDifferentAuthority
- Throws:
Exception
-
testGet_Redirect_ModeAnyAllowsDifferentAuthority
- Throws:
Exception
-
testGet_Redirect_OriginScopedHeadersByDefault
- Throws:
Exception
-
testGet_Redirect_OriginScopedHeadersDisabled
- Throws:
Exception
-
testGet_Redirect_OriginScopedAuthenticationNotReplayed
- Throws:
Exception
-
testGet_Redirect_InsecureRedirectRefusedByDefault
- Throws:
Exception
-
testGet_Redirect_InsecureRedirectAllowedWhenConfigured
- Throws:
Exception
-
testGet_Resume
- Throws:
Exception
-
testGet_ResumeLocalContentsOutdated
- Throws:
Exception
-
testGet_ResumeRangesNotSupportedByServer
- Throws:
Exception
-
testGet_Checksums_Nexus
- Throws:
Exception
-
testGet_Checksums_XChecksum
- Throws:
Exception
-
testGet_Checksums_XChecksum_Google
- Throws:
Exception
-
testGet_Checksums_XChecksum_Amazon
- Throws:
Exception
-
testGet_FileHandleLeak
- Throws:
Exception
-
testGet_NotFound
- Throws:
Exception
-
testGet_Closed
- Throws:
Exception
-
testGet_StartCancelled
- Throws:
Exception
-
testGet_ProgressCancelled
- Throws:
Exception
-
testPut_FromMemory
- Throws:
Exception
-
testPut_AcceptsRfc9457
- Throws:
Exception
-
testPut_FromFile
- Throws:
Exception
-
testPut_EmptyResource
- Throws:
Exception
-
testPut_EncodedResourcePath
- Throws:
Exception
-
testPut_Authenticated_ExpectContinue
- Throws:
Exception
-
testPut_Authenticated_ExpectContinueBroken
- Throws:
Exception
-
testPut_Authenticated_ExpectContinueRejected
- Throws:
Exception
-
testPut_Authenticated_ExpectContinueDisabled
- Throws:
Exception
-
testPut_Authenticated_ExpectContinueRejected_ExplicitlyConfiguredHeader
@Test protected void testPut_Authenticated_ExpectContinueRejected_ExplicitlyConfiguredHeader() throws Exception- Throws:
Exception
-
testPut_Unauthenticated
- Throws:
Exception
-
testPut_ProxyAuthenticated
- Throws:
Exception
-
testPut_ProxyUnauthenticated
- Throws:
Exception
-
testPut_SSL
- Throws:
Exception
-
testPut_FileHandleLeak
- Throws:
Exception
-
testPut_Closed
- Throws:
Exception
-
testPut_StartCancelled
- Throws:
Exception
-
testPut_ProgressCancelled
- Throws:
Exception
-
testGetPut_AuthCache
- Throws:
Exception
-
testPut_PreemptiveIsDefault
- Throws:
Exception
-
testPut_AuthCache
- Throws:
Exception
-
testPut_AuthCache_Preemptive
- Throws:
Exception
-
testPut_WithResponseBody
- Throws:
Exception
-
testConcurrency
- Throws:
Exception
-
testConnectTimeout
- Throws:
Exception
-
testRequestTimeout
- Throws:
Exception
-
testUserAgent
- Throws:
Exception
-
testCustomHeaders
- Throws:
Exception
-
testServerAuthScope_NotUsedForProxy
- Throws:
Exception
-
testProxyAuthScope_NotUsedForServer
- Throws:
Exception
-
testAuthSchemeReuse
- Throws:
Exception
-
testAuthSchemePreemptive
- Throws:
Exception
-