Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.AssetSource


        train_getLocale(threadLocale, locale);

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

        assertSame(
                source
                        .getClasspathAsset("org/apache/tapestry/internal/services/SimpleComponent.properties"),
                asset);

        verify();
    }
View Full Code Here


        Map<String, AssetFactory> configuration = Collections.singletonMap("classpath", factory);

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

        assertSame(source.findAsset(
                _baseResource,
                "classpath:org/apache/tapestry/internal/services/SimpleComponent.properties",
                Locale.UK), asset);

        // Check that a leading slash is not a problem:

        assertSame(source.findAsset(
                _baseResource,
                "classpath:/org/apache/tapestry/internal/services/SimpleComponent.properties",
                Locale.UK), asset);

        verify();
View Full Code Here

        Map<String, AssetFactory> configuration = Collections.emptyMap();

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

        try
        {
            source.findAsset(
                    _baseResource,
                    "classpath:org/apache/tapestry/internal/services/SimpleComponent.properties",
                    Locale.UK);
            unreachable();
        }
View Full Code Here

        Map<String, AssetFactory> configuration = Collections.emptyMap();

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

        try
        {
            source.findAsset(_baseResource, "DoesNotExist.properties", Locale.UK);
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(
View Full Code Here

{
    @Test
    public void no_path_annotation()
    {
        SymbolSource symbolSource = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();
        ObjectLocator locator = mockObjectLocator();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();

        String fieldName = "myField";
View Full Code Here

    @Test
    public void path_annotation_present()
    {
        SymbolSource symbolSource = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();
        ObjectLocator locator = mockObjectLocator();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        Path annotation = mockPath();
        Resource baseResource = mockResource();
View Full Code Here

    public void asset_field_with_full_annotation()
    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        Inject annotation = newMock(Inject.class);
        AssetSource source = newMock(AssetSource.class);
        Resource r = newResource();

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

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

TOP

Related Classes of org.apache.tapestry.services.AssetSource

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.