db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g.@apache.org
Subject svn commit: r1873218 - in /db/torque/torque4/trunk: torque-maven-plugin/src/main/java/org/apache/torque/generator/maven/ torque-templates/ torque-test/ torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/ torque-test/src/test/pro...
Date Mon, 27 Jan 2020 14:36:48 GMT
Author: gk
Date: Mon Jan 27 14:36:48 2020
New Revision: 1873218

URL: http://svn.apache.org/viewvc?rev=1873218&view=rev
Log:
- allow skip in torque maven plugin
- update Docker information in torque-test
- update testcontainer to 1.12.5

Modified:
    db/torque/torque4/trunk/torque-maven-plugin/src/main/java/org/apache/torque/generator/maven/TorqueGeneratorMojo.java
    db/torque/torque4/trunk/torque-templates/todo.txt
    db/torque/torque4/trunk/torque-test/README.md
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerDatabaseAbstractExtension.java
    db/torque/torque4/trunk/torque-test/src/test/profile/mysql/docker-resources/docker-java.properties.template
    db/torque/torque4/trunk/torque-test/src/test/profile/mysql/docker-resources/testcontainers.properties
    db/torque/torque4/trunk/torque-test/src/test/profile/postgresql/docker-resources/testcontainers.properties

Modified: db/torque/torque4/trunk/torque-maven-plugin/src/main/java/org/apache/torque/generator/maven/TorqueGeneratorMojo.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-maven-plugin/src/main/java/org/apache/torque/generator/maven/TorqueGeneratorMojo.java?rev=1873218&r1=1873217&r2=1873218&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-maven-plugin/src/main/java/org/apache/torque/generator/maven/TorqueGeneratorMojo.java
(original)
+++ db/torque/torque4/trunk/torque-maven-plugin/src/main/java/org/apache/torque/generator/maven/TorqueGeneratorMojo.java
Mon Jan 27 14:36:48 2020
@@ -387,6 +387,13 @@ public class TorqueGeneratorMojo extends
      */
     @Parameter( defaultValue = "${project}", required = true, readonly = true )
     private MavenProject project;
+    
+    
+    /**
+     * Specifies whether the execution should be skipped.
+     */
+    @Parameter( property = "maven.torque.skip", defaultValue = "false" )
+    private boolean skip;
 
     /**
      * Configures and runs the Torque generator.
@@ -394,9 +401,16 @@ public class TorqueGeneratorMojo extends
     @Override
     public void execute() throws MojoExecutionException
     {
+        
+        if ( skip)
+        {
+            getLog().info( "Skipping Torque execution" );
+            return;
+        }
+        
         Controller controller = new Controller();
         List<UnitDescriptor> unitDescriptors = new ArrayList<>();
-
+ 
         // Do conversion here so illegal values are discovered before generation
         OutputDirUsage defaultOutputDirUsageConverted
         = OutputDirUsage.get(defaultOutputDirUsage);

Modified: db/torque/torque4/trunk/torque-templates/todo.txt
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/todo.txt?rev=1873218&r1=1873217&r2=1873218&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/todo.txt (original)
+++ db/torque/torque4/trunk/torque-templates/todo.txt Mon Jan 27 14:36:48 2020
@@ -1,4 +1,3 @@
-<!--
  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
@@ -15,7 +14,6 @@
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
--->
 
 - check values of the sqlDataType (custom platform docs !)
 - in the file org/apache/torque/templates/transformer/om/OMTableTransformer.properties

Modified: db/torque/torque4/trunk/torque-test/README.md
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/README.md?rev=1873218&r1=1873217&r2=1873218&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/README.md (original)
+++ db/torque/torque4/trunk/torque-test/README.md Mon Jan 27 14:36:48 2020
@@ -20,11 +20,12 @@
 ## General 
 
 - Start 
+
 ```sh
 mvn test -P<data-type>
 ```
 
-* e.g. for database Hsqldb use "mvn test -Phsqldb". 
+* e.g. for database Hsqldb use `mvn test -Phsqldb`. 
 
 * Find profile names in pom.xml
 
@@ -32,40 +33,63 @@ Find more details about database and db
 
 ## Workflow
 
-- check src/main/schema for the source schemas and the results in target/generated-* folders.
+- check `src/main/schema` for the source schemas and the results in `target/generated-*`
folders.
+
+- find schema xsd in torque-templates module `src/main/resources/torque/xsd`.
+
+### Docker image
 
-- find schema xsd in torque-templates module src/main/resources/torque/xsd
+Currently only mysql and postgresql adapter is supported (and selected tests). 
 
 
 ### Hsqldb
 
-- in memory, no user access restriction as configured required
+- In memory, no user access restriction as configured required
 
-### MySql
+### MySQL
 
-#### Existing host database
+#### Existing host database (default profile)
 
-- user and database must exist, before running test, see profile mysql
+- User and database must exist, before running test, see profile mysql.
 
-### Docker image
+#### Docker image (profile docker-textcontainer)
+
+Change into folder torque-test and check configuration files testcontainers.properties and
docker-java.properties 
+in folder `src/test/profile/<profile>/docker-resources`.
+
+
+##### OS System Adjustments
+
+__docker-maven-plugin and Docker Testcontainters 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].
Find this file here: `src/test/profile/mysql/docker-resources`.
+ 
+[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.
+
+* Docker daemon: By default setting the environment variable DOCKER_HOST ( URI / daemon )
is required. 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.
 
-Currently only supported for mysql adapter, and very few tests.
+* 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.
 
-#### OS System Adjustments
+- Run the tests with profile __docker-testcontainer__ :
 
-* docker-maven-plugin needs appropriate environment set. Windows system 7 below without hyperv
may require starting docker using docker-machine start <id>, environment check with
docker-machine env <id> and setting it in shell.
-* check a running mysql daemon, stop or disable docker-maven-plugin.
-* docker testcontainer reads docker-java.properties. Find it for profile mysql here: src/test/profile/mysql/docker-resources.
 
-- run it with profile: 
 ```sh
-mvn test -Pmysql,docker-testcontainer
+mvn -P mysql,docker-testcontainer,managers,beans clean test 
 ```
 
 
 ### Postgresql
 
-...
+#### Docker-Image
+
+Change into folder torque-test and check configuration files `testcontainers.properties`
and `docker-java.properties` in folder `src/test/profile/postgresql/docker-resources`. 
+
+Run the tests with:
+
+```sh
+mvn -P postgresql,docker-testcontainer,managers,beans clean test 
+```
 
 ### Mssql
 ...
@@ -81,20 +105,25 @@ mvn test -Pmysql,docker-testcontainer
 
 ### IDE integration (Eclipse)
 
-- add src/main/generated-java and target/generated-sources to build path.
+- add `src/main/generated-java` and `target/generated-sources` to build path.
+
+- Generate project/classpath by using minimal test database profile hsqldb
+
+```sh
+mvn eclpise:eclipse -P hsqldb
+```
 
 ### Maven Database Test with Remote Standard Socket Attachment
 
-Example 
+Example: Attach example opens port 8000 per default
 
-// attach example opens port 8000 per default
 // forkMode already deprecated, but change as convenient.
+`mvnDebug test -Dtest=DataTest#testLikeClauseEscaping -Pmysql -DforkCount=0`
 
-mvnDebug test -Dtest=DataTest#testLikeClauseEscaping -Pmysql -DforkMode=never
+* or set `<forkCount>0</forkCount>` in pom.xml.
 
-* -DforkMode=never on command line has no effect, may be a bug. Changing in pom however does
what it should do (as of maven 3.6.0)
 
 ## TODO
-- Use Java Testcontainers (Docker) to simulate for mysql, postgresql
+- Use Java Testcontainers (Docker in ither databas settings ...
 
 

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerDatabaseAbstractExtension.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerDatabaseAbstractExtension.java?rev=1873218&r1=1873217&r2=1873218&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerDatabaseAbstractExtension.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerDatabaseAbstractExtension.java
Mon Jan 27 14:36:48 2020
@@ -29,7 +29,8 @@ import org.testcontainers.containers.Gen
 import org.testcontainers.containers.wait.strategy.Wait;
 
 /**
- * {@link #dbContainer} and  {@link #servicePort} has to be set by implementing class
+ * {@link #dbContainer} and  {@link #servicePort} has to be set by implementing class.
+ * 
  * 
  * @author gk
  * @version $Id$

Modified: db/torque/torque4/trunk/torque-test/src/test/profile/mysql/docker-resources/docker-java.properties.template
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/profile/mysql/docker-resources/docker-java.properties.template?rev=1873218&r1=1873217&r2=1873218&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/profile/mysql/docker-resources/docker-java.properties.template
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/profile/mysql/docker-resources/docker-java.properties.template
Mon Jan 27 14:36:48 2020
@@ -20,16 +20,24 @@
 
 # UNIX by default uses unix sockets
 #DOCKER_HOST=unix:///var/run/docker.sock
+
 # to override default
 #DOCKER_TLS_VERIFY=0
-
 # WINDOWS uses external network, use only secure connection
 # docker.io might use username and password encrypted in ~/.docker/config.json
 # use result of 'docker-machine env <nameOfVirtualMachine>'
 #DOCKER_TLS_VERIFY=1
-#DOCKER_HOST=tcp://<hostip>:2376
+
+## tcp://127.0.0.1:2376
+#DOCKER_HOST=tcp://<host_ip>:<port>
+
 #DOCKER_CERT_PATH=<path-to-cert>
-#DOCKER_MACHINE_NAME=nameofvirtualmachine (e.g. type virtualbox in Windows 7 or hyperv in
Windows 10)
+
+#api.version=1.40
+
 #COMPOSE_CONVERT_WINDOWS_PATHS=true
 
-#api.version=1.39
+#DOCKER_MACHINE_NAME=nameofvirtualmachine (e.g. type virtualbox in Windows 7 or hyperv in
Windows 10)
+
+
+

Modified: db/torque/torque4/trunk/torque-test/src/test/profile/mysql/docker-resources/testcontainers.properties
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/profile/mysql/docker-resources/testcontainers.properties?rev=1873218&r1=1873217&r2=1873218&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/profile/mysql/docker-resources/testcontainers.properties
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/profile/mysql/docker-resources/testcontainers.properties
Mon Jan 27 14:36:48 2020
@@ -16,4 +16,4 @@
 # under the License.
 
 # windows workaround, should have more than 2GB free disk space
-checks.disable = true
\ No newline at end of file
+#checks.disable = true
\ No newline at end of file

Modified: db/torque/torque4/trunk/torque-test/src/test/profile/postgresql/docker-resources/testcontainers.properties
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/profile/postgresql/docker-resources/testcontainers.properties?rev=1873218&r1=1873217&r2=1873218&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/profile/postgresql/docker-resources/testcontainers.properties
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/profile/postgresql/docker-resources/testcontainers.properties
Mon Jan 27 14:36:48 2020
@@ -16,4 +16,4 @@
 # under the License.
 
 # windows workaround, should have more than 2GB free disk space
-checks.disable = true
\ No newline at end of file
+#checks.disable = true
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message