lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r1718852 - in /lucene/dev/trunk/solr: ./ core/src/java/org/apache/solr/core/ core/src/java/org/apache/solr/security/ solrj/src/java/org/apache/solr/client/solrj/impl/ solrj/src/test/org/apache/solr/client/solrj/impl/
Date Wed, 09 Dec 2015 13:21:57 GMT
Author: noble
Date: Wed Dec  9 13:21:56 2015
New Revision: 1718852

URL: http://svn.apache.org/viewvc?rev=1718852&view=rev
Log:
SOLR-8373: KerberosPlugin: Using multiple nodes on same machine leads clients to
  fetch TGT for every request

Added:
    lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecFactory.java
  (with props)
    lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecTest.java
  (with props)
Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/security/KerberosPlugin.java
    lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientConfigurer.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1718852&r1=1718851&r2=1718852&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Wed Dec  9 13:21:56 2015
@@ -219,7 +219,11 @@ Bug Fixes
 * SOLR-6271: Fix ConjunctionSolrSpellChecker to not compare StringDistance by instance.
   (Igor Kostromin via James Dyer)
   
-* SOLR-7304: Fix Spellcheck Collate to not invalidate range queries. (James Dyer) 
+* SOLR-7304: Fix Spellcheck Collate to not invalidate range queries. (James Dyer)
+
+* SOLR-8373: KerberosPlugin: Using multiple nodes on same machine leads clients to
+  fetch TGT for every request (Ishan Chattopadhyaya via noble)
+
 
 Other Changes
 ----------------------

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java?rev=1718852&r1=1718851&r2=1718852&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java Wed Dec  9
13:21:56 2015
@@ -279,10 +279,14 @@ public class CoreContainer {
     SecurityPluginHolder<AuthenticationPlugin> old = authenticationPlugin;
     SecurityPluginHolder<AuthenticationPlugin> authenticationPlugin = null;
 
-    // Initialize the filter
+    // Initialize the plugin
     if (pluginClassName != null) {
       authenticationPlugin = new SecurityPluginHolder<>(readVersion(authenticationConfig),
-          getResourceLoader().newInstance(pluginClassName, AuthenticationPlugin.class));
+          getResourceLoader().newInstance(pluginClassName,
+              AuthenticationPlugin.class,
+              null,
+              new Class[]{CoreContainer.class},
+              new Object[]{this}));
     }
     if (authenticationPlugin != null) {
       authenticationPlugin.plugin.init(authenticationConfig);

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java?rev=1718852&r1=1718851&r2=1718852&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java Wed Dec
 9 13:21:56 2015
@@ -600,7 +600,7 @@ public class SolrResourceLoader implemen
     return obj;
   }
 
- 
+
 
   public <T> T newInstance(String cName, Class<T> expectedType, String [] subPackages,
Class[] params, Object[] args){
     Class<? extends T> clazz = findClass(cName, expectedType, subPackages);
@@ -612,8 +612,19 @@ public class SolrResourceLoader implemen
     T obj = null;
     try {
 
-      Constructor<? extends T> constructor = clazz.getConstructor(params);
-      obj = constructor.newInstance(args);
+      Constructor<? extends T> constructor = null;
+      try {
+        constructor = clazz.getConstructor(params);
+        obj = constructor.newInstance(args);
+      } catch (NoSuchMethodException e) {
+        //look for a zero arg constructor if the constructor args do not match
+        try {
+          constructor = clazz.getConstructor();
+          obj = constructor.newInstance();
+        } catch (NoSuchMethodException e1) {
+          throw e;
+        }
+      }
 
     } catch (Error err) {
       log.error("Loading Class " + cName + " ("+clazz.getName() + ") triggered serious java
error: "

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/security/KerberosPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/security/KerberosPlugin.java?rev=1718852&r1=1718851&r2=1718852&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/security/KerberosPlugin.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/security/KerberosPlugin.java Wed Dec
 9 13:21:56 2015
@@ -29,8 +29,10 @@ import javax.servlet.descriptor.JspConfi
 import org.apache.commons.collections.iterators.IteratorEnumeration;
 import org.apache.solr.client.solrj.impl.HttpClientConfigurer;
 import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
+import org.apache.solr.cloud.ZkController;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrException.ErrorCode;
+import org.apache.solr.core.CoreContainer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -57,12 +59,18 @@ public class KerberosPlugin extends Auth
   HttpClientConfigurer kerberosConfigurer = new Krb5HttpClientConfigurer();
   Filter kerberosFilter = new KerberosFilter();
   
-  final String NAME_RULES_PARAM = "solr.kerberos.name.rules";
-  final String COOKIE_DOMAIN_PARAM = "solr.kerberos.cookie.domain";
-  final String COOKIE_PATH_PARAM = "solr.kerberos.cookie.path";
-  final String PRINCIPAL_PARAM = "solr.kerberos.principal";
-  final String KEYTAB_PARAM = "solr.kerberos.keytab";
-  final String TOKEN_VALID_PARAM = "solr.kerberos.token.valid";
+  public static final String NAME_RULES_PARAM = "solr.kerberos.name.rules";
+  public static final String COOKIE_DOMAIN_PARAM = "solr.kerberos.cookie.domain";
+  public static final String COOKIE_PATH_PARAM = "solr.kerberos.cookie.path";
+  public static final String PRINCIPAL_PARAM = "solr.kerberos.principal";
+  public static final String KEYTAB_PARAM = "solr.kerberos.keytab";
+  public static final String TOKEN_VALID_PARAM = "solr.kerberos.token.valid";
+  public static final String COOKIE_PORT_AWARE_PARAM = "solr.kerberos.cookie.portaware";
+  private final CoreContainer coreContainer;
+
+  public KerberosPlugin(CoreContainer coreContainer) {
+    this.coreContainer = coreContainer;
+  }
 
   @Override
   public void init(Map<String, Object> pluginConfig) {
@@ -71,11 +79,27 @@ public class KerberosPlugin extends Auth
       params.put("type", "kerberos");
       putParam(params, "kerberos.name.rules", NAME_RULES_PARAM, "DEFAULT");
       putParam(params, "token.valid", TOKEN_VALID_PARAM, "30");
-      putParam(params, "cookie.domain", COOKIE_DOMAIN_PARAM, null);
       putParam(params, "cookie.path", COOKIE_PATH_PARAM, "/");
       putParam(params, "kerberos.principal", PRINCIPAL_PARAM, null);
       putParam(params, "kerberos.keytab", KEYTAB_PARAM, null);
 
+      // Special handling for the "cookie.domain" based on whether port should be
+      // appended to the domain. Useful for situations where multiple solr nodes are
+      // on the same host.
+      String usePortStr = System.getProperty(COOKIE_PORT_AWARE_PARAM, null);
+      boolean needPortAwareCookies = (usePortStr == null) ? false: Boolean.parseBoolean(usePortStr);
+
+      if (!needPortAwareCookies || !coreContainer.isZooKeeperAware()) {
+        putParam(params, "cookie.domain", COOKIE_DOMAIN_PARAM, null);
+      } else { // we need port aware cookies and we are in SolrCloud mode.
+        String host = System.getProperty(COOKIE_DOMAIN_PARAM, null);
+        if (host==null) {
+          throw new SolrException(ErrorCode.SERVER_ERROR, "Missing required parameter '"+COOKIE_DOMAIN_PARAM+"'.");
+        }
+        int port = coreContainer.getZkController().getHostPort();
+        params.put("cookie.domain", host + ":" + port);
+      }
+      
       log.info("Params: "+params);
 
       FilterConfig conf = new FilterConfig() {

Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientConfigurer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientConfigurer.java?rev=1718852&r1=1718851&r2=1718852&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientConfigurer.java
(original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientConfigurer.java
Wed Dec  9 13:21:56 2015
@@ -40,6 +40,7 @@ import org.apache.http.impl.auth.SPNegoS
 import org.apache.http.impl.client.DefaultHttpClient;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.client.config.AuthSchemes;
+import org.apache.http.client.params.ClientPNames;
 import org.apache.solr.common.params.SolrParams;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -93,6 +94,10 @@ public class Krb5HttpClientConfigurer ex
           }
         };
 
+        SolrPortAwareCookieSpecFactory cookieFactory = new SolrPortAwareCookieSpecFactory();
+        httpClient.getCookieSpecs().register(cookieFactory.POLICY_NAME, cookieFactory);
+        httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY, cookieFactory.POLICY_NAME);
+        
         httpClient.getCredentialsProvider().setCredentials(AuthScope.ANY, useJaasCreds);
 
         httpClient.addRequestInterceptor(bufferedEntityInterceptor);

Added: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecFactory.java?rev=1718852&view=auto
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecFactory.java
(added)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecFactory.java
Wed Dec  9 13:21:56 2015
@@ -0,0 +1,114 @@
+package org.apache.solr.client.solrj.impl;
+
+import java.util.Collection;
+
+import org.apache.http.cookie.ClientCookie;
+import org.apache.http.cookie.Cookie;
+import org.apache.http.cookie.CookieOrigin;
+import org.apache.http.cookie.CookieSpec;
+import org.apache.http.cookie.CookieSpecFactory;
+import org.apache.http.cookie.CookieSpecProvider;
+import org.apache.http.cookie.MalformedCookieException;
+import org.apache.http.cookie.params.CookieSpecPNames;
+import org.apache.http.impl.cookie.NetscapeDomainHandler;
+import org.apache.http.impl.cookie.NetscapeDraftSpec;
+import org.apache.http.params.HttpParams;
+import org.apache.http.protocol.HttpContext;
+
+/*
+ * 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.
+ */
+
+@SuppressWarnings("deprecation")
+public class SolrPortAwareCookieSpecFactory implements CookieSpecFactory, CookieSpecProvider
{
+  public static final String POLICY_NAME = "solr-portaware";
+  private final CookieSpec cookieSpec;
+
+  public SolrPortAwareCookieSpecFactory(final String[] datepatterns) {
+    super();
+    this.cookieSpec = new PortAwareCookieSpec(datepatterns);
+  }
+
+  public SolrPortAwareCookieSpecFactory() {
+    this(null);
+  }
+
+  @Override
+  public CookieSpec newInstance(final HttpParams params) {
+    if (params != null) {
+      String[] patterns = null;
+      final Collection<?> param = (Collection<?>) params.getParameter(
+          CookieSpecPNames.DATE_PATTERNS);
+      if (param != null) {
+        patterns = new String[param.size()];
+        patterns = param.toArray(patterns);
+      }
+      return new PortAwareCookieSpec(patterns);
+    } else {
+      return new PortAwareCookieSpec(null);
+    }
+  }
+
+  @Override
+  public CookieSpec create(final HttpContext context) {
+    return this.cookieSpec;
+  }
+
+  public static class PortAwareCookieSpec extends NetscapeDraftSpec {
+    public PortAwareCookieSpec(String patterns[]) {
+      super(patterns);
+      super.registerAttribHandler(ClientCookie.DOMAIN_ATTR, new PortAwareDomainHandler());
+    }
+
+    public PortAwareCookieSpec() {
+      this(null);
+    }
+  }
+
+  /**
+   * A domain handler to validate and match cookies based on the domain and origin.
+   * The domain is tested against host and port both, and if it doesn't match, it
+   * delegates the handling to the base class' matching/validation logic.
+   */
+  public static class PortAwareDomainHandler extends NetscapeDomainHandler {
+
+    public void validate(final Cookie cookie, final CookieOrigin origin)
+        throws MalformedCookieException {
+      if (origin != null && origin.getHost() != null && cookie != null) {
+        String hostPort = origin.getHost() + ":" + origin.getPort();
+        String domain = cookie.getDomain();
+
+        if (hostPort.equals(domain)) {
+          return;
+        }
+      }
+      super.validate(cookie, origin);
+    }
+
+    @Override
+    public boolean match(final Cookie cookie, final CookieOrigin origin) {
+      if (origin != null && origin.getHost() != null && cookie != null) {
+        String hostPort = origin.getHost() + ":" + origin.getPort();
+        String domain = cookie.getDomain();
+        if (hostPort.equals(domain)) {
+          return true;
+        }
+      }
+      return super.match(cookie, origin);
+    }
+  }
+}
+

Added: lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecTest.java?rev=1718852&view=auto
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecTest.java
(added)
+++ lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecTest.java
Wed Dec  9 13:21:56 2015
@@ -0,0 +1,197 @@
+package org.apache.solr.client.solrj.impl;
+
+/*
+ * 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.
+ */
+
+import org.apache.http.cookie.CookieAttributeHandler;
+import org.apache.http.cookie.CookieOrigin;
+import org.apache.http.cookie.MalformedCookieException;
+import org.apache.http.impl.cookie.BasicClientCookie;
+import org.junit.Assert;
+import org.junit.Test;
+
+// Test cases imported from TestNetscapeCookieAttribHandlers of HttpClient project
+public class SolrPortAwareCookieSpecTest {
+
+  @Test
+  public void testDomainHostPortValidate() throws Exception {
+    final BasicClientCookie cookie = new BasicClientCookie("name", "value");
+    final CookieOrigin origin = new CookieOrigin("somehost", 80, "/", false);
+    final CookieAttributeHandler h = new SolrPortAwareCookieSpecFactory.PortAwareDomainHandler();
+
+    cookie.setDomain("somehost:80");
+    h.validate(cookie, origin);
+
+    cookie.setDomain("somehost:1234");
+    try {
+      h.validate(cookie, origin);
+      Assert.fail("MalformedCookieException should have been thrown");
+    } catch (final MalformedCookieException ex) {
+      // expected
+    }
+  }
+
+  @Test
+  public void testDomainHostPortMatch() throws Exception {
+    final BasicClientCookie cookie = new BasicClientCookie("name", "value");
+    final CookieOrigin origin = new CookieOrigin("myhost", 80, "/", false);
+    final CookieAttributeHandler h = new SolrPortAwareCookieSpecFactory.PortAwareDomainHandler();
+
+    cookie.setDomain("myhost");
+    try {
+      h.match(cookie, null);
+      Assert.fail("IllegalArgumentException should have been thrown, since origin is null.");
+    } catch (final IllegalArgumentException ex) {
+      // expected
+    }
+
+    cookie.setDomain(null);
+    Assert.assertFalse(h.match(cookie, origin));
+
+    cookie.setDomain("otherhost");
+    Assert.assertFalse(h.match(cookie, origin));
+
+    cookie.setDomain("myhost");
+    Assert.assertTrue(h.match(cookie, origin));
+
+    cookie.setDomain("myhost:80");
+    Assert.assertTrue(h.match(cookie, origin));
+
+    cookie.setDomain("myhost:8080");
+    Assert.assertFalse(h.match(cookie, origin));
+  }
+
+  @Test
+  public void testDomainValidate1() throws Exception {
+    final BasicClientCookie cookie = new BasicClientCookie("name", "value");
+    final CookieOrigin origin = new CookieOrigin("somehost", 80, "/", false);
+    final CookieAttributeHandler h = new SolrPortAwareCookieSpecFactory.PortAwareDomainHandler();
+
+    cookie.setDomain("somehost");
+    h.validate(cookie, origin);
+
+    cookie.setDomain("otherhost");
+    try {
+      h.validate(cookie, origin);
+      Assert.fail("MalformedCookieException should have been thrown");
+    } catch (final MalformedCookieException ex) {
+      // expected
+    }
+  }
+
+  @Test
+  public void testDomainValidate2() throws Exception {
+    final BasicClientCookie cookie = new BasicClientCookie("name", "value");
+    final CookieOrigin origin = new CookieOrigin("www.somedomain.com", 80, "/", false);
+    final CookieAttributeHandler h = new SolrPortAwareCookieSpecFactory.PortAwareDomainHandler();
+
+    cookie.setDomain(".somedomain.com");
+    h.validate(cookie, origin);
+
+    cookie.setDomain(".otherdomain.com");
+    try {
+      h.validate(cookie, origin);
+      Assert.fail("MalformedCookieException should have been thrown");
+    } catch (final MalformedCookieException ex) {
+      // expected
+    }
+    cookie.setDomain("www.otherdomain.com");
+    try {
+      h.validate(cookie, origin);
+      Assert.fail("MalformedCookieException should have been thrown");
+    } catch (final MalformedCookieException ex) {
+      // expected
+    }
+  }
+
+  @Test
+  public void testDomainValidate3() throws Exception {
+    final BasicClientCookie cookie = new BasicClientCookie("name", "value");
+    final CookieOrigin origin = new CookieOrigin("www.a.com", 80, "/", false);
+    final CookieAttributeHandler h = new SolrPortAwareCookieSpecFactory.PortAwareDomainHandler();
+
+    cookie.setDomain(".a.com");
+    h.validate(cookie, origin);
+
+    cookie.setDomain(".com");
+    try {
+      h.validate(cookie, origin);
+      Assert.fail("MalformedCookieException should have been thrown");
+    } catch (final MalformedCookieException ex) {
+      // expected
+    }
+  }
+
+  @Test
+  public void testDomainValidate4() throws Exception {
+    final BasicClientCookie cookie = new BasicClientCookie("name", "value");
+    final CookieOrigin origin = new CookieOrigin("www.a.b.c", 80, "/", false);
+    final CookieAttributeHandler h = new SolrPortAwareCookieSpecFactory.PortAwareDomainHandler();
+
+    cookie.setDomain(".a.b.c");
+    h.validate(cookie, origin);
+
+    cookie.setDomain(".b.c");
+    try {
+      h.validate(cookie, origin);
+      Assert.fail("MalformedCookieException should have been thrown");
+    } catch (final MalformedCookieException ex) {
+      // expected
+    }
+  }
+
+  @Test
+  public void testDomainMatch1() throws Exception {
+    final BasicClientCookie cookie = new BasicClientCookie("name", "value");
+    final CookieOrigin origin = new CookieOrigin("www.somedomain.com", 80, "/", false);
+    final CookieAttributeHandler h = new SolrPortAwareCookieSpecFactory.PortAwareDomainHandler();
+
+    cookie.setDomain(null);
+    Assert.assertFalse(h.match(cookie, origin));
+
+    cookie.setDomain(".somedomain.com");
+    Assert.assertTrue(h.match(cookie, origin));
+  }
+
+  @Test
+  public void testDomainMatch2() throws Exception {
+    final BasicClientCookie cookie = new BasicClientCookie("name", "value");
+    final CookieOrigin origin = new CookieOrigin("www.whatever.somedomain.com", 80, "/",
false);
+    final CookieAttributeHandler h = new SolrPortAwareCookieSpecFactory.PortAwareDomainHandler();
+
+    cookie.setDomain(".somedomain.com");
+    Assert.assertTrue(h.match(cookie, origin));
+  }
+
+  @Test
+  public void testDomainInvalidInput() throws Exception {
+    final CookieAttributeHandler h = new SolrPortAwareCookieSpecFactory.PortAwareDomainHandler();
+    try {
+      h.match(null, null);
+      Assert.fail("IllegalArgumentException must have been thrown");
+    } catch (final IllegalArgumentException ex) {
+      // expected
+    }
+    try {
+      h.match(new BasicClientCookie("name", "value"), null);
+      Assert.fail("IllegalArgumentException must have been thrown");
+    } catch (final IllegalArgumentException ex) {
+      // expected
+    }
+  }
+
+}



Mime
View raw message