Skip to content

Commit

Permalink
Use test constants from SOLR-17066/PR apache#2255
Browse files Browse the repository at this point in the history
  • Loading branch information
jdyer1 committed Feb 20, 2024
1 parent 8e61939 commit 20de4b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Expand Up @@ -58,9 +58,9 @@ public static void beforeTest() throws Exception {
JettyConfig jettyConfig =
JettyConfig.builder()
.withServlet(
new ServletHolder(BasicHttpSolrClientTest.RedirectServlet.class), "/redirect/*")
.withServlet(new ServletHolder(BasicHttpSolrClientTest.SlowServlet.class), "/slow/*")
.withServlet(new ServletHolder(DebugServlet.class), "/debug/*")
new ServletHolder(BasicHttpSolrClientTest.RedirectServlet.class), REDIRECT_SERVLET_REGEX)
.withServlet(new ServletHolder(BasicHttpSolrClientTest.SlowServlet.class), SLOW_SERVLET_REGEX)
.withServlet(new ServletHolder(DebugServlet.class), DEBUG_SERVLET_REGEX)
.withSSLConfig(sslConfig.buildServerSSLConfig())
.build();
createAndStartJetty(legacyExampleCollection1SolrHome(), jettyConfig);
Expand Down
Expand Up @@ -167,7 +167,7 @@ public void testTimeout() throws Exception {
SolrQuery q = new SolrQuery("*:*");
try (HttpSolrClientJdkImpl client =
(HttpSolrClientJdkImpl)
builder(getBaseUrl() + "/slow/foo", DEFAULT_CONNECTION_TIMEOUT, 2000).build()) {
builder(getBaseUrl() + SLOW_SERVLET_PATH, DEFAULT_CONNECTION_TIMEOUT, 2000).build()) {
client.query(q, SolrRequest.METHOD.GET);
fail("No exception thrown.");
} catch (SolrServerException e) {
Expand All @@ -193,7 +193,7 @@ public void testRequestTimeout() throws Exception {
SolrQuery q = new SolrQuery("*:*");
try (HttpSolrClientJdkImpl client =
(HttpSolrClientJdkImpl)
builder(getBaseUrl() + "/slow/foo", DEFAULT_CONNECTION_TIMEOUT, 0)
builder(getBaseUrl() + SLOW_SERVLET_PATH, DEFAULT_CONNECTION_TIMEOUT, 0)
.withRequestTimeout(500, TimeUnit.MILLISECONDS)
.build()) {
client.query(q, SolrRequest.METHOD.GET);
Expand All @@ -205,7 +205,7 @@ public void testRequestTimeout() throws Exception {

@Test
public void testFollowRedirect() throws Exception {
final String clientUrl = getBaseUrl() + "/redirect/foo";
final String clientUrl = getBaseUrl() + REDIRECT_SERVLET_PATH;
try (HttpSolrClientJdkImpl client = builder(clientUrl).withFollowRedirects(true).build()) {
SolrQuery q = new SolrQuery("*:*");
client.query(q);
Expand All @@ -214,7 +214,7 @@ public void testFollowRedirect() throws Exception {

@Test
public void testDoNotFollowRedirect() throws Exception {
final String clientUrl = getBaseUrl() + "/redirect/foo";
final String clientUrl = getBaseUrl() + REDIRECT_SERVLET_PATH;
try (HttpSolrClientJdkImpl client = builder(clientUrl).withFollowRedirects(false).build()) {
SolrQuery q = new SolrQuery("*:*");

Expand All @@ -225,7 +225,7 @@ public void testDoNotFollowRedirect() throws Exception {

@Test
public void testRedirectSwapping() throws Exception {
final String clientUrl = getBaseUrl() + "/redirect/foo";
final String clientUrl = getBaseUrl() + REDIRECT_SERVLET_PATH;
SolrQuery q = new SolrQuery("*:*");

// default for follow redirects is false
Expand Down

0 comments on commit 20de4b0

Please sign in to comment.