01: /*
02: * User: mrettig
03: * Date: Jun 28, 2002
04: * Time: 3:37:07 PM
05: */
06: package net.sourceforge.jaxor.tests;
07:
08: import junit.framework.TestCase;
09: import net.sourceforge.jaxor.parser.Entity;
10:
11: public class EntityTest extends TestCase {
12:
13: public void testSetAlias() {
14: Entity entity = new Entity("ACCOUNT_CUSTODIAN");
15: entity.setAlias("Account");
16: assertEquals("Account", entity.getJavaName());
17: assertEquals("AccountFinder", entity.getFinderName());
18: assertEquals("AccountEntity", entity.getInterfaceName());
19: }
20:
21: public void testConvertDatabaseNameUppercase() {
22: Entity entity = new Entity("ACCOUNT_CUSTODIAN");
23: assertEquals("AccountCustodian", entity.getJavaName());
24: assertEquals("AccountCustodianFinder", entity.getFinderName());
25: assertEquals("AccountCustodianEntity", entity
26: .getInterfaceName());
27: }
28:
29: public void testConvertDatabaseNameLowercase() {
30: Entity entity = new Entity("account_custodian");
31: assertEquals("AccountCustodian", entity.getJavaName());
32: }
33:
34: public void testConvertDatabaseNameOneWord() {
35: Entity entity = new Entity("account");
36: assertEquals("Account", entity.getJavaName());
37: }
38:
39: public void testConvertDatabaseNameOneCharacter() {
40: Entity entity = new Entity("a");
41: assertEquals("A", entity.getJavaName());
42: }
43: }
|