Search in sources :

Example 1 with EnvironmentalShadowBuilder

use of org.apache.tapestry5.services.EnvironmentalShadowBuilder in project tapestry-5 by apache.

the class EnvironmentalShadowBuilderImplTest method proxy_class.

@Test
public void proxy_class() {
    JavaScriptSupport delegate = newMock(JavaScriptSupport.class);
    Environment env = mockEnvironment();
    train_peekRequired(env, JavaScriptSupport.class, delegate);
    expect(delegate.allocateClientId("fred")).andReturn("barney");
    replay();
    EnvironmentalShadowBuilder builder = new EnvironmentalShadowBuilderImpl(getService("PlasticProxyFactory", PlasticProxyFactory.class), env);
    JavaScriptSupport proxy = builder.build(JavaScriptSupport.class);
    assertEquals(proxy.allocateClientId("fred"), "barney");
    verify();
}
Also used : JavaScriptSupport(org.apache.tapestry5.services.javascript.JavaScriptSupport) Environment(org.apache.tapestry5.services.Environment) EnvironmentalShadowBuilder(org.apache.tapestry5.services.EnvironmentalShadowBuilder) PlasticProxyFactory(org.apache.tapestry5.commons.services.PlasticProxyFactory) Test(org.testng.annotations.Test)

Aggregations

PlasticProxyFactory (org.apache.tapestry5.commons.services.PlasticProxyFactory)1 Environment (org.apache.tapestry5.services.Environment)1 EnvironmentalShadowBuilder (org.apache.tapestry5.services.EnvironmentalShadowBuilder)1 JavaScriptSupport (org.apache.tapestry5.services.javascript.JavaScriptSupport)1 Test (org.testng.annotations.Test)1