Examples of SymbolSource


Examples of org.apache.tapestry5.ioc.services.SymbolSource

    @Test
    public void case_ignored_in_service_id_of_contribute_method()
    {
        Registry r = buildRegistry(CaseInsensitiveContributeMethodModule.class);

        SymbolSource symbolSource = r.getService(SymbolSource.class);

        assertEquals(symbolSource.valueForSymbol("it"), "works");

        r.shutdown();
    }
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.SymbolSource

        Asset coreAsset = mockAsset();
        DocumentLinker linker = mockDocumentLinker();
        Asset asset = mockAsset();
        AssetSource assetSource = mockAssetSource();
        SymbolSource symbolSource = mockSymbolSource();

        train_expandSymbols(symbolSource, CORE_ASSET_PATH_UNEXPANDED, CORE_ASSET_PATH);
        train_getAsset(assetSource, null, CORE_ASSET_PATH, null, coreAsset);

        train_toClientURL(coreAsset, CORE_ASSET_URL);
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.SymbolSource

        String path = "${root}/foo/bar.pdf";
        String expanded = "org/apache/tapestry5/foo/bar.pdf";

        DocumentLinker linker = mockDocumentLinker();
        Asset asset = mockAsset();
        SymbolSource source = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();

        train_expandSymbols(source, path, expanded);

        train_getAsset(assetSource, null, expanded, null, asset);
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.SymbolSource

    {
        String path = "${root}/foo/bar.pdf";
        String expanded = "org/apache/tapestry5/foo/bar.pdf";

        Asset asset = mockAsset();
        SymbolSource source = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();
        JavaScriptSupport js = mockJavaScriptSupport();

        train_expandSymbols(source, path, expanded);
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.SymbolSource

public class ComponentPageElementImplTest extends TestBase {
  /** TAP5-742 */
  @Test public void component_render_tracing() {
    Request request = newMock(Request.class);
    SymbolSource symbolSource = newMock(SymbolSource.class);
   
    Page page = getMocksControl().createMock(Page.class);
    Instantiator instantiator = newMock(Instantiator.class);
    Location location = newMock(Location.class);
    ComponentPageElementResources elementResources = newMock(ComponentPageElementResources.class);
    ComponentModel model = newMock(ComponentModel.class);
   
    getMocksControl().resetToNice();

    expect(instantiator.getModel()).andReturn(model).anyTimes();
   
    // off by default
    expect(symbolSource.valueForSymbol(PRODUCTION_MODE)).andReturn("false");
    expect(symbolSource.valueForSymbol(COMPONENT_RENDER_TRACING_ENABLED)).andReturn("false");
    expect(request.getParameter("t:component-trace")).andReturn("false");
   
    // enable by query parameter
    expect(symbolSource.valueForSymbol(PRODUCTION_MODE)).andReturn("false");
    expect(symbolSource.valueForSymbol(COMPONENT_RENDER_TRACING_ENABLED)).andReturn("false");
    expect(request.getParameter("t:component-trace")).andReturn("true");
   
    // enable by symbol
    expect(symbolSource.valueForSymbol(PRODUCTION_MODE)).andReturn("false");
    expect(symbolSource.valueForSymbol(COMPONENT_RENDER_TRACING_ENABLED)).andReturn("true");
    expect(request.getParameter("t:component-trace")).andReturn("false");
   
    // off no matter what in production mode
    expect(symbolSource.valueForSymbol(PRODUCTION_MODE)).andReturn("true");
    expect(symbolSource.valueForSymbol(COMPONENT_RENDER_TRACING_ENABLED)).andReturn("true");
    expect(request.getParameter("t:component-trace")).andReturn("false");

    replay();
    ComponentPageElementImpl c;  // need to create every time because of changing symbols
   
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.SymbolSource

    @Test
    public void javax_inject_annotation_on_field()
    {
        ObjectLocator ol = mockObjectLocator();
        FieldInjectionViaInject target = new FieldInjectionViaInject();
        final SymbolSource ss = mockSymbolSource();
        InjectionResources ir = newMock(InjectionResources.class);

        IAnswer answer = new IAnswer()
        {
            public Object answer() throws Throwable
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.SymbolSource

    @Test
    public void inject_annotation_on_field()
    {
        ObjectLocator ol = mockObjectLocator();
        FieldInjectionViaInject target = new FieldInjectionViaInject();
        final SymbolSource ss = mockSymbolSource();
        InjectionResources ir = newMock(InjectionResources.class);

        IAnswer answer = new IAnswer()
        {
            public Object answer() throws Throwable
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.SymbolSource

    @Test
    public void case_ignored_in_service_id_of_contribute_method()
    {
        Registry r = buildRegistry(CaseInsensitiveContributeMethodModule.class);

        SymbolSource symbolSource = r.getService(SymbolSource.class);

        assertEquals(symbolSource.valueForSymbol("it"), "works");

        r.shutdown();
    }
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.SymbolSource

    @Test
    public void contributed_values_may_be_coerced_to_correct_type()
    {
        Registry r = buildRegistry(ContributedValueCoercionModule.class);

        SymbolSource source = r.getService(SymbolSource.class);

        assertEquals(source.valueForSymbol("bool-true"), "true");
        assertEquals(source.valueForSymbol("bool-false"), "false");
        assertEquals(source.valueForSymbol("num-12345"), "12345");
    }
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.SymbolSource

    @Test
    public void javax_inject_annotation_on_field()
    {
        ObjectLocator ol = mockObjectLocator();
        FieldInjectionViaInject target = new FieldInjectionViaInject();
        final SymbolSource ss = mockSymbolSource();

        IAnswer answer = new IAnswer()
        {
            public Object answer() throws Throwable
            {
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.