Package org.apache.hadoop.gateway.util.urltemplate

Examples of org.apache.hadoop.gateway.util.urltemplate.Params.resolve()


    Template template = Parser.parse( "scheme://host:port/dir/file" );

    UrlRewriteContextImpl context = new UrlRewriteContextImpl( environment, resolver, functions, direction, template );

    Params params = context.getParameters();
    List<String> values = params.resolve( "test-env-param-name" );
    assertThat( values, notNullValue() );
    assertThat( values.size(), is( 1 ) );
    assertThat( values.get( 0 ), is( "test-env-param-value" ) );

    values = params.resolve( "test-ctx-param-name" );
View Full Code Here


    List<String> values = params.resolve( "test-env-param-name" );
    assertThat( values, notNullValue() );
    assertThat( values.size(), is( 1 ) );
    assertThat( values.get( 0 ), is( "test-env-param-value" ) );

    values = params.resolve( "test-ctx-param-name" );
    assertThat( values, notNullValue() );
    assertThat( values.size(), is( 1 ) );
    assertThat( values.get( 0 ), is( "test-ctx-param-value" ) );
  }
View Full Code Here

    UrlRewriteEnvironment decEnvironment = EasyMock.createNiceMock( UrlRewriteEnvironment.class );
    EasyMock.expect( decEnvironment.getAttribute( GatewayServices.GATEWAY_SERVICES_ATTRIBUTE ) ).andReturn( gatewayServices ).anyTimes();   
    EasyMock.expect( decEnvironment.getAttribute( GatewayServices.GATEWAY_CLUSTER_ATTRIBUTE ) ).andReturn( "test-cluster-name" ).anyTimes();
    Params decParams = EasyMock.createNiceMock( Params.class );
    EasyMock.expect( decParams.resolve( GatewayServices.GATEWAY_CLUSTER_ATTRIBUTE ) ).andReturn( Arrays.asList("test-cluster-name") ).anyTimes();
    UrlRewriteContext decContext = EasyMock.createNiceMock( UrlRewriteContext.class );
    EasyMock.expect( decContext.getCurrentUrl() ).andReturn( encTemplate.getValue() );
    EasyMock.expect( decContext.getParameters() ).andReturn( decParams );
    Capture<Template> decTemplate = new Capture<Template>();
    decContext.setCurrentUrl( EasyMock.capture( decTemplate ) );
View Full Code Here

    Template template = Parser.parse( "scheme://host:port/dir/file" );

    UrlRewriteContextImpl context = new UrlRewriteContextImpl( environment, resolver, direction, template );

    Params params = context.getParameters();
    List<String> values = params.resolve( "test-env-param-name" );
    assertThat( values, notNullValue() );
    assertThat( values.size(), is( 1 ) );
    assertThat( values.get( 0 ), is( "test-env-param-value" ) );

    values = params.resolve( "test-ctx-param-name" );
View Full Code Here

    List<String> values = params.resolve( "test-env-param-name" );
    assertThat( values, notNullValue() );
    assertThat( values.size(), is( 1 ) );
    assertThat( values.get( 0 ), is( "test-env-param-value" ) );

    values = params.resolve( "test-ctx-param-name" );
    assertThat( values, notNullValue() );
    assertThat( values.size(), is( 1 ) );
    assertThat( values.get( 0 ), is( "test-ctx-param-value" ) );
  }
View Full Code Here

    // Test decryption.  Results are left in decTemplate.

    UrlRewriteEnvironment decEnvironment = EasyMock.createNiceMock( UrlRewriteEnvironment.class );
    EasyMock.expect( decEnvironment.resolve( "cluster.name" ) ).andReturn( Arrays.asList( "test-cluster-name" ) ).anyTimes();
    Params decParams = EasyMock.createNiceMock( Params.class );
    EasyMock.expect( decParams.resolve( "cluster.name" ) ).andReturn( Arrays.asList("test-cluster-name") ).anyTimes();
    UrlRewriteContext decContext = EasyMock.createNiceMock( UrlRewriteContext.class );
    EasyMock.expect( decContext.getCurrentUrl() ).andReturn( encTemplate.getValue() );
    EasyMock.expect( decContext.getParameters() ).andReturn( decParams );
    Capture<Template> decTemplate = new Capture<Template>();
    decContext.setCurrentUrl( EasyMock.capture( decTemplate ) );
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.