From c08361fab221f34d6eae55c26b379f3fed040267 Mon Sep 17 00:00:00 2001 From: Ronald Brill Date: Fri, 5 Apr 2024 15:42:24 +0200 Subject: [PATCH] DefaultCredentialsProvider moved from package 'org.htmlunit' into 'org.htmlunit.httpclient' (issue #764) --- src/changes/changes.xml | 5 +++++ src/main/java/org/htmlunit/WebClient.java | 1 + .../{ => httpclient}/DefaultCredentialsProvider.java | 3 +-- src/test/java/org/htmlunit/archunit/ArchitectureTest.java | 1 - .../{ => httpclient}/DefaultCredentialsProvider2Test.java | 4 +++- .../{ => httpclient}/DefaultCredentialsProvider3Test.java | 2 +- .../{ => httpclient}/DefaultCredentialsProviderTest.java | 4 +++- 7 files changed, 14 insertions(+), 6 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 f696caf7025..17425c8f839 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -8,6 +8,11 @@ + + 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/WebClient.java b/src/main/java/org/htmlunit/WebClient.java index 158d54b33cb..e1f52cbe95c 100644 --- a/src/main/java/org/htmlunit/WebClient.java +++ b/src/main/java/org/htmlunit/WebClient.java @@ -76,6 +76,7 @@ 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/main/java/org/htmlunit/DefaultCredentialsProvider.java b/src/main/java/org/htmlunit/httpclient/DefaultCredentialsProvider.java similarity index 99% rename from src/main/java/org/htmlunit/DefaultCredentialsProvider.java rename to src/main/java/org/htmlunit/httpclient/DefaultCredentialsProvider.java index fb81569e953..dd4a07a2efd 100644 --- a/src/main/java/org/htmlunit/DefaultCredentialsProvider.java +++ b/src/main/java/org/htmlunit/httpclient/DefaultCredentialsProvider.java @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.htmlunit; +package org.htmlunit.httpclient; import java.io.IOException; import java.io.ObjectInputStream; @@ -28,7 +28,6 @@ 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/test/java/org/htmlunit/archunit/ArchitectureTest.java b/src/test/java/org/htmlunit/archunit/ArchitectureTest.java index 3d91bfc112b..c2e30a07b09 100644 --- a/src/test/java/org/htmlunit/archunit/ArchitectureTest.java +++ b/src/test/java/org/htmlunit/archunit/ArchitectureTest.java @@ -349,7 +349,6 @@ 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.."); diff --git a/src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java b/src/test/java/org/htmlunit/httpclient/DefaultCredentialsProvider2Test.java similarity index 99% rename from src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java rename to src/test/java/org/htmlunit/httpclient/DefaultCredentialsProvider2Test.java index d3a8ff56164..a053764f1e6 100644 --- a/src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java +++ b/src/test/java/org/htmlunit/httpclient/DefaultCredentialsProvider2Test.java @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.htmlunit; +package org.htmlunit.httpclient; import static org.junit.Assert.fail; @@ -26,6 +26,8 @@ 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/DefaultCredentialsProvider3Test.java b/src/test/java/org/htmlunit/httpclient/DefaultCredentialsProvider3Test.java similarity index 98% rename from src/test/java/org/htmlunit/DefaultCredentialsProvider3Test.java rename to src/test/java/org/htmlunit/httpclient/DefaultCredentialsProvider3Test.java index 9a877d814ed..acd97f6f0e6 100644 --- a/src/test/java/org/htmlunit/DefaultCredentialsProvider3Test.java +++ b/src/test/java/org/htmlunit/httpclient/DefaultCredentialsProvider3Test.java @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.htmlunit; +package org.htmlunit.httpclient; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; diff --git a/src/test/java/org/htmlunit/DefaultCredentialsProviderTest.java b/src/test/java/org/htmlunit/httpclient/DefaultCredentialsProviderTest.java similarity index 97% rename from src/test/java/org/htmlunit/DefaultCredentialsProviderTest.java rename to src/test/java/org/htmlunit/httpclient/DefaultCredentialsProviderTest.java index eaee4983def..2857682c786 100644 --- a/src/test/java/org/htmlunit/DefaultCredentialsProviderTest.java +++ b/src/test/java/org/htmlunit/httpclient/DefaultCredentialsProviderTest.java @@ -12,11 +12,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.htmlunit; +package org.htmlunit.httpclient; 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;