/** * Verify that we can parse the ElementSerializer. */ public void testParseElementSerializer_Null() { // SETUP Properties props = new Properties(); // DO WORK IElementSerializer result = AuxiliaryCacheConfigurator .parseElementSerializer( props, "junk" ); // VERIFY assertTrue( "Should have the default Serializer.", result instanceof StandardSerializer ); } }
/** * Verify that we can parse the ElementSerializer. */ public void testParseElementSerializer_Null() { // SETUP Properties props = new Properties(); // DO WORK IElementSerializer result = AuxiliaryCacheConfigurator .parseElementSerializer( props, "junk" ); // VERIFY assertTrue( "Should have the default Serializer.", result instanceof StandardSerializer ); } }
/** * Verify that we can parse the ElementSerializer. */ public void testParseElementSerializer_Normal() { // SETUP String auxPrefix = "jcs.auxiliary." + "MYAux"; String testPropertyValue = "This is the value"; String className = MockElementSerializer.class.getName(); Properties props = new Properties(); props.put( auxPrefix + AuxiliaryCacheConfigurator.SERIALIZER_PREFIX, className ); props.put( auxPrefix + AuxiliaryCacheConfigurator.SERIALIZER_PREFIX + AuxiliaryCacheConfigurator.ATTRIBUTE_PREFIX + ".testProperty", testPropertyValue ); // DO WORK MockElementSerializer result = (MockElementSerializer) AuxiliaryCacheConfigurator .parseElementSerializer( props, auxPrefix ); // VERIFY assertNotNull( "Should have a Serializer.", result ); assertEquals( "Property should be set.", testPropertyValue, result.getTestProperty() ); }
/** * Verify that we can parse the ElementSerializer. */ public void testParseElementSerializer_Normal() { // SETUP String auxPrefix = "jcs.auxiliary." + "MYAux"; String testPropertyValue = "This is the value"; String className = MockElementSerializer.class.getName(); Properties props = new Properties(); props.put( auxPrefix + AuxiliaryCacheConfigurator.SERIALIZER_PREFIX, className ); props.put( auxPrefix + AuxiliaryCacheConfigurator.SERIALIZER_PREFIX + AuxiliaryCacheConfigurator.ATTRIBUTE_PREFIX + ".testProperty", testPropertyValue ); // DO WORK MockElementSerializer result = (MockElementSerializer) AuxiliaryCacheConfigurator .parseElementSerializer( props, auxPrefix ); // VERIFY assertNotNull( "Should have a Serializer.", result ); assertEquals( "Property should be set.", testPropertyValue, result.getTestProperty() ); }
IElementSerializer elementSerializer = AuxiliaryCacheConfigurator.parseElementSerializer( props, auxPrefix );
AuxiliaryCacheConfigurator.parseElementSerializer( props, auxPrefix );