AssetSourceImpl extends LockSupport implements AssetSource { public Asset getClasspathAsset(String path) { return getClasspathAsset(path, null); } AssetSourceImpl(ThreadLocale threadLocale,

                           Map<String, AssetFactory> configuration, SymbolSource symbolSource, Logger logger, OperationTracker tracker);  AssetSourceImpl(ThreadLocale threadLocale,

                           Map<String, AssetFactory> configuration, SymbolSource symbolSource, Logger logger, OperationTracker tracker, Request request); @PostInjection void clearCacheWhenResourcesChange(ResourceChangeTracker tracker); Asset getClasspathAsset(String path); Asset getClasspathAsset(String path, Locale locale); Asset getContextAsset(String path, Locale locale); Asset getAsset(Resource baseResource, String path, Locale locale); Resource resourceForPath(String path); Asset getExpandedAsset(String path); Asset getComponentAsset(final ComponentResources resources, final String path, final String libraryName); Asset getUnlocalizedAsset(String path);  }
@Test public void get_classpath_asset() { AssetFactory factory = mockAssetFactory(); ThreadLocale threadLocale = mockThreadLocale(); Asset asset = mockAsset(); Resource expectedResource = baseResource.forFile("SimpleComponent_en_GB.properties"); train_getRootResource(factory, rootResource); train_createAsset(factory, expectedResource, asset); Map<String, AssetFactory> configuration = Collections.singletonMap("classpath", factory); replay(); AssetSource source = new AssetSourceImpl(threadLocale, configuration, null, null, tracker); assertSame(source.getClasspathAsset("org/apache/tapestry5/internal/services/SimpleComponent.properties", Locale.UK), asset); verify(); }
@Test public void get_classpath_asset_for_unspecified_locale() { AssetFactory factory = mockAssetFactory(); ThreadLocale threadLocale = mockThreadLocale(); Asset asset = mockAsset(); Locale locale = Locale.UK; Resource expectedResource = baseResource.forFile("SimpleComponent_en_GB.properties"); train_getRootResource(factory, rootResource); train_createAsset(factory, expectedResource, asset); Map<String, AssetFactory> configuration = Collections.singletonMap("classpath", factory); train_getLocale(threadLocale, locale); replay(); AssetSource source = new AssetSourceImpl(threadLocale, configuration, null, null, tracker); assertSame(source.getClasspathAsset("org/apache/tapestry5/internal/services/SimpleComponent.properties"), asset); verify(); }