CSSModuleBuilder extends TextModuleBuilder implements  IExtensionInitializer, IExtensionSingleton, IShutdownListener, IConfigListener { @Override public List<ICacheKeyGenerator> getCacheKeyGenerators(IAggregator aggregator) { return s_cacheKeyGenerators; } CSSModuleBuilder(); protected  CSSModuleBuilder(IAggregator aggregator, ExecutorService es, int scopePoolSize); @Override List<ICacheKeyGenerator> getCacheKeyGenerators(IAggregator aggregator); @Override boolean handles(String mid, IResource resource); @Override void shutdown(IAggregator aggregator); @Override void initialize(IAggregator aggregator,
			IAggregatorExtension extension, IExtensionRegistrar registrar); @Override void configLoaded(IConfig conf, long sequence); String dequote(String in); static final String INLINEIMPORTS_CONFIGPARAM; static final String INCLUDELIST_CONFIGPARAM; static final String EXCLUDELIST_CONFIGPARAM; static final String IMAGETYPES_CONFIGPARAM; static final String SIZETHRESHOLD_CONFIGPARAM; static final String INCLUDEAMDPATHS_CONFIGPARAM; static final String POSTCSSPLUGINS_CONFIGPARAM; static final String SCOPEPOOLSIZE_CONFIGPARAM; static final String POSTCSS_CONFIGPARAM; static final boolean INLINEIMPORTS_DEFAULT_VALUE; static final boolean INCLUDEAMDPATHS_DEFAULT_VALUE; static final int SIZETHRESHOLD_DEFAULT_VALUE; static final String INLINEIMPORTS_REQPARAM_NAME; static final String INLINEIMAGES_REQPARAM_NAME; static final String PREAMBLE; static final String BLANK; static final String UTF8_CHARSET; static final String POSTCSS_RES_NAME; static final String MINIFYER_RES_NAME; static final String POSTCSS; static final String PROCESS; static final String PLUGINS; static final String POSTCSS_INSTANCE; static final String MODULE; static final String EXPORTS; static final String AMD_DEFINE_SHIM_JS; static final String MINIFIER_INITIALIZATION_VAR; static final String MINIFIER_INITIALIZATION_JS; static final Map<String, Boolean> POSTCSS_OPTIONS; static final int INITIALIZER_THREAD_POOL_SIZE; static final int DEFAULT_SCOPE_POOL_SIZE; static final int SCOPE_POOL_TIMEOUT_SECONDS; public int imageSizeThreshold; public boolean inlineImports; public boolean includeAMDPaths; public Collection<Pattern> inlinedImageExcludeList; }
@Test public void testCacheKeyGen() throws Exception { List<ICacheKeyGenerator> keyGens = builder.getCacheKeyGenerators(mockAggregator); Assert.assertEquals("txt:0:0;css:0:0:0", KeyGenUtil.generateKey(mockRequest, keyGens)); requestParams.put(CSSModuleBuilder.INLINEIMAGES_REQPARAM_NAME, new String[]{"true"}); Assert.assertEquals("txt:0:0;css:0:1:0", KeyGenUtil.generateKey(mockRequest, keyGens)); requestParams.put(CSSModuleBuilder.INLINEIMPORTS_REQPARAM_NAME, new String[]{"true"}); Assert.assertEquals("txt:0:0;css:1:1:0", KeyGenUtil.generateKey(mockRequest, keyGens)); requestAttributes.put(IHttpTransport.EXPORTMODULENAMES_REQATTRNAME, Boolean.TRUE); Assert.assertEquals("txt:0:1;css:1:1:0", KeyGenUtil.generateKey(mockRequest, keyGens)); requestAttributes.put(IHttpTransport.SHOWFILENAMES_REQATTRNAME, Boolean.TRUE); Assert.assertEquals("txt:0:1;css:1:1:1", KeyGenUtil.generateKey(mockRequest, keyGens)); }