Package org.apache.http.conn.scheme

Examples of org.apache.http.conn.scheme.SchemeRegistry.unregister()


            flaghttps = true;
        else
            fail("unexpected name in iterator: " + name);

        assertNotNull(schmreg.get(name));
        schmreg.unregister(name);
        assertNull(schmreg.get(name));

        name = names.get(1);

        if ("http".equals(name)) {
View Full Code Here


            fail("IllegalArgumentException should have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            schmreg.unregister(null);
            fail("IllegalArgumentException should have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
View Full Code Here

        newHackedScheme = new Scheme("https", socketFactory, originalScheme.getDefaultPort());
      }
      else
      {
        newHackedScheme = new Scheme("https", hackedScheme.getSocketFactory(), hackedScheme.getDefaultPort());
        registry.unregister(HACKED_HTTPS_SCHEME_BACKUP);
      }

      Scheme newOriginalScheme = new Scheme(ORIGINAL_HTTPS_SCHEME_BACKUP, originalScheme.getSocketFactory(),
              originalScheme.getDefaultPort());
View Full Code Here

              hackedScheme.getDefaultPort());

      Scheme newOriginalScheme = new Scheme("https", originalScheme.getSocketFactory(), originalScheme
              .getDefaultPort());

      registry.unregister(ORIGINAL_HTTPS_SCHEME_BACKUP);
      registry.register(newHackedScheme);
      registry.register(newOriginalScheme);
    }
  }
View Full Code Here

        newHackedScheme = new Scheme("https", socketFactory, originalScheme.getDefaultPort());
      }
      else
      {
        newHackedScheme = new Scheme("https", hackedScheme.getSocketFactory(), hackedScheme.getDefaultPort());
        registry.unregister(HACKED_HTTPS_SCHEME_BACKUP);
      }

      Scheme newOriginalScheme = new Scheme(ORIGINAL_HTTPS_SCHEME_BACKUP, originalScheme.getSocketFactory(),
              originalScheme.getDefaultPort());
View Full Code Here

              hackedScheme.getDefaultPort());

      Scheme newOriginalScheme = new Scheme("https", originalScheme.getSocketFactory(), originalScheme
              .getDefaultPort());

      registry.unregister(ORIGINAL_HTTPS_SCHEME_BACKUP);
      registry.register(newHackedScheme);
      registry.register(newOriginalScheme);

    }
  }
View Full Code Here

            /*
             No that we've configured our SSLContext we'll make sure our request uses it.
             */
            ClientConnectionManager connMgr = httpclient.getConnectionManager();
            SchemeRegistry schemeReg = connMgr.getSchemeRegistry();
            schemeReg.unregister("https");
            if (port != -1) {
                schemeReg.register(new Scheme("https", sslSocketFactory, port));
            } else {
                /*
                 If the port is -1 it means they were access the server without a port.
View Full Code Here

        Assert.assertSame(http, schmreg.getScheme("http"));
        Assert.assertSame(http, schmreg.getScheme(host));
        Assert.assertSame(https, schmreg.getScheme("https"));
        Assert.assertSame(https, schmreg.getScheme(hosts));

        schmreg.unregister("http");
        schmreg.unregister("https");

        Assert.assertNull(schmreg.get("http")); // get() does not throw exception
        try {
            schmreg.getScheme("http"); // getScheme() does throw exception
View Full Code Here

        Assert.assertSame(http, schmreg.getScheme(host));
        Assert.assertSame(https, schmreg.getScheme("https"));
        Assert.assertSame(https, schmreg.getScheme(hosts));

        schmreg.unregister("http");
        schmreg.unregister("https");

        Assert.assertNull(schmreg.get("http")); // get() does not throw exception
        try {
            schmreg.getScheme("http"); // getScheme() does throw exception
            Assert.fail("IllegalStateException should have been thrown");
View Full Code Here

            flaghttps = true;
        else
            Assert.fail("unexpected name in iterator: " + name);

        Assert.assertNotNull(schmreg.get(name));
        schmreg.unregister(name);
        Assert.assertNull(schmreg.get(name));

        name = names.get(1);

        if ("http".equals(name)) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.