You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by dl...@apache.org on 2003/08/27 03:50:07 UTC
cvs commit: jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/strategy TestHyphenatedNameMapper.java
dlr 2003/08/26 18:50:07
Modified: betwixt/src/test/org/apache/commons/betwixt/strategy
TestHyphenatedNameMapper.java
Log:
* src/test/org/apache/commons/betwixt/strategy/TestHyphenatedNameMapper.java
testLowerCaseViaBeanDescriptor(): A new test case which uses
BeanDescriptor as input for testing a lower case mapping.
Revision Changes Path
1.6 +14 -8 jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/strategy/TestHyphenatedNameMapper.java
Index: TestHyphenatedNameMapper.java
===================================================================
RCS file: /home/cvs/jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/strategy/TestHyphenatedNameMapper.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -u -r1.5 -r1.6
--- TestHyphenatedNameMapper.java 30 Dec 2002 18:16:48 -0000 1.5
+++ TestHyphenatedNameMapper.java 27 Aug 2003 01:50:07 -0000 1.6
@@ -62,6 +62,7 @@
package org.apache.commons.betwixt.strategy;
+import java.beans.BeanDescriptor;
import java.util.ArrayList;
import junit.framework.Test;
@@ -93,6 +94,13 @@
assertEquals("foo-bar", result);
}
+ public void testLowerCaseViaBeanDescriptor() {
+ HyphenatedNameMapper mapper = new HyphenatedNameMapper(false, "_");
+ BeanDescriptor bd = new BeanDescriptor(getClass());
+ String result = mapper.mapTypeToElementName(bd.getName());
+ assertEquals("test_hyphenated_name_mapper", result);
+ }
+
public void testUpperCase() {
HyphenatedNameMapper mapper = new HyphenatedNameMapper(true, "_");
String result = mapper.mapTypeToElementName("FooBar");
@@ -115,9 +123,8 @@
String result = mapper.mapTypeToElementName("FooBarFooBar");
assertEquals("FOO__BAR__FOO__BAR", result);
- }
+ }
-
public void testBeanWithAdd() throws Exception {
//
// simple test this one
@@ -130,4 +137,3 @@
introspector.introspect(new ArrayList());
}
}
-