Author: nbubna
Date: Fri Jul 20 12:33:34 2007
New Revision: 558102
URL: http://svn.apache.org/viewvc?view=rev&rev=558102
Log:
add some plain configuration property tests
Modified:
velocity/tools/branches/2.x/src/test/java/org/apache/velocity/tools/test/whitebox/ConfigTests.java
Modified:
velocity/tools/branches/2.x/src/test/java/org/apache/velocity/tools/test/whitebox/ConfigTests.java
URL:
http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/test/java/org/apache/velocity/tools/test/whitebox/ConfigTests.java?view=diff&rev=558102&r1=558101&r2=558102
==============================================================================
---
velocity/tools/branches/2.x/src/test/java/org/apache/velocity/tools/test/whitebox/ConfigTests.java
(original)
+++
velocity/tools/branches/2.x/src/test/java/org/apache/velocity/tools/test/whitebox/ConfigTests.java
Fri Jul 20 12:33:34 2007
@@ -227,7 +227,22 @@
// a fresh config should be valid
assertValid(conf);
- //TODO: test adding simple and convertable properties
+ // add and retrieve a simple string property
+ conf.setProperty("string", "whatever");
+ assertValid(conf);
+ assertEquals("whatever", conf.getProperty("string"));
+
+ // add and retrieve a simple boolean property
+ conf.setProperty("boolean", "true");
+ assertValid(conf);
+ assertEquals(Boolean.TRUE, conf.getProperty("boolean"));
+
+ // add and retrieve an arbitrary object property
+ conf.setProperty("testclass", this);
+ assertValid(conf);
+ assertSame(this, conf.getProperty("testclass"));
+
+ //TODO: test adding convertable properties
}
public @Test void testBadToolConfig()