Package org.jclouds.chef.servlet.functions

Examples of org.jclouds.chef.servlet.functions.InitParamsToProperties


  @Test
  public void testApply() {

    final ServletContext servletContext = createMock(ServletContext.class);
    final InitParamsToProperties converter = createMock(InitParamsToProperties.class);
    Properties props = new Properties();
    props.setProperty("foo", "bar");

    expect(servletContext.getContextPath()).andReturn("path");
    expect(servletContext.getServerInfo()).andReturn("serverinfo");
    expect(converter.apply(servletContext)).andReturn(props);

    replay(servletContext);
    replay(converter);

    Injector injector = Guice.createInjector(new GsonModule(),
View Full Code Here


  @Test
  public void testApplyNullPath() {

    final ServletContext servletContext = createMock(ServletContext.class);
    final InitParamsToProperties converter = createMock(InitParamsToProperties.class);
    Properties props = new Properties();
    props.setProperty("foo", "bar");

    expect(servletContext.getContextPath()).andReturn(null);
    expect(servletContext.getServerInfo()).andReturn("serverinfo");
    expect(converter.apply(servletContext)).andReturn(props);

    replay(servletContext);
    replay(converter);

    Injector injector = Guice.createInjector(new GsonModule(),
View Full Code Here

  @Test
  public void testApplyEmptyPath() {

    final ServletContext servletContext = createMock(ServletContext.class);
    final InitParamsToProperties converter = createMock(InitParamsToProperties.class);
    Properties props = new Properties();
    props.setProperty("foo", "bar");

    expect(servletContext.getContextPath()).andReturn("");
    expect(servletContext.getServerInfo()).andReturn("serverinfo");
    expect(converter.apply(servletContext)).andReturn(props);

    replay(servletContext);
    replay(converter);

    Injector injector = Guice.createInjector(new GsonModule(),
View Full Code Here

TOP

Related Classes of org.jclouds.chef.servlet.functions.InitParamsToProperties

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.