Package org.apache.tapestry.ioc.services

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


        train_valueForSymbol(provider, "barney.friends", "${fred} and ${betty}");
        train_valueForSymbol(provider, "fred", null);

        replay();

        SymbolSource source = new SymbolSourceImpl(providers);

        try
        {
            source.valueForSymbol("barney");
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(
View Full Code Here


        train_valueForSymbol(provider, "barney.friends", "${fred} and ${betty");
        train_valueForSymbol(provider, "fred", "Fred");

        replay();

        SymbolSource source = new SymbolSourceImpl(providers);

        try
        {
            source.valueForSymbol("barney");
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(
View Full Code Here

        train_valueForSymbol(provider1, "dino", null);
        train_valueForSymbol(provider2, "dino", "Dino");

        replay();

        SymbolSource source = new SymbolSourceImpl(providers);

        assertEquals(
                source.expandSymbols("Fred's friends are ${fred.friends}."),
                "Fred's friends are Barney and Dino.");

        verify();
    }
View Full Code Here

        train_valueForSymbol(provider, "barney", "Barney");
        train_valueForSymbol(provider, "dino", "Dino");

        replay();

        SymbolSource source = new SymbolSourceImpl(providers);

        assertEquals(source.valueForSymbol("fred"), "Fred's friends are Barney and Dino.");

        verify();

        replay();

        // This time, comes out of the cache.

        assertEquals(source.valueForSymbol("fred"), "Fred's friends are Barney and Dino.");

        verify();
    }
View Full Code Here

        train_valueForSymbol(provider, "barney", "Barney (whose friends are ${barney.friends})");
        train_valueForSymbol(provider, "barney.friends", "${fred} and ${betty}");

        replay();

        SymbolSource source = new SymbolSourceImpl(providers);

        try
        {
            source.valueForSymbol("fred");
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(
View Full Code Here

    }

    @Test
    public void integration_test()
    {
        SymbolSource source = getService(SymbolSource.class);

        // SystemPropertiesSymbolProvider is available by default

        String userName = System.getProperty("user.name");

        assertEquals(source.valueForSymbol("user.name"), userName);
    }
View Full Code Here

        DocumentScriptBuilder builder = newDocumentScriptBuilder();
        Asset asset = newAsset();
        Resource root = newResource();
        Resource file = newResource();
        SymbolSource source = newSymbolSource();
        AssetFactory factory = newAssetFactory();

        train_expandSymbols(source, path, expanded);

        train_getRootResource(factory, root);
View Full Code Here

        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        Inject annotation = newMock(Inject.class);
        AssetSource source = newAssetSource();
        Resource r = newResource();
        SymbolSource symbolSource = newSymbolSource();

        train_findFieldsOfType(ct, InjectAssetWorker.ASSET_TYPE_NAME, "_fred");

        train_getFieldAnnotation(ct, "_fred", Inject.class, annotation);
View Full Code Here

    public void successful_lookup()
    {
        ObjectProvider provider = newObjectProvider();
        ServiceLocator locator = newServiceLocator();
        Runnable r = newRunnable();
        SymbolSource source = newSymbolSource();

        train_expandSymbols(source, "prefix:expression");
        train_provide(provider, "expression", Runnable.class, locator, r);

        replay();
View Full Code Here

    public void symbols_are_expanded()
    {
        ObjectProvider provider = newObjectProvider();
        ServiceLocator locator = newServiceLocator();
        Runnable r = newRunnable();
        SymbolSource source = newSymbolSource();

        train_expandSymbols(source, "${symbol}", "prefix:expression");
        train_provide(provider, "expression", Runnable.class, locator, r);

        replay();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.services.SymbolSource

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.