You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by nt...@apache.org on 2018/01/17 09:29:25 UTC

cayenne git commit: CAY-2393 Add sqlserver-docker profile

Repository: cayenne
Updated Branches:
  refs/heads/master 8d79f4594 -> 1e8ed89f9


CAY-2393 Add sqlserver-docker profile


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/1e8ed89f
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/1e8ed89f
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/1e8ed89f

Branch: refs/heads/master
Commit: 1e8ed89f96b0854843149f56a7e621ce0ba70d6b
Parents: 8d79f45
Author: Nikita Timofeev <st...@gmail.com>
Authored: Wed Jan 17 10:45:58 2018 +0300
Committer: Nikita Timofeev <st...@gmail.com>
Committed: Wed Jan 17 10:45:58 2018 +0300

----------------------------------------------------------------------
 .travis.yml                                   |  1 +
 cayenne-client/pom.xml                        | 33 +++++++++++
 cayenne-dbsync/pom.xml                        | 33 +++++++++++
 cayenne-jcache/pom.xml                        | 33 +++++++++++
 cayenne-server/pom.xml                        | 33 +++++++++++
 docs/doc/src/main/resources/RELEASE-NOTES.txt |  1 +
 pom.xml                                       | 65 +++++++++++++++++++++-
 7 files changed, 198 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/1e8ed89f/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 78f3ffc..6b059f0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -30,6 +30,7 @@ env:
   - DB_PROFILE=derby
   - DB_PROFILE=mysql-docker
   - DB_PROFILE=postgres-docker
+  - DB_PROFILE=sqlserver-docker
 
 jdk:
   - oraclejdk8

http://git-wip-us.apache.org/repos/asf/cayenne/blob/1e8ed89f/cayenne-client/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-client/pom.xml b/cayenne-client/pom.xml
index 46aa5a6..725b3a1 100644
--- a/cayenne-client/pom.xml
+++ b/cayenne-client/pom.xml
@@ -165,6 +165,39 @@
             </build>
         </profile>
         <profile>
+            <id>sqlserver-docker</id>
+            <activation>
+                <property>
+                    <name>cayenneTestConnection</name>
+                    <value>sqlserver-docker</value>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>docker-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>start-sqlserver</id>
+                                <phase>pre-integration-test</phase>
+                                <goals>
+                                    <goal>start</goal>
+                                </goals>
+                            </execution>
+                            <execution>
+                                <id>stop-sqlserver</id>
+                                <phase>post-integration-test</phase>
+                                <goals>
+                                    <goal>stop</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
             <id>code-quality</id>
 
             <activation>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/1e8ed89f/cayenne-dbsync/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/pom.xml b/cayenne-dbsync/pom.xml
index 0adf66d..5c68b4d 100644
--- a/cayenne-dbsync/pom.xml
+++ b/cayenne-dbsync/pom.xml
@@ -201,5 +201,38 @@
 				</plugins>
 			</build>
 		</profile>
+		<profile>
+			<id>sqlserver-docker</id>
+			<activation>
+				<property>
+					<name>cayenneTestConnection</name>
+					<value>sqlserver-docker</value>
+				</property>
+			</activation>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>io.fabric8</groupId>
+						<artifactId>docker-maven-plugin</artifactId>
+						<executions>
+							<execution>
+								<id>start-sqlserver</id>
+								<phase>pre-integration-test</phase>
+								<goals>
+									<goal>start</goal>
+								</goals>
+							</execution>
+							<execution>
+								<id>stop-sqlserver</id>
+								<phase>post-integration-test</phase>
+								<goals>
+									<goal>stop</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
 	</profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/1e8ed89f/cayenne-jcache/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-jcache/pom.xml b/cayenne-jcache/pom.xml
index 342011f..07fb5a3 100644
--- a/cayenne-jcache/pom.xml
+++ b/cayenne-jcache/pom.xml
@@ -188,6 +188,39 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>sqlserver-docker</id>
+            <activation>
+                <property>
+                    <name>cayenneTestConnection</name>
+                    <value>sqlserver-docker</value>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>docker-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>start-sqlserver</id>
+                                <phase>pre-integration-test</phase>
+                                <goals>
+                                    <goal>start</goal>
+                                </goals>
+                            </execution>
+                            <execution>
+                                <id>stop-sqlserver</id>
+                                <phase>post-integration-test</phase>
+                                <goals>
+                                    <goal>stop</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
 
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/1e8ed89f/cayenne-server/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/pom.xml b/cayenne-server/pom.xml
index a310a37..3d090e6 100644
--- a/cayenne-server/pom.xml
+++ b/cayenne-server/pom.xml
@@ -270,6 +270,39 @@
                 </plugins>
             </build>
         </profile>
+		<profile>
+			<id>sqlserver-docker</id>
+			<activation>
+				<property>
+					<name>cayenneTestConnection</name>
+					<value>sqlserver-docker</value>
+				</property>
+			</activation>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>io.fabric8</groupId>
+						<artifactId>docker-maven-plugin</artifactId>
+						<executions>
+							<execution>
+								<id>start-sqlserver</id>
+								<phase>pre-integration-test</phase>
+								<goals>
+									<goal>start</goal>
+								</goals>
+							</execution>
+							<execution>
+								<id>stop-sqlserver</id>
+								<phase>post-integration-test</phase>
+								<goals>
+									<goal>stop</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
         <profile>
             <id>code-quality</id>
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/1e8ed89f/docs/doc/src/main/resources/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/RELEASE-NOTES.txt b/docs/doc/src/main/resources/RELEASE-NOTES.txt
index 7958307..cb8b27c 100644
--- a/docs/doc/src/main/resources/RELEASE-NOTES.txt
+++ b/docs/doc/src/main/resources/RELEASE-NOTES.txt
@@ -15,6 +15,7 @@ Changes/New Features:
 
 CAY-2372 Extract new modules from cayenne-server
 CAY-2377 Cleanup deprecated code.
+CAY-2393 Add sqlserver-docker profile to automate tests on SQLServer
 
 Bug Fixes:
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/1e8ed89f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0c70f59..bb70cea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -841,7 +841,7 @@
                 <plugin>
                     <groupId>io.fabric8</groupId>
                     <artifactId>docker-maven-plugin</artifactId>
-                    <version>0.21.0</version>
+                    <version>0.23.0</version>
                 </plugin>
             </plugins>
 		</pluginManagement>
@@ -1507,6 +1507,69 @@
 			</dependencies>
 		</profile>
 		<profile>
+			<id>sqlserver-docker</id>
+			<activation>
+				<property>
+					<name>cayenneTestConnection</name>
+					<value>sqlserver-docker</value>
+				</property>
+			</activation>
+			<dependencies>
+				<dependency>
+					<groupId>com.microsoft.sqlserver</groupId>
+					<artifactId>mssql-jdbc</artifactId>
+					<version>6.1.0.jre7</version>
+					<scope>test</scope>
+				</dependency>
+			</dependencies>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-failsafe-plugin</artifactId>
+						<configuration>
+							<systemPropertyVariables>
+								<!-- ${db.host} and ${db.port} are dynamically set by docker-maven-plugin below -->
+								<cayenneAdapter>org.apache.cayenne.dba.sqlserver.SQLServerAdapter</cayenneAdapter>
+								<cayenneJdbcUsername>sa</cayenneJdbcUsername>
+								<cayenneJdbcPassword>Cayenne#123</cayenneJdbcPassword>
+								<cayenneJdbcUrl>jdbc:sqlserver://${sqlserver.host}:${sqlserver.port};</cayenneJdbcUrl>
+								<cayenneJdbcDriver>com.microsoft.sqlserver.jdbc.SQLServerDriver</cayenneJdbcDriver>
+								<cayenne.runtime.db.collation.assume.ci>true</cayenne.runtime.db.collation.assume.ci>
+							</systemPropertyVariables>
+						</configuration>
+					</plugin>
+					<plugin>
+						<groupId>io.fabric8</groupId>
+						<artifactId>docker-maven-plugin</artifactId>
+						<configuration>
+							<verbose>true</verbose>
+							<images>
+								<image>
+									<alias>sqlserver</alias>
+									<name>microsoft/mssql-server-linux:2017-latest</name>
+									<run>
+										<ports>
+											<port>${sqlserver.host}:${sqlserver.port}:1433</port>
+										</ports>
+										<env>
+											<ACCEPT_EULA>Y</ACCEPT_EULA>
+											<SA_PASSWORD>Cayenne#123</SA_PASSWORD>
+										</env>
+										<wait>
+											<log>SQL Server is now ready for client connections.</log>
+											<time>60000</time>
+										</wait>
+										<cmd>/opt/mssql/bin/sqlservr</cmd>
+									</run>
+								</image>
+							</images>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+		<profile>
 			<id>ingres</id>
 			<activation>
 				<property>