/** * Tries to get the event logger. * <p> * @param props * @return ICacheEventLogger */ protected ICacheEventLogger configureCacheEventLogger( Properties props ) { ICacheEventLogger cacheEventLogger = AuxiliaryCacheConfigurator .parseCacheEventLogger( props, IRemoteHttpCacheConstants.HTTP_CACHE_SERVER_PREFIX ); return cacheEventLogger; }
/** * Tries to get the event logger. * <p> * @param props * @return ICacheEventLogger */ protected static ICacheEventLogger configureCacheEventLogger( Properties props ) { ICacheEventLogger cacheEventLogger = AuxiliaryCacheConfigurator .parseCacheEventLogger( props, IRemoteHttpCacheConstants.HTTP_CACHE_SERVER_PREFIX ); return cacheEventLogger; }
/** * Tries to get the event logger by new and old config styles. * <p> * @param props * @return ICacheEventLogger */ protected static ICacheEventLogger configureCacheEventLogger( Properties props ) { ICacheEventLogger cacheEventLogger = AuxiliaryCacheConfigurator .parseCacheEventLogger( props, IRemoteCacheConstants.CACHE_SERVER_PREFIX ); // try the old way if ( cacheEventLogger == null ) { cacheEventLogger = AuxiliaryCacheConfigurator.parseCacheEventLogger( props, IRemoteCacheConstants.PROPERTY_PREFIX ); } return cacheEventLogger; }
/** * Tries to get the event logger by new and old config styles. * <p> * @param props * @return ICacheEventLogger */ protected static ICacheEventLogger configureCacheEventLogger( Properties props ) { ICacheEventLogger cacheEventLogger = AuxiliaryCacheConfigurator .parseCacheEventLogger( props, IRemoteCacheConstants.CACHE_SERVER_PREFIX ); // try the old way if ( cacheEventLogger == null ) { cacheEventLogger = AuxiliaryCacheConfigurator.parseCacheEventLogger( props, IRemoteCacheConstants.PROPERTY_PREFIX ); } return cacheEventLogger; }
/** * Verify that we don't get an error. */ public void testParseCacheEventLogger_Null() { // SETUP Properties props = new Properties(); // DO WORK MockCacheEventLogger result = (MockCacheEventLogger) AuxiliaryCacheConfigurator.parseCacheEventLogger( props, "junk" ); // VERIFY assertNull( "Should not have a logger.", result ); }
/** * Verify that we don't get an error. */ public void testParseCacheEventLogger_NullName() { // SETUP Properties props = new Properties(); // DO WORK MockCacheEventLogger result = (MockCacheEventLogger) AuxiliaryCacheConfigurator.parseCacheEventLogger( props, null ); // VERIFY assertNull( "Should not have a logger.", result ); }
/** * Verify that we don't get an error. */ public void testParseCacheEventLogger_Null() { // SETUP Properties props = new Properties(); // DO WORK MockCacheEventLogger result = (MockCacheEventLogger) AuxiliaryCacheConfigurator.parseCacheEventLogger( props, "junk" ); // VERIFY assertNull( "Should not have a logger.", result ); }
/** * Verify that we don't get an error. */ public void testParseCacheEventLogger_NullName() { // SETUP Properties props = new Properties(); // DO WORK MockCacheEventLogger result = (MockCacheEventLogger) AuxiliaryCacheConfigurator.parseCacheEventLogger( props, null ); // VERIFY assertNull( "Should not have a logger.", result ); }
/** * Verify that we can parse the event logger. */ public void testParseCacheEventLogger_Normal() { // SETUP String auxPrefix = "jcs.auxiliary." + "MYAux"; String testPropertyValue = "This is the value"; String className = MockCacheEventLogger.class.getName(); Properties props = new Properties(); props.put( auxPrefix + AuxiliaryCacheConfigurator.CACHE_EVENT_LOGGER_PREFIX, className ); props.put( auxPrefix + AuxiliaryCacheConfigurator.CACHE_EVENT_LOGGER_PREFIX + AuxiliaryCacheConfigurator.ATTRIBUTE_PREFIX + ".testProperty", testPropertyValue ); // DO WORK MockCacheEventLogger result = (MockCacheEventLogger) AuxiliaryCacheConfigurator .parseCacheEventLogger( props, auxPrefix ); // VERIFY assertNotNull( "Should have a logger.", result ); assertEquals( "Property should be set.", testPropertyValue, result.getTestProperty() ); }
/** * Verify that we can parse the event logger. */ public void testParseCacheEventLogger_Normal() { // SETUP String auxPrefix = "jcs.auxiliary." + "MYAux"; String testPropertyValue = "This is the value"; String className = MockCacheEventLogger.class.getName(); Properties props = new Properties(); props.put( auxPrefix + AuxiliaryCacheConfigurator.CACHE_EVENT_LOGGER_PREFIX, className ); props.put( auxPrefix + AuxiliaryCacheConfigurator.CACHE_EVENT_LOGGER_PREFIX + AuxiliaryCacheConfigurator.ATTRIBUTE_PREFIX + ".testProperty", testPropertyValue ); // DO WORK MockCacheEventLogger result = (MockCacheEventLogger) AuxiliaryCacheConfigurator .parseCacheEventLogger( props, auxPrefix ); // VERIFY assertNotNull( "Should have a logger.", result ); assertEquals( "Property should be set.", testPropertyValue, result.getTestProperty() ); }
ICacheEventLogger cacheEventLogger = AuxiliaryCacheConfigurator.parseCacheEventLogger( props, auxPrefix );
AuxiliaryCacheConfigurator.parseCacheEventLogger( props, auxPrefix );