svn commit: r580057 [3/3] - in /db/ojb/trunk/src/xdoclet: ./ java/src/xdoclet/modules/ojb/ java/src/xdoclet/modules/ojb/constraints/ java/src/xdoclet/modules/ojb/model/ test/xdoclet/modules/ojb/tests/
[email protected] Thu, 27 Sep 2007 15:10:11 -0000
| Newsgroups | gmane.comp.jakarta.ojb.devel |
|---|---|
| Message-ID | <[email protected]> |
Modified: db/ojb/trunk/src/xdoclet/test/xdoclet/modules/ojb/tests/ModifyInheritedTagPrimarykeyAttributeTests.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/xdoclet/test/xdoclet/modules/ojb/tests/ModifyInheritedTagPrimarykeyAttributeTests.java?rev=580057&r1=580056&r2=580057&view=diff
==============================================================================
--- db/ojb/trunk/src/xdoclet/test/xdoclet/modules/ojb/tests/ModifyInheritedTagPrimarykeyAttributeTests.java (original)
+++ db/ojb/trunk/src/xdoclet/test/xdoclet/modules/ojb/tests/ModifyInheritedTagPrimarykeyAttributeTests.java Thu Sep 27 08:10:04 2007
@@ -1,20 +1,25 @@
package xdoclet.modules.ojb.tests;
-/* Copyright 2004-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
+
/**
* Tests for the ojb.modify-inherited tag with the primarykey attribute.
*
@@ -562,7 +567,107 @@
" private int id;\n"+
"}\n");
- assertNull(runOjbXDoclet(OJB_DEST_FILE));
- assertNull(runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest"));
+ String result = runOjbXDoclet(OJB_DEST_FILE);
+ //System.out.println("## " + result);
+ assertEquals(
+ "<!-- file containing the repository descriptions for user-defined types -->\n" +
+ "<!-- Generated by the xdoclet-ojb module -->\n" +
+ "\n" +
+ "<class-descriptor\n" +
+ " class=\"test.A\"\n" +
+ " table=\"A\"\n" +
+ ">\n" +
+ " <field-descriptor\n" +
+ " name=\"id\"\n" +
+ " column=\"id\"\n" +
+ " jdbc-type=\"INTEGER\"\n" +
+ " primarykey=\"true\"\n" +
+ " autoincrement=\"true\"\n" +
+ " >\n" +
+ " </field-descriptor>\n" +
+ "</class-descriptor>\n" +
+ "<class-descriptor\n" +
+ " class=\"test.B\"\n" +
+ " table=\"B\"\n" +
+ ">\n" +
+ " <field-descriptor\n" +
+ " name=\"id\"\n" +
+ " column=\"id\"\n" +
+ " jdbc-type=\"INTEGER\"\n" +
+ " primarykey=\"true\"\n" +
+ " access=\"readwrite\"\n" +
+ " >\n" +
+ " </field-descriptor>\n" +
+ " <reference-descriptor\n" +
+ " name=\"super\"\n" +
+ " class-ref=\"test.A\"\n" +
+ " auto-retrieve=\"true\"\n" +
+ " auto-update=\"true\"\n" +
+ " auto-delete=\"true\"\n" +
+ " >\n" +
+ " <foreignkey field-ref=\"id\"/>\n" +
+ " </reference-descriptor>\n" +
+ "</class-descriptor>\n" +
+ "<class-descriptor\n" +
+ " class=\"test.C\"\n" +
+ " table=\"C\"\n" +
+ ">\n" +
+ " <field-descriptor\n" +
+ " name=\"id\"\n" +
+ " column=\"id\"\n" +
+ " jdbc-type=\"INTEGER\"\n" +
+ " primarykey=\"true\"\n" +
+ " access=\"readwrite\"\n" +
+ " >\n" +
+ " </field-descriptor>\n" +
+ " <reference-descriptor\n" +
+ " name=\"super\"\n" +
+ " class-ref=\"test.B\"\n" +
+ " auto-retrieve=\"true\"\n" +
+ " auto-update=\"true\"\n" +
+ " auto-delete=\"true\"\n" +
+ " >\n" +
+ " <foreignkey field-ref=\"id\"/>\n" +
+ " </reference-descriptor>\n" +
+ "</class-descriptor>", result);
+ result = runTorqueXDoclet(TORQUE_DEST_FILE, "ojbtest");
+ //System.out.println("## " + result);
+ assertEquals(
+ "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"no\" ?>\n" +
+ "<!DOCTYPE database SYSTEM \"http://jakarta.apache.org/turbine/dtd/database.dtd\">\n" +
+ "<!-- Generated by the xdoclet-ojb module -->\n" +
+ "\n" +
+ "<database name=\"ojbtest\">\n" +
+ " <table name=\"A\">\n" +
+ " <column name=\"id\"\n" +
+ " javaName=\"id\"\n" +
+ " type=\"INTEGER\"\n" +
+ " primaryKey=\"true\"\n" +
+ " required=\"true\"\n" +
+ " />\n" +
+ " </table>\n" +
+ " <table name=\"B\">\n" +
+ " <column name=\"id\"\n" +
+ " javaName=\"id\"\n" +
+ " type=\"INTEGER\"\n" +
+ " primaryKey=\"true\"\n" +
+ " required=\"true\"\n" +
+ " />\n" +
+ " <foreign-key foreignTable=\"A\">\n" +
+ " <reference local=\"id\" foreign=\"id\"/>\n" +
+ " </foreign-key>\n" +
+ " </table>\n" +
+ " <table name=\"C\">\n" +
+ " <column name=\"id\"\n" +
+ " javaName=\"id\"\n" +
+ " type=\"INTEGER\"\n" +
+ " primaryKey=\"true\"\n" +
+ " required=\"true\"\n" +
+ " />\n" +
+ " <foreign-key foreignTable=\"B\">\n" +
+ " <reference local=\"id\" foreign=\"id\"/>\n" +
+ " </foreign-key>\n" +
+ " </table>\n" +
+ "</database>", result);
}
}
Modified: db/ojb/trunk/src/xdoclet/test/xdoclet/modules/ojb/tests/RunAllTests.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/xdoclet/test/xdoclet/modules/ojb/tests/RunAllTests.java?rev=580057&r1=580056&r2=580057&view=diff
==============================================================================
--- db/ojb/trunk/src/xdoclet/test/xdoclet/modules/ojb/tests/RunAllTests.java (original)
+++ db/ojb/trunk/src/xdoclet/test/xdoclet/modules/ojb/tests/RunAllTests.java Thu Sep 27 08:10:04 2007
@@ -1,21 +1,21 @@
package xdoclet.modules.ojb.tests;
/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
* under the License.
*/
@@ -50,6 +50,7 @@
{
TestSuite suite = new TestSuite("XDoclet OJB module tests");
+// suite.addTest(new TestSuite(InheritanceTests.class));
// suite.addTest(new TestSuite(ClassTagSimpleTests.class));
// suite.addTest(new TestSuite(ClassTagAcceptLocksAttributeTests.class));
// suite.addTest(new TestSuite(ClassTagAttributesAttributeTests.class));
@@ -101,7 +102,7 @@
// suite.addTest(new TestSuite(FieldTagUpdateLockAttributeTests.class));
// suite.addTest(new TestSuite(FieldTagStateDetectionAttributeTests.class));
-//!!!! //suite.addTest(new TestSuite(FieldTagFieldClassAttributeTests.class));
+// suite.addTest(new TestSuite(FieldTagFieldClassAttributeTests.class));
// suite.addTest(new TestSuite(AnonymousFieldTagTests.class));
// suite.addTest(new TestSuite(ReferenceTagAttributesAttributeTests.class));
// suite.addTest(new TestSuite(ReferenceTagAutoDeleteAttributeTests.class));
@@ -138,7 +139,7 @@
// suite.addTest(new TestSuite(CollectionTagOtmDependentAttributeTests.class));
// suite.addTest(new TestSuite(CollectionTagProxyAttributeTests.class));
// suite.addTest(new TestSuite(CollectionTagQueryCustomizerAttributeTests.class));
-
+
// suite.addTest(new TestSuite(CollectionTagRefreshAttributeTests.class));
// suite.addTest(new TestSuite(ModifyInheritedTagSimpleTests.class));
// suite.addTest(new TestSuite(ModifyInheritedTagAccessAttributeTests.class));
@@ -186,7 +187,7 @@
// suite.addTest(new TestSuite(ProcedureArgumentTagTests.class));
-
+
return suite;
}
}