1 commit 046df1b894a9f65737461b4146bfe72acf97ca8e
2 Author: Kai Moritz <kai@juplo.de>
3 Date: Fri Apr 5 12:37:19 2019 +0200
5 Configured the 5.2.18-tutorials to use the hibernate-maven-plugin
7 diff --git a/src/it/tutorials-5.2.18/annotations/pom.xml b/src/it/tutorials-5.2.18/annotations/pom.xml
8 index effd4b7..505432c 100644
9 --- a/src/it/tutorials-5.2.18/annotations/pom.xml
10 +++ b/src/it/tutorials-5.2.18/annotations/pom.xml
13 <!-- Skip artifact deployment -->
14 <maven.deploy.skip>true</maven.deploy.skip>
15 + <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
22 + <groupId>de.juplo</groupId>
23 + <artifactId>hibernate-maven-plugin</artifactId>
24 + <version>${hibernate-maven-plugin.version}</version>
27 + <phase>process-test-classes</phase>
34 + <scanTestClasses>true</scanTestClasses>
35 + <format>true</format>
42 diff --git a/src/it/tutorials-5.2.18/annotations/src/test/resources/hibernate.cfg.xml b/src/it/tutorials-5.2.18/annotations/src/test/resources/hibernate.cfg.xml
43 index a9590c1..df29d83 100644
44 --- a/src/it/tutorials-5.2.18/annotations/src/test/resources/hibernate.cfg.xml
45 +++ b/src/it/tutorials-5.2.18/annotations/src/test/resources/hibernate.cfg.xml
48 <!-- Database connection settings -->
49 <property name="connection.driver_class">org.h2.Driver</property>
50 - <property name="connection.url">jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE</property>
51 + <property name="connection.url">jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE</property>
52 <property name="connection.username">sa</property>
53 <property name="connection.password"></property>
56 <!-- Echo all executed SQL to stdout -->
57 <property name="show_sql">true</property>
59 - <!-- Drop and re-create the database schema on startup -->
60 - <property name="hbm2ddl.auto">create</property>
62 <!-- Names the annotated entity class -->
63 <mapping class="org.hibernate.tutorial.annotations.Event"/>
65 diff --git a/src/it/tutorials-5.2.18/basic/pom.xml b/src/it/tutorials-5.2.18/basic/pom.xml
66 index 783ac6b..032919a 100644
67 --- a/src/it/tutorials-5.2.18/basic/pom.xml
68 +++ b/src/it/tutorials-5.2.18/basic/pom.xml
71 <!-- Skip artifact deployment -->
72 <maven.deploy.skip>true</maven.deploy.skip>
73 + <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
79 + <groupId>de.juplo</groupId>
80 + <artifactId>hibernate-maven-plugin</artifactId>
81 + <version>${hibernate-maven-plugin.version}</version>
84 + <phase>process-test-classes</phase>
91 + <scanTestClasses>true</scanTestClasses>
92 + <format>true</format>
99 diff --git a/src/it/tutorials-5.2.18/basic/src/test/resources/hibernate.cfg.xml b/src/it/tutorials-5.2.18/basic/src/test/resources/hibernate.cfg.xml
100 index 03d3937..df55e96 100644
101 --- a/src/it/tutorials-5.2.18/basic/src/test/resources/hibernate.cfg.xml
102 +++ b/src/it/tutorials-5.2.18/basic/src/test/resources/hibernate.cfg.xml
105 <!-- Database connection settings -->
106 <property name="connection.driver_class">org.h2.Driver</property>
107 - <property name="connection.url">jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE</property>
108 + <property name="connection.url">jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE</property>
109 <property name="connection.username">sa</property>
110 <property name="connection.password"/>
112 diff --git a/src/it/tutorials-5.2.18/entitymanager/pom.xml b/src/it/tutorials-5.2.18/entitymanager/pom.xml
113 index d928fb6..8c13cf8 100644
114 --- a/src/it/tutorials-5.2.18/entitymanager/pom.xml
115 +++ b/src/it/tutorials-5.2.18/entitymanager/pom.xml
118 <!-- Skip artifact deployment -->
119 <maven.deploy.skip>true</maven.deploy.skip>
120 + <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
131 + <groupId>de.juplo</groupId>
132 + <artifactId>hibernate-maven-plugin</artifactId>
133 + <version>${hibernate-maven-plugin.version}</version>
136 + <phase>process-test-classes</phase>
138 + <goal>create</goal>
143 + <scanTestClasses>true</scanTestClasses>
144 + <dialect>org.hibernate.dialect.H2Dialect</dialect>
145 + <format>true</format>
152 diff --git a/src/it/tutorials-5.2.18/entitymanager/src/test/resources/META-INF/persistence.xml b/src/it/tutorials-5.2.18/entitymanager/src/test/resources/META-INF/persistence.xml
153 index 0fc9523..edf7005 100644
154 --- a/src/it/tutorials-5.2.18/entitymanager/src/test/resources/META-INF/persistence.xml
155 +++ b/src/it/tutorials-5.2.18/entitymanager/src/test/resources/META-INF/persistence.xml
159 <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
160 - <property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE" />
161 + <property name="javax.persistence.jdbc.url" value="jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE" />
162 <property name="javax.persistence.jdbc.user" value="sa" />
163 <property name="javax.persistence.jdbc.password" value="" />
165 diff --git a/src/it/tutorials-5.2.18/envers/pom.xml b/src/it/tutorials-5.2.18/envers/pom.xml
166 index 7fa8a48..1d740ea 100644
167 --- a/src/it/tutorials-5.2.18/envers/pom.xml
168 +++ b/src/it/tutorials-5.2.18/envers/pom.xml
171 <!-- Skip artifact deployment -->
172 <maven.deploy.skip>true</maven.deploy.skip>
173 + <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
184 + <groupId>de.juplo</groupId>
185 + <artifactId>hibernate-maven-plugin</artifactId>
186 + <version>${hibernate-maven-plugin.version}</version>
189 + <phase>process-test-classes</phase>
191 + <goal>create</goal>
196 + <scanTestClasses>true</scanTestClasses>
197 + <dialect>org.hibernate.dialect.H2Dialect</dialect>
198 + <format>true</format>
205 diff --git a/src/it/tutorials-5.2.18/envers/src/test/resources/META-INF/persistence.xml b/src/it/tutorials-5.2.18/envers/src/test/resources/META-INF/persistence.xml
206 index 45a7daf..fadc2a3 100644
207 --- a/src/it/tutorials-5.2.18/envers/src/test/resources/META-INF/persistence.xml
208 +++ b/src/it/tutorials-5.2.18/envers/src/test/resources/META-INF/persistence.xml
212 <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
213 - <property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE" />
214 + <property name="javax.persistence.jdbc.url" value="jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE" />
215 <property name="javax.persistence.jdbc.user" value="sa" />
216 <property name="javax.persistence.jdbc.password" value="" />
218 diff --git a/src/it/tutorials-5.2.18/osgi/managed-jpa/pom.xml b/src/it/tutorials-5.2.18/osgi/managed-jpa/pom.xml
219 index 55ccacd..35ad150 100644
220 --- a/src/it/tutorials-5.2.18/osgi/managed-jpa/pom.xml
221 +++ b/src/it/tutorials-5.2.18/osgi/managed-jpa/pom.xml
223 <version>1.0.0</version>
224 <packaging>bundle</packaging>
227 + <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
232 <groupId>org.hibernate.javax.persistence</groupId>
238 + <groupId>de.juplo</groupId>
239 + <artifactId>hibernate-maven-plugin</artifactId>
240 + <version>${hibernate-maven-plugin.version}</version>
244 + <goal>create</goal>
249 + <url>jdbc:h2:mem:db_managed_jpa;MVCC=TRUE</url>
250 + <format>true</format>
251 + <execute>false</execute>
257 diff --git a/src/it/tutorials-5.2.18/osgi/unmanaged-jpa/pom.xml b/src/it/tutorials-5.2.18/osgi/unmanaged-jpa/pom.xml
258 index e45aab5..2836c5e 100644
259 --- a/src/it/tutorials-5.2.18/osgi/unmanaged-jpa/pom.xml
260 +++ b/src/it/tutorials-5.2.18/osgi/unmanaged-jpa/pom.xml
262 <version>1.0.0</version>
263 <packaging>bundle</packaging>
266 + <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
271 <groupId>org.hibernate.javax.persistence</groupId>
277 + <groupId>de.juplo</groupId>
278 + <artifactId>hibernate-maven-plugin</artifactId>
279 + <version>${hibernate-maven-plugin.version}</version>
281 + <format>true</format>
286 + <goal>create</goal>
294 diff --git a/src/it/tutorials-5.2.18/osgi/unmanaged-jpa/src/main/resources/META-INF/persistence.xml b/src/it/tutorials-5.2.18/osgi/unmanaged-jpa/src/main/resources/META-INF/persistence.xml
295 index b0ebfe7..788ccab 100644
296 --- a/src/it/tutorials-5.2.18/osgi/unmanaged-jpa/src/main/resources/META-INF/persistence.xml
297 +++ b/src/it/tutorials-5.2.18/osgi/unmanaged-jpa/src/main/resources/META-INF/persistence.xml
300 <property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
301 <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
302 - <property name="hibernate.connection.url" value="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE"/>
303 + <property name="hibernate.connection.url" value="jdbc:h2:mem:db_unmanaged_jpa;DB_CLOSE_DELAY=-1;MVCC=TRUE"/>
304 <property name="hibernate.connection.username" value="sa"/>
305 <property name="hibernate.connection.password" value=""/>
306 <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
310 \ No newline at end of file
312 diff --git a/src/it/tutorials-5.2.18/osgi/unmanaged-native/pom.xml b/src/it/tutorials-5.2.18/osgi/unmanaged-native/pom.xml
313 index d24f03d..b3e19de 100644
314 --- a/src/it/tutorials-5.2.18/osgi/unmanaged-native/pom.xml
315 +++ b/src/it/tutorials-5.2.18/osgi/unmanaged-native/pom.xml
317 <version>1.0.0</version>
318 <packaging>bundle</packaging>
321 + <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
326 <groupId>org.hibernate.javax.persistence</groupId>
332 + <groupId>de.juplo</groupId>
333 + <artifactId>hibernate-maven-plugin</artifactId>
334 + <version>${hibernate-maven-plugin.version}</version>
336 + <format>true</format>
341 + <goal>create</goal>
349 diff --git a/src/it/tutorials-5.2.18/osgi/unmanaged-native/src/main/resources/hibernate.cfg.xml b/src/it/tutorials-5.2.18/osgi/unmanaged-native/src/main/resources/hibernate.cfg.xml
350 index 7f9f238..175a2bf 100644
351 --- a/src/it/tutorials-5.2.18/osgi/unmanaged-native/src/main/resources/hibernate.cfg.xml
352 +++ b/src/it/tutorials-5.2.18/osgi/unmanaged-native/src/main/resources/hibernate.cfg.xml
354 <hibernate-configuration>
356 <property name="hibernate.connection.driver_class">org.h2.Driver</property>
357 - <property name="hibernate.connection.url">jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE</property>
358 + <property name="hibernate.connection.url">jdbc:h2:mem:db_unmanaged_native;DB_CLOSE_DELAY=-1;MVCC=TRUE</property>
359 <property name="hibernate.connection.username">sa</property>
360 <property name="hibernate.connection.password"></property>
361 <property name="hibernate.dialect">org.hibernate.dialect.H2Dialect</property>
362 diff --git a/src/it/tutorials-5.2.18/osgi/unmanaged-native/src/main/resources/pool-one.properties b/src/it/tutorials-5.2.18/osgi/unmanaged-native/src/main/resources/pool-one.properties
363 index 7e1c4cf..0085971 100644
364 --- a/src/it/tutorials-5.2.18/osgi/unmanaged-native/src/main/resources/pool-one.properties
365 +++ b/src/it/tutorials-5.2.18/osgi/unmanaged-native/src/main/resources/pool-one.properties
367 # See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
369 jdbc-0.proxool.alias=pool-one
370 -jdbc-0.proxool.driver-url=jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE
371 +jdbc-0.proxool.driver-url=jdbc:h2:mem:db_unmanaged_native;DB_CLOSE_DELAY=-1;MVCC=TRUE
372 jdbc-0.proxool.driver-class=org.h2.Driver
375 jdbc-0.proxool.maximum-connection-count=2
376 -jdbc-0.proxool.house-keeping-test-sql=select CURRENT_DATE
377 \ No newline at end of file
378 +jdbc-0.proxool.house-keeping-test-sql=select CURRENT_DATE
379 diff --git a/src/it/tutorials-5.2.18/pom.xml b/src/it/tutorials-5.2.18/pom.xml
380 index 26d0f89..a7e9b66 100644
381 --- a/src/it/tutorials-5.2.18/pom.xml
382 +++ b/src/it/tutorials-5.2.18/pom.xml
386 <directory>src/test/resources</directory>
387 + <filtering>true</filtering>
391 diff --git a/src/it/tutorials-5.2.18/schema-annotations.sql b/src/it/tutorials-5.2.18/schema-annotations.sql
393 index 0000000..48eb18e
395 +++ b/src/it/tutorials-5.2.18/schema-annotations.sql
398 + create table EVENTS (
399 + id bigint not null,
400 + EVENT_DATE timestamp,
401 + title varchar(255),
404 diff --git a/src/it/tutorials-5.2.18/schema-basic.sql b/src/it/tutorials-5.2.18/schema-basic.sql
406 index 0000000..c5e2c0e
408 +++ b/src/it/tutorials-5.2.18/schema-basic.sql
411 + create table EVENTS (
412 + EVENT_ID bigint not null,
413 + EVENT_DATE timestamp,
414 + title varchar(255),
415 + primary key (EVENT_ID)
417 diff --git a/src/it/tutorials-5.2.18/schema-entitymanager.sql b/src/it/tutorials-5.2.18/schema-entitymanager.sql
419 index 0000000..48eb18e
421 +++ b/src/it/tutorials-5.2.18/schema-entitymanager.sql
424 + create table EVENTS (
425 + id bigint not null,
426 + EVENT_DATE timestamp,
427 + title varchar(255),
430 diff --git a/src/it/tutorials-5.2.18/schema-envers.sql b/src/it/tutorials-5.2.18/schema-envers.sql
432 index 0000000..ecec80e
434 +++ b/src/it/tutorials-5.2.18/schema-envers.sql
437 + create table EVENTS (
438 + id bigint not null,
439 + EVENT_DATE timestamp,
440 + title varchar(255),
444 + create table EVENTS_AUD (
445 + id bigint not null,
446 + REV integer not null,
448 + EVENT_DATE timestamp,
449 + title varchar(255),
450 + primary key (id, REV)
453 + create table REVINFO (
454 + REV integer generated by default as identity,
459 + alter table EVENTS_AUD
460 + add constraint FK5cembm6xahf542q8e4h0pq2t1
462 + references REVINFO;
463 diff --git a/src/it/tutorials-5.2.18/schema-osgi-managed-jpa.sql b/src/it/tutorials-5.2.18/schema-osgi-managed-jpa.sql
465 index 0000000..de92e46
467 +++ b/src/it/tutorials-5.2.18/schema-osgi-managed-jpa.sql
469 +create sequence hibernate_sequence start with 1 increment by 1;
471 + create table DataPoint (
472 + id bigint not null,
476 diff --git a/src/it/tutorials-5.2.18/schema-osgi-unmanaged-jpa.sql b/src/it/tutorials-5.2.18/schema-osgi-unmanaged-jpa.sql
478 index 0000000..de92e46
480 +++ b/src/it/tutorials-5.2.18/schema-osgi-unmanaged-jpa.sql
482 +create sequence hibernate_sequence start with 1 increment by 1;
484 + create table DataPoint (
485 + id bigint not null,
489 diff --git a/src/it/tutorials-5.2.18/schema-osgi-unmanaged-native.sql b/src/it/tutorials-5.2.18/schema-osgi-unmanaged-native.sql
491 index 0000000..d89e280
493 +++ b/src/it/tutorials-5.2.18/schema-osgi-unmanaged-native.sql
495 +create sequence hibernate_sequence start with 1 increment by 1;
497 + create table DataPoint (
498 + id bigint not null,
503 + create table DataPoint_AUD (
504 + id bigint not null,
505 + REV integer not null,
508 + primary key (id, REV)
511 + create table REVINFO (
512 + REV integer generated by default as identity,
517 + alter table DataPoint_AUD
518 + add constraint FK43jw6b5mtbfxur0xhyjxynbea
520 + references REVINFO;
521 diff --git a/src/it/tutorials-5.2.18/verify.bsh b/src/it/tutorials-5.2.18/verify.bsh
523 index 0000000..9156c4a
525 +++ b/src/it/tutorials-5.2.18/verify.bsh
527 +import de.juplo.test.FileComparator;
530 +FileComparator comparator = new FileComparator(basedir);
532 +if (!comparator.isEqual("schema-annotations.sql","annotations/target/create.sql"))
534 +if (!comparator.isEqual("schema-basic.sql","basic/target/create.sql"))
536 +if (!comparator.isEqual("schema-entitymanager.sql","entitymanager/target/create.sql"))
538 +if (!comparator.isEqual("schema-envers.sql","envers/target/create.sql"))
540 +if (!comparator.isEqual("schema-osgi-managed-jpa.sql","osgi/managed-jpa/target/create.sql"))
542 +if (!comparator.isEqual("schema-osgi-unmanaged-jpa.sql","osgi/unmanaged-jpa/target/create.sql"))
544 +if (!comparator.isEqual("schema-osgi-unmanaged-native.sql","osgi/unmanaged-native/target/create.sql"))