From e65c1931126dcb2a09cce2aa81ea7651bf0a5166 Mon Sep 17 00:00:00 2001 From: Ronald Brill Date: Sat, 6 Apr 2024 09:18:35 +0200 Subject: [PATCH] Revert "DefaultCredentialsProvider moved from package 'org.htmlunit' into 'org.htmlunit.httpclient' (issue #764)" This reverts commit c08361fab221f34d6eae55c26b379f3fed040267. --- src/changes/changes.xml | 5 ----- .../{httpclient => }/DefaultCredentialsProvider.java | 3 ++- src/main/java/org/htmlunit/WebClient.java | 1 - .../{httpclient => }/DefaultCredentialsProvider2Test.java | 4 +--- .../{httpclient => }/DefaultCredentialsProvider3Test.java | 2 +- .../{httpclient => }/DefaultCredentialsProviderTest.java | 4 +--- src/test/java/org/htmlunit/archunit/ArchitectureTest.java | 1 + 7 files changed, 6 insertions(+), 14 deletions(-) rename src/main/java/org/htmlunit/{httpclient => }/DefaultCredentialsProvider.java (99%) rename src/test/java/org/htmlunit/{httpclient => }/DefaultCredentialsProvider2Test.java (99%) rename src/test/java/org/htmlunit/{httpclient => }/DefaultCredentialsProvider3Test.java (98%) rename src/test/java/org/htmlunit/{httpclient => }/DefaultCredentialsProviderTest.java (97%) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 17425c8f839..f696caf7025 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -8,11 +8,6 @@ - - INCOMPATIBLE CHANGE: DefaultCredentialsProvider moved from package 'org.htmlunit' into 'org.htmlunit.httpclient'. - - - Wrong script encoding was uses in some cases (regression in 4.0.0). diff --git a/src/main/java/org/htmlunit/httpclient/DefaultCredentialsProvider.java b/src/main/java/org/htmlunit/DefaultCredentialsProvider.java similarity index 99% rename from src/main/java/org/htmlunit/httpclient/DefaultCredentialsProvider.java rename to src/main/java/org/htmlunit/DefaultCredentialsProvider.java index dd4a07a2efd..fb81569e953 100644 --- a/src/main/java/org/htmlunit/httpclient/DefaultCredentialsProvider.java +++ b/src/main/java/org/htmlunit/DefaultCredentialsProvider.java @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.htmlunit.httpclient; +package org.htmlunit; import java.io.IOException; import java.io.ObjectInputStream; @@ -28,6 +28,7 @@ import org.apache.http.auth.NTCredentials; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.CredentialsProvider; +import org.htmlunit.httpclient.HtmlUnitUsernamePasswordCredentials; /** * Default HtmlUnit implementation of the CredentialsProvider interface. Provides diff --git a/src/main/java/org/htmlunit/WebClient.java b/src/main/java/org/htmlunit/WebClient.java index e1f52cbe95c..158d54b33cb 100644 --- a/src/main/java/org/htmlunit/WebClient.java +++ b/src/main/java/org/htmlunit/WebClient.java @@ -76,7 +76,6 @@ import org.htmlunit.html.XHtmlPage; import org.htmlunit.html.parser.HTMLParser; import org.htmlunit.html.parser.HTMLParserListener; -import org.htmlunit.httpclient.DefaultCredentialsProvider; import org.htmlunit.httpclient.HttpClientConverter; import org.htmlunit.javascript.AbstractJavaScriptEngine; import org.htmlunit.javascript.DefaultJavaScriptErrorListener; diff --git a/src/test/java/org/htmlunit/httpclient/DefaultCredentialsProvider2Test.java b/src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java similarity index 99% rename from src/test/java/org/htmlunit/httpclient/DefaultCredentialsProvider2Test.java rename to src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java index a053764f1e6..d3a8ff56164 100644 --- a/src/test/java/org/htmlunit/httpclient/DefaultCredentialsProvider2Test.java +++ b/src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.htmlunit.httpclient; +package org.htmlunit; import static org.junit.Assert.fail; @@ -26,8 +26,6 @@ import org.apache.logging.log4j.core.appender.WriterAppender; import org.apache.logging.log4j.core.config.Configurator; import org.apache.logging.log4j.core.layout.PatternLayout; -import org.htmlunit.FailingHttpStatusCodeException; -import org.htmlunit.WebServerTestCase; import org.htmlunit.html.HtmlPage; import org.htmlunit.junit.BrowserRunner; import org.htmlunit.junit.BrowserRunner.Alerts; diff --git a/src/test/java/org/htmlunit/httpclient/DefaultCredentialsProvider3Test.java b/src/test/java/org/htmlunit/DefaultCredentialsProvider3Test.java similarity index 98% rename from src/test/java/org/htmlunit/httpclient/DefaultCredentialsProvider3Test.java rename to src/test/java/org/htmlunit/DefaultCredentialsProvider3Test.java index acd97f6f0e6..9a877d814ed 100644 --- a/src/test/java/org/htmlunit/httpclient/DefaultCredentialsProvider3Test.java +++ b/src/test/java/org/htmlunit/DefaultCredentialsProvider3Test.java @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.htmlunit.httpclient; +package org.htmlunit; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; diff --git a/src/test/java/org/htmlunit/httpclient/DefaultCredentialsProviderTest.java b/src/test/java/org/htmlunit/DefaultCredentialsProviderTest.java similarity index 97% rename from src/test/java/org/htmlunit/httpclient/DefaultCredentialsProviderTest.java rename to src/test/java/org/htmlunit/DefaultCredentialsProviderTest.java index 2857682c786..eaee4983def 100644 --- a/src/test/java/org/htmlunit/httpclient/DefaultCredentialsProviderTest.java +++ b/src/test/java/org/htmlunit/DefaultCredentialsProviderTest.java @@ -12,13 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.htmlunit.httpclient; +package org.htmlunit; import org.apache.http.auth.AuthScope; import org.apache.http.auth.Credentials; import org.apache.http.impl.auth.BasicScheme; -import org.htmlunit.HttpHeader; -import org.htmlunit.SimpleWebTestCase; import org.htmlunit.html.HtmlPage; import org.htmlunit.junit.BrowserRunner; import org.junit.Test; diff --git a/src/test/java/org/htmlunit/archunit/ArchitectureTest.java b/src/test/java/org/htmlunit/archunit/ArchitectureTest.java index c2e30a07b09..3d91bfc112b 100644 --- a/src/test/java/org/htmlunit/archunit/ArchitectureTest.java +++ b/src/test/java/org/htmlunit/archunit/ArchitectureTest.java @@ -349,6 +349,7 @@ public void check(final JavaMethod method, final ConditionEvents events) { .and().doNotHaveFullyQualifiedName("org.htmlunit.WebClient") .and().doNotHaveFullyQualifiedName("org.htmlunit.WebRequest") .and().doNotHaveFullyQualifiedName("org.htmlunit.util.Cookie") + .and().doNotHaveFullyQualifiedName("org.htmlunit.DefaultCredentialsProvider") .and().resideOutsideOfPackage("org.htmlunit.httpclient..") .should().dependOnClassesThat().resideInAnyPackage("org.apache.http..");