Package org.tamacat.httpd.config

Examples of org.tamacat.httpd.config.ServiceUrl


    context = HttpObjectFactory.createHttpContext();
    InetAddress address = InetAddress.getByName("127.0.0.1");
    context.setAttribute(RequestUtils.REMOTE_ADDRESS, address);
    context.setAttribute(AuthComponent.REMOTE_USER_KEY, "admin");
    ServerConfig config = new ServerConfig();
    serviceUrl = new ServiceUrl(config);
    filter.init(serviceUrl);
  }
View Full Code Here


    url = RequestUtils.getRequestURL(request, null);
    assertEquals("http://example.com/test.html", url.toString());
   
    ServerConfig serverConfig = new ServerConfig();
    serverConfig.setParam("Port", "8080");
    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    url = RequestUtils.getRequestURL(request, null, serviceUrl);
    assertEquals("http://example.com:8080/test.html", url.toString());
   
    serverConfig = new ServerConfig();
    serverConfig.setParam("Port", "443");
    serverConfig.setParam("https", "true");
    serviceUrl = new ServiceUrl(serverConfig);
    url = RequestUtils.getRequestURL(request, null, serviceUrl);
    assertEquals("https://example.com/test.html", url.toString());
  }
View Full Code Here

    url = RequestUtils.getRequestHostURL(request, null, null);
    assertEquals("http://example.com", url);
   
    ServerConfig serverConfig = new ServerConfig();
    serverConfig.setParam("Port", "8080");
    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    url = RequestUtils.getRequestHostURL(request, null, serviceUrl);
    assertEquals("http://example.com:8080", url.toString());
   
    serverConfig = new ServerConfig();
    serverConfig.setParam("Port", "443");
    serverConfig.setParam("https", "true");
    serviceUrl = new ServiceUrl(serverConfig);
    url = RequestUtils.getRequestHostURL(request, null, serviceUrl);
    assertEquals("https://example.com", url.toString());   
  }
View Full Code Here

  }
 
  @Test
  public void testGetMonitorConfigDefault() throws Exception {
    LbRoundRobinServiceUrl url = new LbRoundRobinServiceUrl(serverConfig);
    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    serviceUrl.setPath("/");
    DefaultReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://localhost:8080/"));
    MonitorConfig config = url.getMonitorConfig(reverseUrl);
    assertNotNull(config);
    assertEquals("http://localhost:8080/check.html", config.getUrl());
View Full Code Here

  }
 
  @Test
  public void testGetReverseUrls() throws Exception {
    LbRoundRobinServiceUrl url = new LbRoundRobinServiceUrl(serverConfig);
    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    DefaultReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    url.setReverseUrl(reverseUrl);
    assertEquals(1, url.getReverseUrls().size());
  }
View Full Code Here

      url.getReverseUrl();
      fail();
    } catch (ServiceUnavailableException e) {
    }

    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    DefaultReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://192.168.1.11:8080/test/"));
    url.setReverseUrl(reverseUrl);
    assertNotNull(url.getReverseUrl());
   
View Full Code Here

      fail();
    } catch (ServiceUnavailableException e) {
      //OK
    }

    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    DefaultReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://192.168.1.11:8080/test/"));
    url.addTarget(reverseUrl);
    assertNotNull(url.getReverseUrl());
   
View Full Code Here

  }
 
  @Test
  public void testGetMonitorConfig() throws Exception {
    LbRoundRobinServiceUrl url = new LbRoundRobinServiceUrl(serverConfig);
    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    DefaultReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    serviceUrl.setPath("/lb/");

    reverseUrl.setReverse(new URL("http://localhost:8080/lb1/"));
    MonitorConfig config = url.getMonitorConfig(reverseUrl);
    assertNotNull(config);
    assertEquals("http://localhost:8080/lb1/test/check.html", config.getUrl());
View Full Code Here

  @Test
  public void testStartHealthCheck() throws Exception {
    LbRoundRobinServiceUrl url = new LbRoundRobinServiceUrl(serverConfig);
    url.startHealthCheck();
   
    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    DefaultReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://192.168.1.11:8080/test/"));
    url.addTarget(reverseUrl);
   
    url.startHealthCheck();
View Full Code Here

  HttpContext context;
 
  @Before
  public void setUp() throws Exception {
    config = new ServerConfig();
    ServiceUrl serviceUrl = new ServiceUrl(config);
    auth = new BasicAuthProcessor();
    auth.init(serviceUrl);
   
    TestAuthComponent authComponent = new TestAuthComponent();
    authComponent.setAuthUsername("admin");
View Full Code Here

TOP

Related Classes of org.tamacat.httpd.config.ServiceUrl

Copyright © 2018 www.massapicom. 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.