-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MRESOLVER-449] Step toward testing all HTTP transports (#391)
Right now, the HTTP test suite is pulled out and reused for all HTTP transports. It passes for ApacheTransporter (as it was pulled from it), but Jetty and JDK show some signs of some problems... Current results (note: base class HttpTransporterTest has 70 tests, while some transport specific UTs add more): * apache ✔️ 74 test OK * jdk 🔴 62 test OK, 9 test FAIL * jetty 🔴 64 test OK, 6 FAIL The "basics" are overall good (basics pass everywhere), failures stems from small differences. Jetty: it seems it consumes the body (pulls bytes out of it) even before all the HTTP auth happens, this causes that `TransportListener` gets notified "transport started" but in fact is not and test asserts it to not. Also, Jetty throws in tests where server is set up to abruptly close the connection. Retries are not properly done (low level, like abrupt connection drop). JDK: same problem with body (pulls bytes beforehand) and similarly as with Jetty, "transport started" events fails the test. Preemptive auth is not done (as it seems it is either "manual" handling of auth or Authenticator is used but then preemptive auth becomes impossible as headers are removed, no way to set them). It also throws in tests where server abruptly drops connection. Same for retries (in case of TCP issue). --- https://issues.apache.org/jira/browse/MRESOLVER-449
- Loading branch information
Showing
30 changed files
with
1,908 additions
and
1,308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...src/main/java/org/eclipse/aether/spi/connector/transport/http/HttpTransporterFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.eclipse.aether.spi.connector.transport.http; | ||
|
||
import org.eclipse.aether.RepositorySystemSession; | ||
import org.eclipse.aether.repository.RemoteRepository; | ||
import org.eclipse.aether.spi.connector.transport.TransporterFactory; | ||
import org.eclipse.aether.transfer.NoTransporterException; | ||
|
||
/** | ||
* A factory for {@link HttpTransporter}. | ||
* | ||
* @since 2.0.0 | ||
*/ | ||
public interface HttpTransporterFactory extends TransporterFactory { | ||
|
||
/** | ||
* Tries to create HTTP transporter for the specified remote repository. | ||
* | ||
* @param session The repository system session from which to configure the transporter, must not be {@code null}. | ||
* In particular, a transporter should obey the timeouts configured for the session. | ||
* @param repository The remote repository to create a transporter for, must not be {@code null}. | ||
* @return The transporter for the given repository, never {@code null}. | ||
* @throws NoTransporterException If the factory cannot create a transporter for the specified remote repository. | ||
*/ | ||
@Override | ||
HttpTransporter newInstance(RepositorySystemSession session, RemoteRepository repository) | ||
throws NoTransporterException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.