You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by mp...@apache.org on 2003/12/04 10:40:54 UTC
cvs commit: db-torque/src/generator/src/test/org/apache/torque/engine/database/model domaintest-schema.xml DomainTest.java
mpoeschl 2003/12/04 01:40:54
Modified: src/generator/src/test/org/apache/torque/engine/database/model
domaintest-schema.xml DomainTest.java
Log:
more tests
Revision Changes Path
1.5 +6 -0 db-torque/src/generator/src/test/org/apache/torque/engine/database/model/domaintest-schema.xml
Index: domaintest-schema.xml
===================================================================
RCS file: /home/cvs/db-torque/src/generator/src/test/org/apache/torque/engine/database/model/domaintest-schema.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- domaintest-schema.xml 3 Dec 2003 19:05:08 -0000 1.4
+++ domaintest-schema.xml 4 Dec 2003 09:40:54 -0000 1.5
@@ -18,5 +18,11 @@
<column name="decimal_col" type="DECIMAL" size="10" scale="3" />
<column name="date_col" type="DATE"/>
</table>
+
+ <table name="native" idMethod="native">
+ <column name="native_id" required="true" autoIncrement="true"
+ primaryKey="true" type="INTEGER" />
+ <column name="name" size="40" />
+ </table>
</database>
1.6 +21 -2 db-torque/src/generator/src/test/org/apache/torque/engine/database/model/DomainTest.java
Index: DomainTest.java
===================================================================
RCS file: /home/cvs/db-torque/src/generator/src/test/org/apache/torque/engine/database/model/DomainTest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DomainTest.java 3 Dec 2003 19:05:08 -0000 1.5
+++ DomainTest.java 4 Dec 2003 09:40:54 -0000 1.6
@@ -59,7 +59,7 @@
import org.apache.torque.engine.database.transform.XmlToAppData;
/**
- * Tests for domain handling.
+ * Tests for domain handling (for MySql).
*
* @author <a href="mailto:mpoeschl@marmot.at>Martin Poeschl</a>
* @version $Id$
@@ -158,5 +158,24 @@
assertEquals("DATE", col.getType());
assertEquals("DATETIME", col.getDomain().getSqlType());
assertEquals("", col.printSize());
+ }
+
+ public void testNativeAutoincrement() throws Exception
+ {
+ Table table = db.getTable("native");
+ Column col = table.getColumn("native_id");
+ assertEquals("AUTO_INCREMENT", col.getAutoIncrementString());
+ col = table.getColumn("name");
+ assertEquals("", col.getAutoIncrementString());
+ }
+
+ public void testIdBrokerAutoincrement() throws Exception
+ {
+ Table table = db.getTable("article");
+ Column col = table.getColumn("article_id");
+ assertEquals("", col.getAutoIncrementString());
+ col = table.getColumn("name");
+ assertEquals("", col.getAutoIncrementString());
}
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org