+++ /dev/null
-K 25
-svn:wc:ra_dav:version-url
-V 68
-/svn/!svn/ver/3135/product/common/escode.util/test/src/escode/config
-END
-PreferenceTest.java
-K 25
-svn:wc:ra_dav:version-url
-V 88
-/svn/!svn/ver/3123/product/common/escode.util/test/src/escode/config/PreferenceTest.java
-END
-ExpressionParserTest.java
-K 25
-svn:wc:ra_dav:version-url
-V 94
-/svn/!svn/ver/1885/product/common/escode.util/test/src/escode/config/ExpressionParserTest.java
-END
+++ /dev/null
-10
-
-dir
-3304
-http://bravo/svn/product/common/escode.util/test/src/escode/config
-http://bravo/svn
-
-
-
-2012-02-07T00:29:23.967704Z
-3135
-bylee
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-deffe9a1-5acb-4285-bb96-7fb302350b82
-\f
-ExpressionParserTest.java
-file
-
-
-
-
-2012-07-22T09:20:35.000000Z
-405bee8a1d862887cd44cd4b77ca02d0
-2011-09-15T23:44:14.853268Z
-1885
-bylee
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1611
-\f
-PreferenceTest.java
-file
-
-
-
-
-2012-07-22T09:20:35.000000Z
-2fda4d6c8d0b3ac0b89256dc275319e9
-2012-02-03T06:01:04.868665Z
-3123
-bylee
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2560
-\f
-loader
-dir
-\f
+++ /dev/null
-K 13
-svn:mime-type
-V 10
-text/plain
-END
+++ /dev/null
-K 13
-svn:mime-type
-V 10
-text/plain
-END
+++ /dev/null
-package escode.config;
-
-import escode.config.ExpressionParser;
-import escode.config.Preference;
-import escode.util.AbstractTestCase;
-
-
-
-public class
-ExpressionParserTest
-extends AbstractTestCase {
- /* 테스트 환경 초기화 */
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected
- void
- setUp()
- throws Exception {
- final String[][] CONFIGS = new String[][] {
- new String[] { "msg1", "hello" },
- new String[] { "msg2", "${msg3}, ${msg4}!!" },
- new String[] { "msg5", "${msg6}, ${msg7}!!" },
- new String[] { "msg6", "hello" },
- new String[] { "msg7", "world" },
- new String[] { "msg8", "${msg9" },
- new String[] { "msg9", "$abcd" },
- new String[] { "msg10", "^${abc}" }
- };
-
- for ( final String[] CONFIG : CONFIGS )
- {
- final String key = CONFIG[0];
- final String exp = CONFIG[1];
-
- Preference.register( null, key, exp );
- }
- }
-
- protected
- void
- tearDown()
- throws Exception {
- Preference.clear();
-
- super.tearDown();
- }
-
- /**
- * @throws Exception
- *
- * @see {@link ExpressionParser#parse(String)}
- */
- public
- void
- test_parse()
- throws Exception {
- final String[][] TEST_CASES = new String[][] {
- new String[] { "msg1", "hello" },
- new String[] { "msg2", "${msg3}, ${msg4}!!" },
- new String[] { "msg5", "hello, world!!" },
- new String[] { "msg8", "${msg9" },
- new String[] { "msg9", "$abcd" },
- new String[] { "msg10", "${abc}" }
- };
-
-
- for ( final String[] TEST_CASE : TEST_CASES )
- {
- final String key = TEST_CASE[0];
- final String value = TEST_CASE[1];
-
- assertEquals( value, Preference.getValue( key, null ) );
- }
- }
-
-
-}
+++ /dev/null
-package escode.config;\r
-\r
-import java.io.InputStream;\r
-import java.util.Properties;\r
-\r
-import escode.config.Preference;\r
-import escode.config.Rule;\r
-import escode.config.loader.PropertiesLoader;\r
-import escode.util.AbstractTestCase;\r
-import escode.util.StreamUtils;\r
-\r
-\r
-\r
-\r
-public class\r
-PreferenceTest\r
-extends AbstractTestCase\r
-{\r
- /**\r
- * @throws Exception\r
- * \r
- * @see Preference#checkName(String)\r
- */\r
- public void \r
- test_checkName()\r
- throws Exception {\r
- assertTrue( Preference.checkName( "ajfdkfj" ) );\r
- assertTrue( Preference.checkName( "344223" ) );\r
- assertTrue( Preference.checkName( "한글" ) );\r
-\r
- assertFalse( Preference.checkName( "344 223" ) );\r
- }\r
-\r
- /**\r
- * @throws Exception\r
- * \r
- * @see {@link Preference#find(String)}\r
- */\r
- public void\r
- test_find()\r
- throws Exception {\r
- final ClassLoader cl =\r
- Thread.currentThread().getContextClassLoader();\r
-\r
- final InputStream in =\r
- cl.getResourceAsStream( "test.properties" );\r
-\r
- try\r
- {\r
- final Properties props = new Properties();\r
- props.load( in ); \r
-\r
- final PropertiesLoader loader = new PropertiesLoader( props );\r
- loader.load( "test" );\r
-\r
- assertEquals( null, Preference.getValue( "hello", null ) );\r
-\r
- Preference.addRule( new Rule.PatternRule( "*Test", "test" ) );\r
-\r
- assertEquals( "world", Preference.find( "hello" ) );\r
- assertEquals( "${b}", Preference.find( "a" ) );\r
- assertEquals( null, Preference.find( "hello1" ) );\r
-\r
-\r
- }\r
- finally\r
- {\r
- StreamUtils.tryClose( in );\r
- Preference.clear();\r
- Preference.clearRule();\r
- }\r
- }\r
-\r
- /**\r
- * @throws Exception\r
- * \r
- * @see {@link Preference#find(String)}\r
- */\r
- public\r
- void\r
- test_getValue()\r
- throws Exception\r
- {\r
- final ClassLoader cl =\r
- Thread.currentThread().getContextClassLoader();\r
-\r
- final InputStream in =\r
- cl.getResourceAsStream( "test.properties" );\r
-\r
- try\r
- {\r
- final Properties props = new Properties();\r
- props.load( in ); \r
-\r
- final PropertiesLoader loader = new PropertiesLoader( props );\r
- loader.load( "test" );\r
-\r
- assertEquals( null, Preference.getValue( "hello", null ) );\r
-\r
- Preference.addRule( new Rule.PatternRule( "*Test", "test" ) );\r
-\r
- assertEquals( "world", Preference.getValue( "hello", null ) );\r
- assertEquals( "c", Preference.getValue( "a", null ) );\r
- assertEquals( null, Preference.getValue( "hello1", null ) );\r
- assertEquals( "e", Preference.getValue( "hello1", "${d}" ) );\r
- }\r
- finally\r
- {\r
- StreamUtils.tryClose( in );\r
- Preference.clear();\r
- Preference.clearRule();\r
- }\r
- }\r
-\r
-}\r
+++ /dev/null
-K 25
-svn:wc:ra_dav:version-url
-V 75
-/svn/!svn/ver/3135/product/common/escode.util/test/src/escode/config/loader
-END
-StructuredResourceReaderTest.java
-K 25
-svn:wc:ra_dav:version-url
-V 109
-/svn/!svn/ver/3135/product/common/escode.util/test/src/escode/config/loader/StructuredResourceReaderTest.java
-END
+++ /dev/null
-10
-
-dir
-3304
-http://bravo/svn/product/common/escode.util/test/src/escode/config/loader
-http://bravo/svn
-
-
-
-2012-02-07T00:29:23.967704Z
-3135
-bylee
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-deffe9a1-5acb-4285-bb96-7fb302350b82
-\f
-StructuredResourceReaderTest.java
-file
-
-
-
-
-2012-07-22T09:20:35.000000Z
-ec0fc2c324dfb74801d1f833df7287cb
-2012-02-07T00:29:23.967704Z
-3135
-bylee
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-824
-\f
+++ /dev/null
-K 13
-svn:mime-type
-V 10
-text/plain
-END
+++ /dev/null
-package escode.config.loader;
-
-import escode.config.Loader;
-import escode.config.Preference;
-import escode.util.AbstractTestCase;
-
-
-
-
-public class
-StructuredResourceReaderTest
-extends AbstractTestCase
-{
- public
- void
- test_load()
- throws Exception {
- final Source src = new ResourceSource( "logging.ini" );
- final Loader reader = new StructuredResourceReader( src );
- try
- {
-
- reader.load( "escode.logging." );
-
- assertNotNull( Preference.getNamespaces() );
-
- assertEquals( 4, Preference.getNamespaces().size() );
-
- assertEquals( 3, Preference.list( "escode.logging.layout" ).size() );
- assertEquals( 6, Preference.list( "escode.logging.appender" ).size() );
- assertEquals( 8, Preference.list( "escode.logging.logger" ).size() );
- }
- finally
- {
- Preference.clear();
- Preference.clearRule();
- }
- }
-
-}