svn commit: r1879887 - in /db/torque/torque4/trunk: ./ torque-ant-tasks/src/test/torqueJDBC2SchemaTaskTest/src/main/xsd/ torque-maven-plugin/ torque-runtime/ torque-site/ torque-templates/src/main/resources/org/apache/torque/templates/xsd/ torque-test/...

[email protected]
Newsgroups gmane.comp.jakarta.turbine.torque.devel
Message-ID <[email protected]>
Author: gk
Date: Wed Jul 15 12:54:32 2020
New Revision: 1879887

URL: http://svn.apache.org/viewvc?rev=1879887&view=rev
Log:
- fix tests in DatabaseMapTest.java
- update commons dependencies
- fix java 14 issue in javadoc
- update README.md

Removed:
    db/torque/torque4/trunk/torque-ant-tasks/src/test/torqueJDBC2SchemaTaskTest/src/main/xsd/database-4-1-strict.xsd
    db/torque/torque4/trunk/torque-ant-tasks/src/test/torqueJDBC2SchemaTaskTest/src/main/xsd/database-4-1.xsd
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/xsd/database-4-1-strict.xsd
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/xsd/database-4-1.xsd
Modified:
    db/torque/torque4/trunk/README.md
    db/torque/torque4/trunk/pom.xml
    db/torque/torque4/trunk/torque-maven-plugin/pom.xml
    db/torque/torque4/trunk/torque-runtime/pom.xml
    db/torque/torque4/trunk/torque-site/pom.xml
    db/torque/torque4/trunk/torque-test/README.md
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java

Modified: db/torque/torque4/trunk/README.md
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/README.md?rev=1879887&r1=1879886&r2=1879887&view=diff
==============================================================================
--- db/torque/torque4/trunk/README.md (original)
+++ db/torque/torque4/trunk/README.md Wed Jul 15 12:54:32 2020
@@ -25,7 +25,7 @@
 
 ## Requirements
 - Version 5 requires Java 8. 
-- Build tested with Java 8 and Tests run with JAva 8 and 14. Building with Java 11 or higher might require some fixes.
+- Build and Tests run with Java 8 and 14. Building with Java 11 may require some fixes.
 
 ### Modules
 

Modified: db/torque/torque4/trunk/pom.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/pom.xml?rev=1879887&r1=1879886&r2=1879887&view=diff
==============================================================================
--- db/torque/torque4/trunk/pom.xml (original)
+++ db/torque/torque4/trunk/pom.xml Wed Jul 15 12:54:32 2020
@@ -25,7 +25,7 @@
   <parent>
      <groupId>org.apache</groupId>
      <artifactId>apache</artifactId>
-     <version>21</version>
+     <version>23</version>
   </parent>
   
   <groupId>org.apache.torque</groupId>
@@ -347,7 +347,7 @@
       <dependency>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-configuration2</artifactId>
-         <version>2.5</version>
+         <version>2.7</version>
       </dependency>
   
       <dependency>
@@ -377,13 +377,13 @@
       <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-lang3</artifactId>
-        <version>3.8.1</version>
+        <version>3.10</version>
       </dependency>
   
       <dependency>
         <groupId>commons-io</groupId>
         <artifactId>commons-io</artifactId>
-        <version>2.6</version>
+        <version>2.7</version>
       </dependency>
 
       <dependency>
@@ -608,7 +608,8 @@
         <artifactId>maven-javadoc-plugin</artifactId>
         <version>3.2.0</version>
         <configuration>
-        <additionalparam>-Xdoclint:none</additionalparam>
+            <additionalparam>-Xdoclint:none</additionalparam>
+            <source>1.8</source>
         </configuration>
       </plugin>
       <plugin>

Modified: db/torque/torque4/trunk/torque-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-maven-plugin/pom.xml?rev=1879887&r1=1879886&r2=1879887&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-maven-plugin/pom.xml (original)
+++ db/torque/torque4/trunk/torque-maven-plugin/pom.xml Wed Jul 15 12:54:32 2020
@@ -66,6 +66,12 @@
       <version>3.6.0</version>
       <!-- annotations are not used at runtime because @Retention(value=CLASS), they are needed only to build the plugin -->
       <optional>true</optional> 
+       <exclusions>
+            <exclusion> 
+               <groupId>*</groupId>
+               <artifactId>*</artifactId>
+            </exclusion>
+        </exclusions> 
     </dependency>
     <dependency>
       <!-- 
@@ -122,6 +128,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-plugin-plugin</artifactId>
+         <version>3.5.2</version>
       </plugin>
     </plugins>
   </reporting>

Modified: db/torque/torque4/trunk/torque-runtime/pom.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/pom.xml?rev=1879887&r1=1879886&r2=1879887&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/pom.xml (original)
+++ db/torque/torque4/trunk/torque-runtime/pom.xml Wed Jul 15 12:54:32 2020
@@ -97,12 +97,8 @@
         <version>1.0.8</version>
         <exclusions>
             <exclusion> 
-               <groupId>org.junit.jupiter</groupId>
-               <artifactId>junit-jupiter-api</artifactId>
-            </exclusion>
-            <exclusion> 
-               <groupId>org.junit.jupiter</groupId>
-               <artifactId>junit-jupiter-engine</artifactId>
+               <groupId>*</groupId>
+               <artifactId>*</artifactId>
             </exclusion>
         </exclusions> 
         <scope>test</scope>

Modified: db/torque/torque4/trunk/torque-site/pom.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/pom.xml?rev=1879887&r1=1879886&r2=1879887&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/pom.xml (original)
+++ db/torque/torque4/trunk/torque-site/pom.xml Wed Jul 15 12:54:32 2020
@@ -205,7 +205,7 @@
         <torque.test.idmethod>native</torque.test.idmethod>
         <torque.test.driver.artifactId>derby</torque.test.driver.artifactId>
         <torque.test.driver.groupId>org.apache.derby</torque.test.driver.groupId>
-        <torque.test.driver.version>10.8.2.2</torque.test.driver.version>
+        <!--torque.test.driver.version>10.8.2.2</torque.test.driver.version-->
         <torque.driver>org.apache.derby.jdbc.EmbeddedDriver</torque.driver>
         <torque.targetDatabase>derby</torque.targetDatabase>
         <torque.database.url>jdbc:derby:torque-test/target/bookstore;create=true</torque.database.url>

Modified: db/torque/torque4/trunk/torque-test/README.md
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/README.md?rev=1879887&r1=1879886&r2=1879887&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/README.md (original)
+++ db/torque/torque4/trunk/torque-test/README.md Wed Jul 15 12:54:32 2020
@@ -16,7 +16,7 @@ mvn clean test -P<data-type>,managers,be
 
 Running tests against a non-memory or non-docker-containerized database requires a host-based database to be installed and running.
 
- ### Profiles
+### Database Profiles
  
 Find more details about database and db user settings in the profile. 
 
@@ -26,6 +26,33 @@ Find more details about database and db
 src/test/profile/<database>/
 ```
 
+#### Provided profiles for databases
+
+- derby
+- derbyEmbedded
+- hsqldb
+- mssql
+- mysql
+- oracle
+- postgresql
+
+#### Maven profiles
+
+Each database proifle is mapped to a Maven profile, but additional maven profiles exist:
+
+- derbyEmbedded-jenkins: derby profile with default settings. Can only be run from parent project with `mvn -Ptest,derbyEmbedded-jenkins install` because database url is adjusted to this start location
+
+- hsqldb-jenkins: see above.
+
+- docker-testcontainer: Profile activates docker based test environment instead of host based.
+
+- apache-release: profile activates **derbyEmbedded** profile.
+
+- beans: has to be actived for tests; triggers bean generation + test
+
+- managers: has to be actived for tests; triggers use of managers generation + test
+
+
 ## Workflow Internals
 
 - check `src/main/schema` for the source schemas and the results in `target/generated-*` folders.
@@ -42,11 +69,11 @@ src/test/profile/<database>/
 
 ### Dockerized databases
 
-- This uses Docker Testcontainers. Find more information here: https://www.testcontainers.org/.
+- This uses Docker Testcontainers. Find more information here: (https://www.testcontainers.org/).
 
-- Tests should be run sequential, not parallel: https://www.testcontainers.org/test_framework_integration/junit_5/.
+- Tests should be run sequential, not parallel: (https://www.testcontainers.org/test\_framework\_integration/junit_5/).
 
-- Additional Requirements (Junit 5): https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html
+- Additional Requirements (Junit 5): (https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html)
 
 - Currently only **mysql** and **postgresql** adapter is supported (and selected tests). 
 
@@ -62,11 +89,14 @@ or instead of mysql replace with postgre
 
 A successfull connection will result in a message like this 
 
-	INFO  | org.testcontainers.dockerclient.DockerClientProviderStrategy - Found Docker environment with Docker for Windows (via TCP port 2375)
+	org.testcontainers.dockerclient.DockerClientProviderStrategy - Found Docker environment with Docker for Windows 
+	(via TCP port ...)
 	
 or 
 
-	INFO  | org.testcontainers.dockerclient.DockerClientProviderStrategy - Found Docker environment with Environment variables, system properties and defaults. Resolved dockerHost=unix:///var/run/docker.sock
+	org.testcontainers.dockerclient.DockerClientProviderStrategy - Found Docker environment with Environment variables, 
+	system properties and defaults. 
+	Resolved dockerHost=unix:///var/run/docker.sock
 
 If you get 
 
@@ -74,30 +104,28 @@ If you get
     no read/writable '/var/run/docker.sock' or '//./pipe/docker_engine'        
     and no external provider like Docker machine configured
     
-Docker Desktop (Windows) or docker is not running. If the error still shows up after starting, 
-you may configure and check your system. Provide in **docker-java.properties** DOCKER_HOST or other environment variables.
-find a templates in *src/test<database>/docker-resources/db*.
+Docker Desktop (Windows) or docker is not running. If the error still shows up after starting, you may configure and check your system. Provide in **docker-java.properties** DOCKER_HOST or other environment variables.
+Find a templates in *src/test<database>/docker-resources/db*.
 
 
 ##### Docker image (Profile docker-textcontainer)
 
-Change into folder torque-test and check configuration files testcontainers.properties and docker-java.properties 
+Change into folder torque-test and check configuration files *testcontainers.properties* and *docker-java.properties* 
 in folder `src/test/profile/<profile>/docker-resources`.
 
 
 ###### Docker OS System Adjustments
 
-__Docker-maven-plugin and Docker Testcontainters needs appropriate environment settings__:
+__Docker-maven-plugin and Docker Testcontainers needs appropriate environment settings__:
 
-* **Docker-Maven-Plugin** automatically checks the OS system and which URL to use to communicate with the docker daemon. Testcontainers expects settings in `docker-java.properties` [1],[2].
+* **Docker-Maven-Plugin** automatically checks the OS system and which URL to use to communicate with the docker daemon. Testcontainers expects [settings][1] in [docker-java.properties][2].
  
 Find the file docker-java.properties in: `src/test/profile/mysql/docker-resources`.
  
 * Docker daemon: By default setting the environment variable DOCKER_HOST ( URI / daemon ) is required or an exposed daemon port. 
 
-Set it appropriately in `docker-java.properties`. (e.g. activate the daemon without TLS in Windows 10 in Docker Desktop or set it later by using an appropriate 
-(custom) Docker daemon [https://docs.microsoft.com/de-de/virtualization/windowscontainers/manage-docker/configure-docker-daemon] 
-in the default folders by creating a `daemon.json` file.
+Set it appropriately in `docker-java.properties`. (e.g. activate the daemon without TLS in Windows 10 in Docker Desktop or set it later by using an appropriate (custom) [Docker daemon][3] 
+in the default folders by creating a `daemon.json` file. You may want to upgrade to wsl2 (native linux kernel), find more information here: [WSL][4]. 
 
 * Windows system 7 and below without hyperv may require starting docker using `docker-machine start <id>`, environment check with `docker-machine env <id>` and setting it in shell and testcontainer-settings.
 
@@ -108,8 +136,9 @@ mvn clean test -P mysql,docker-testconta
 ```
 
 [1]: org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy 
-[2]: (https://raw.githubusercontent.com/docker-java/docker-java/master/docker-java-core/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java).
-
+[2]: https://raw.githubusercontent.com/docker-java/docker-java/master/docker-java-core/src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java
+[3]: https://docs.microsoft.com/de-de/virtualization/windowscontainers/manage-docker/configure-docker-daemon
+[4]: https://docs.docker.com/docker-for-windows/wsl/
 
 #### Run test with Docker-Testcontainer
 
@@ -167,18 +196,19 @@ mvn eclipse:eclipse -P mysql,docker-test
 
 ### Maven Database Test with Remote Standard Socket Attachment
 
-Example: Attach example opens port 8000 per default
+Example: Attach example opens port 8000 per default, but forkMode is already deprecated, but change as convenient.
 
-// forkMode already deprecated, but change as convenient.
-`mvnDebug test -Dtest=DataTest#testLikeClauseEscaping -Pmysql -DforkCount=0`
+	mvnDebug test -Dtest=DataTest#testLikeClauseEscaping -Pmysql -DforkCount=0
 
 * or set `<forkCount>0</forkCount>` in pom.xml.
 
-Alternatively use Surefire debugging:
+Alternatively use [Surefire debugging][https://maven.apache.org/surefire/maven-surefire-plugin/examples/debugging.html]:
 
- mvn -Dmaven.surefire.debug test
+	mvn -Dmaven.surefire.debug test
 
 ## TODO
+
+- Profiles managers,beans seem to be required always in testss
 - Use Java Testcontainers Docker in other database settings ...
 
 

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java?rev=1879887&r1=1879886&r2=1879887&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java Wed Jul 15 12:54:32 2020
@@ -329,7 +329,7 @@ public class DocsTest extends BaseDataba
     }
 
     /**
-     * Criteria Howto, section "Join & Order & Distinct".
+     * Criteria Howto, section <pre>Join &amp; Order &amp; Distinct</pre>
      */
     @Test
     public void testJoinOrderDistinct()

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java?rev=1879887&r1=1879886&r2=1879887&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java Wed Jul 15 12:54:32 2020
@@ -60,8 +60,6 @@ public class DatabaseMapTest extends Bas
                 "id", "one", "two", "three"
         };
 
-    // Hack to store exception thrown by test in static initializer
-    private static Throwable testDatabaseMapInitializeResult = null;
 
     /**
      * Test initializing the default database. <p> Assumptions: <ul> A table
@@ -71,9 +69,8 @@ public class DatabaseMapTest extends Bas
      */
     @Order(1)
     @Test
-    public void doTestDatabaseMapInitialize() throws Exception
+    public void testDatabaseMapInitialize() throws Exception
     {
-    	try {
 	        // Get default schema DB
 	        DatabaseMap map = Torque.getDatabaseMap(DATABASE_NAME);
 	        TableMap tMap = map.getTable(TABLE_NAME1);
@@ -83,29 +80,10 @@ public class DatabaseMapTest extends Bas
 	                       );
 	        map.initialize();
 	        tMap = map.getTable(TABLE_NAME1);
-	        assertTrue( tMap == null,
+	        assertTrue( tMap != null,
 	                "Did not find table named NotUsedBeforeMapInit after " +
 	                        "initialization!"
 	                		);
-    	} catch (Throwable t)
-	    {
-	          testDatabaseMapInitializeResult = t;
-        }
-    }
-
-    /**
-     * Reports the result of the testDatabaseMapInitialize Test.
-     *
-     * @throws Throwable if the test has failed.
-     */
-    @Test
-    @Order(2)
-    public void testDatabaseMapInitialize() throws Throwable
-    {
-        if (testDatabaseMapInitializeResult != null)
-        {
-            throw testDatabaseMapInitializeResult;
-        }
     }
 
     /**
@@ -120,7 +98,7 @@ public class DatabaseMapTest extends Bas
      * @throws TorqueException
      */
     @Test
-    @Order(3)
+    @Order(2)
     public void testColumnOrder() throws TorqueException
     {
         DatabaseMap map = Torque.getDatabaseMap(DATABASE_NAME);
@@ -156,21 +134,23 @@ public class DatabaseMapTest extends Bas
      * @throws TorqueException
      */
     @Test
-    @Order(4)
+    @Order(3)
     public void testTableOrder() throws TorqueException
     {
         DatabaseMap map = Torque.getDatabaseMap(DATABASE_NAME);
         map.initialize();
         TableMap[] tables = map.getTables();
-        assertEquals("XML Table order not preserved!\nDid not find table '"
-                + TABLE_NAME1 + "' in DatabaseMap.getTables() array!",
-                TABLE_NAME1,
-                tables[0].getName());
-        assertEquals("XML Table order not preserved!\nDid not find table '"
-                + TABLE_NAME2 + "' after '" + TABLE_NAME1
-                + " in DatabaseMap.getTables() array!",
+        assertEquals(
+        		TABLE_NAME1,
+                tables[0].getName(),
+                "XML Table order not preserved!\nDid not find table '"
+                        + TABLE_NAME1 + "' in DatabaseMap.getTables() array!");
+        assertEquals(
                 TABLE_NAME2,
-                tables[1].getName());
+                tables[1].getName(),
+                "XML Table order not preserved!\nDid not find table '"
+                        + TABLE_NAME2 + "' after '" + TABLE_NAME1
+                        + " in DatabaseMap.getTables() array!");
     }
 
     /**
@@ -179,7 +159,6 @@ public class DatabaseMapTest extends Bas
      * @throws TorqueException
      */
     @Test
-    @Order(5)
     public void testExternalSchemaTables() throws TorqueException
     {
         DatabaseMap map = Torque.getDatabaseMap();
@@ -197,7 +176,6 @@ public class DatabaseMapTest extends Bas
      * Test that various table properties get set correctly from the XML
      */
     @Test
-    @Order(6)
     public void testTableAttributes() throws TorqueException
     {
         DatabaseMap map = Torque.getDatabaseMap(DATABASE_NAME);
@@ -224,7 +202,6 @@ public class DatabaseMapTest extends Bas
      * Test that various column properties get set correctly from the XML
      */
     @Test
-    @Order(7)
     public void testColumnAttributes() throws TorqueException
     {
         DatabaseMap map = Torque.getDatabaseMap(DATABASE_NAME);
@@ -275,7 +252,6 @@ public class DatabaseMapTest extends Bas
      * Test that the foreign key properties get set correctly from the XML
      */
     @Test
-    @Order(8)
     public void testForeignKeyAttributes() throws TorqueException
     {
         DatabaseMap map = Torque.getDatabaseMap(DATABASE_NAME);
@@ -299,7 +275,6 @@ public class DatabaseMapTest extends Bas
      * Test that Inheritance info is stored correctly
      */
     @Test
-    @Order(9)
     public void testInheritanceMapping() throws TorqueException
     {
         DatabaseMap map = Torque.getDatabaseMap(DATABASE_NAME);
@@ -334,7 +309,6 @@ public class DatabaseMapTest extends Bas
      * Test for controlled error on getting invalid database
      */
     @Test
-    @Order(10)
     public void testInvalidDatabaseName() throws TorqueException
     {
         DatabaseMap map = Torque.getDatabaseMap(INVALID_DATABASE_NAME);
@@ -353,7 +327,6 @@ public class DatabaseMapTest extends Bas
      * Tests whether all options are present
      */
     @Test
-    @Order(11)
     public void testOptions() throws TorqueException
     {
         DatabaseMap databaseMap = Torque.getDatabaseMap(DATABASE_NAME);
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.