Author: gk
Date: Tue Jan 28 15:47:06 2020
New Revision: 1873257
URL: http://svn.apache.org/viewvc?rev=1873257&view=rev
Log:
- revert torque-site as commons-logging is still used in generated sources
- update hsqldb, fix log4j2 warning in torque-test
Modified:
db/torque/torque4/trunk/torque-ant-tasks/src/main/java/org/apache/torque/ant/task/Torque4JDBCTransformTask.java (contents, props changed)
db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step4.xml
db/torque/torque4/trunk/torque-test/pom.xml
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/ExceptionMapperTest.java
db/torque/torque4/trunk/torque-test/src/test/resources/log4j2-test.xml
Modified: db/torque/torque4/trunk/torque-ant-tasks/src/main/java/org/apache/torque/ant/task/Torque4JDBCTransformTask.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-ant-tasks/src/main/java/org/apache/torque/ant/task/Torque4JDBCTransformTask.java?rev=1873257&r1=1873256&r2=1873257&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-ant-tasks/src/main/java/org/apache/torque/ant/task/Torque4JDBCTransformTask.java (original)
+++ db/torque/torque4/trunk/torque-ant-tasks/src/main/java/org/apache/torque/ant/task/Torque4JDBCTransformTask.java Tue Jan 28 15:47:06 2020
@@ -41,7 +41,7 @@ import org.apache.torque.generator.contr
*
* @author <a href="mailto:[email protected]">Jason van Zyl</a>
* @author <a href="mailto:[email protected]">Fedor Karpelevitch</a>
- * @version $Id: TorqueJDBCTransformTask.java 229738 2005-06-14 20:51:13Z tfischer $
+ * @version $Id$
*/
public class Torque4JDBCTransformTask extends Task
{
Propchange: db/torque/torque4/trunk/torque-ant-tasks/src/main/java/org/apache/torque/ant/task/Torque4JDBCTransformTask.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step4.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step4.xml?rev=1873257&r1=1873256&r2=1873257&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step4.xml (original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/tutorial/orm/step4.xml Tue Jan 28 15:47:06 2020
@@ -151,9 +151,18 @@ torque.dsfactory.bookstore.connection.pa
<subsection name="Logging configuration">
<p>
- Torque uses
+ Torque uses in generated java sources
+ <a href="http://commons.apache.org/logging/">
+ commons-logging</a> as a logging interface.
+ To enable logging in your application, read the
+ <a href="http://commons.apache.org/logging/commons-logging-1.1.1/guide.html">
+ commons-logging user guide</a>.
+ </p>
+
+ </p>
+ Internally Torque uses now
<a href="https://logging.apache.org/log4j/log4j-2.0/index.html">
- Log4j2</a> as a logging interface.
+ Log4j2</a>.
To enable logging in your application, read the
<a href="https://logging.apache.org/log4j/2.x/manual/configuration.html">
configuration guide</a> or <a href="https://logging.apache.org/log4j/log4j-2.0/manual/index.html">Manual</a>.
Modified: db/torque/torque4/trunk/torque-test/pom.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/pom.xml?rev=1873257&r1=1873256&r2=1873257&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/pom.xml (original)
+++ db/torque/torque4/trunk/torque-test/pom.xml Tue Jan 28 15:47:06 2020
@@ -51,7 +51,7 @@
<properties>
<onSqlError>abort</onSqlError>
<torque.test.derby.version>10.14.2.0</torque.test.derby.version>
- <torque.test.hsqldb.version>2.3.1</torque.test.hsqldb.version><!-- 2.5.0 as of june 2019 -->
+ <torque.test.hsqldb.version>2.5.0</torque.test.hsqldb.version><!-- 2.5.0 as of june 2019 -->
<torque.test.mssql.version>1.2.7</torque.test.mssql.version>
<torque.test.mysql.version>8.0.18</torque.test.mysql.version><!-- 5.1.48 , 8.0.18-->
<torque.test.log4j2.version>2.12.1</torque.test.log4j2.version>
@@ -762,7 +762,7 @@
<torque.test.currentTimestampDefault>default="CURRENT_TIMESTAMP"</torque.test.currentTimestampDefault><!-- default="CURRENT_TIMESTAMP" if database supports it -->
<torque.driver>org.hsqldb.jdbcDriver</torque.driver>
<torque.targetDatabase>hsqldb</torque.targetDatabase>
- <torque.database.url>jdbc:hsqldb:target/sqltest;shutdown=true</torque.database.url>
+ <torque.database.url>jdbc:hsqldb:target/sqltest;shutdown=true;hsqldb.lock_file=false</torque.database.url>
<torque.database.user>sa</torque.database.user>
<torque.database.password />
<torque.database.shutdown.url>none</torque.database.shutdown.url>
Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java?rev=1873257&r1=1873256&r2=1873257&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java Tue Jan 28 15:47:06 2020
@@ -1,7 +1,7 @@
package org.apache.torque;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -165,8 +165,8 @@ public abstract class BaseDatabaseTestCa
author.setName("Author " + i);
author.save();
result.add(author);
- assertTrue("authorId should not be 0 after insert",
- author.getAuthorId() != 0);
+ assertTrue(author.getAuthorId() != 0,
+ "authorId should not be 0 after insert");
for (int j = 1; j <= 10; j++)
{
@@ -207,12 +207,12 @@ public abstract class BaseDatabaseTestCa
.and(AuthorPeer.AUTHOR_ID, author.getAuthorId());
criteria.setSingleRecord(true);
List<Author> selectedAuthorList = AuthorPeer.doSelect(criteria);
- assertEquals("Could not find author with id "
- + author.getAuthorId()
- + " and name "
- + author.getName(),
- 1,
- selectedAuthorList.size());
+ assertEquals(1,selectedAuthorList.size(),
+ "Could not find author with id "
+ + author.getAuthorId()
+ + " and name "
+ + author.getName()
+ );
numBooks += author.getBooks().size();
@@ -225,25 +225,25 @@ public abstract class BaseDatabaseTestCa
.and(BookPeer.ISBN, book.getIsbn());
criteria.setSingleRecord(true);
List<Book> selectedBookList = BookPeer.doSelect(criteria);
- assertEquals("Could not find book with id "
- + book.getBookId()
- + " title "
- + book.getTitle()
- + " ISBN "
- + book.getIsbn()
- + " authorId "
- + book.getAuthorId(),
- 1,
- selectedBookList.size());
+ assertEquals(1,
+ selectedBookList.size(),
+ "Could not find book with id "
+ + book.getBookId()
+ + " title "
+ + book.getTitle()
+ + " ISBN "
+ + book.getIsbn()
+ + " authorId "
+ + book.getAuthorId());
}
}
assertEquals(
- toVerify.size(),
- new CountHelper().count(AuthorPeer.getTableMap()));
+ new CountHelper().count(AuthorPeer.getTableMap()),
+ toVerify.size());
assertEquals(
- numBooks,
- new CountHelper().count(BookPeer.getTableMap()));
+ new CountHelper().count(BookPeer.getTableMap()),
+ numBooks);
}
}
Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/ExceptionMapperTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/ExceptionMapperTest.java?rev=1873257&r1=1873256&r2=1873257&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/ExceptionMapperTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/ExceptionMapperTest.java Tue Jan 28 15:47:06 2020
@@ -1,5 +1,8 @@
package org.apache.torque.util;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -37,19 +40,15 @@ import org.apache.torque.test.dbobject.A
import org.apache.torque.test.dbobject.Book;
import org.apache.torque.test.dbobject.SingleNamedUnique;
import org.apache.torque.test.peer.SingleNamedUniquePeer;
+import org.junit.jupiter.api.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertNotNull;
public class ExceptionMapperTest extends BaseDatabaseTestCase
{
/** Sleep time for thread polling, in miliseconds. */
private static int SLEEP_TIME = 10;
- /** Timeout for waiting for started threads and saves, in miliseconds. */
+ /** Timeout for waiting for started threads and saves, in milliseconds. */
private static int TIMEOUT = 50000;
private static Log log = LogFactory.getLog(ExceptionMapperTest.class);
@@ -58,6 +57,7 @@ public class ExceptionMapperTest extends
* Check that a ConstraintViolationException is thrown if a record
* with an already-existing primary key is inserted.
*/
+ @Test
public void testInsertWithPkViolation() throws TorqueException
{
// prepare
@@ -83,6 +83,7 @@ public class ExceptionMapperTest extends
* Check that a ConstraintViolationException is thrown if a record
* with an already-existing unique key is inserted.
*/
+ @Test
public void testUpdateWithUniqueConstraintViolation() throws TorqueException
{
// prepare
@@ -110,6 +111,7 @@ public class ExceptionMapperTest extends
* Check that a ConstraintViolationException is thrown if a record
* is saved which contains null in a non-nullable column
*/
+ @Test
public void testInsertWithNonNullableColumnViolation()
throws TorqueException
{
@@ -134,6 +136,7 @@ public class ExceptionMapperTest extends
* Check that a ConstraintViolationException is thrown if a record
* is saved which has a foreign key to a non-existing object
*/
+ @Test
public void testInsertWithForeignKeyConstraintViolation()
throws TorqueException
{
@@ -162,13 +165,14 @@ public class ExceptionMapperTest extends
*
* @throws Exception if an error occurs.
*/
+ @Test
public void testTransactionDeadlock() throws Exception
{
Adapter adapter
= Torque.getDatabase(Torque.getDefaultDB()).getAdapter();
if (adapter instanceof HsqldbAdapter)
{
- log.warn("hsqldb (2.2.6) fails to detect the deadlock in this test"
+ log.warn("hsqldb (2.2.6- 2.5.0) fails to detect the deadlock in this test"
+ " therefore this test is skipped");
return;
}
Modified: db/torque/torque4/trunk/torque-test/src/test/resources/log4j2-test.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/resources/log4j2-test.xml?rev=1873257&r1=1873256&r2=1873257&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/resources/log4j2-test.xml (original)
+++ db/torque/torque4/trunk/torque-test/src/test/resources/log4j2-test.xml Tue Jan 28 15:47:06 2020
@@ -52,7 +52,6 @@
<AppenderRef ref="console" level="INFO"/>
</Logger>
<Logger name="org.apache.velocity" additivity="false" level="DEBUG">
- <AppenderRef ref="velocity" level="DEBUG"/>
<AppenderRef ref="console" level="DEBUG"/>
</Logger>
<Root level="ERROR"><!-- log4j 1.2 has DEBUG -->
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.