Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

HBX-1178 Cleanup pom-xml

log4j/hibernate properties is now properly filtered and used instead
of encoded in 100 lines of xml in pom.xml
System.out's been removed.
Added more rigid exceptions when test fails to cleanup.
Make delete sql continue to delete even after errors.
  • Loading branch information...
commit 9e32dc52329274b3ce48e3a4caee4277370aa06f 1 parent 82fde8e
@maxandersen maxandersen authored
View
460 pom.xml
@@ -45,12 +45,22 @@
</developers>
<properties>
- <hibernateVersion>3.5.6-Final</hibernateVersion>
- <hibernateJpaVersion>1.0.0.Final</hibernateJpaVersion>
- <hsqldbVersion>1.8.0.2</hsqldbVersion>
+ <hibernateversion>3.5.6-Final</hibernateversion>
+ <hibernateJpaversion>1.0.0.Final</hibernateJpaversion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
+ <!-- Default settings for Database connection; to be overridden in db specific profiles -->
+ <db.dialect>org.hibernate.dialect.HSQLDialect</db.dialect>
+ <jdbc.driver>org.hsqldb.jdbcDriver</jdbc.driver>
+ <jdbc.url>jdbc:hsqldb:testdb/hsqldb;shutdown=true</jdbc.url>
+ <jdbc.user>sa</jdbc.user>
+ <jdbc.pass/>
+ <jdbc.driver.groupId>hsqldb</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>hsqldb</jdbc.driver.artifactId>
+ <jdbc.driver.jdbc.driver.version>1.8.0.2</jdbc.driver.jdbc.driver.version>
+ <!-- End of settings for Database connection -->
+ </properties>
+
<!--
Graphviz should be installed for junit tests and it's bin dir should
be in classpath
@@ -61,25 +71,25 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
- <version>${hibernateVersion}</version>
+ <version>${hibernateversion}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
- <version>${hibernateVersion}</version>
+ <version>${hibernateversion}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
- <version>${hibernateVersion}</version>
+ <version>${hibernateversion}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
- <version>${hibernateJpaVersion}</version>
+ <version>${hibernateJpaversion}</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -173,6 +183,13 @@
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency> -->
+
+ <dependency>
+ <groupId>${jdbc.driver.groupId}</groupId>
+ <artifactId>${jdbc.driver.artifactId}</artifactId>
+ <version>${jdbc.driver.jdbc.driver.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -191,28 +208,32 @@
</includes>
</resource>
</resources>
- <!--testResources>
+ <testResources>
<testResource>
<filtering>true</filtering>
- <directory>etc</directory>
+ <directory>src/testresources</directory>
<includes>
<include>**/*.properties</include>
</includes>
</testResource>
- </testResources-->
+ </testResources>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*hbm2hbmxml*/*.java</include> <!-- 69 -->
+ <include>**/*query*/*.java</include> <!-- 1 -->
+ <include>**/*jdbc2cfg*/*.java</include> <!-- 90 (2 error, 2 failures) -->
+ <include>**/*hbm2x*/*.java</include>
+
+ </includes>
+ </configuration>
+ </plugin>
+ <plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
- <!-- <executions>
- <execution>
- <id>auto-clean</id>
- <phase>initialize</phase> this forces recompilation on every run since target is also cleaned so commenting out for now. Need to see if we can have a another clean:testdata goal instead. ->
- <goals>
- <goal>clean</goal>
- </goals>
- </execution>
- </executions>-->
<configuration>
<filesets>
<fileset>
@@ -326,7 +347,7 @@
<archive>
<manifestEntries>
<Implementation-Title>${project.name}</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
+ <Implementation-version>${project.version}</Implementation-version>
<Implementation-Vendor>hibernate.org</Implementation-Vendor>
<Implementation-Vendor-Id>hibernate.org
</Implementation-Vendor-Id>
@@ -443,176 +464,6 @@
<profiles>
- <profile>
- <id>log4j.properties</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <properties>
- <!--### direct log messages to stdout ###-->
- <log4j.appender.stdout>org.apache.log4j.ConsoleAppender</log4j.appender.stdout>
- <log4j.appender.stdout.Target>System.err</log4j.appender.stdout.Target>
- <log4j.appender.stdout.layout>org.apache.log4j.PatternLayout</log4j.appender.stdout.layout>
- <log4j.appender.stdout.layout.ConversionPattern>%d{ABSOLUTE} %5p %c - %m%n</log4j.appender.stdout.layout.ConversionPattern>
- <!--### direct messages to file hibernate.log ###-->
- <!--
- <log4j.appender.file>org.apache.log4j.FileAppender</log4j.appender.file>
- <log4j.appender.file.File>hibernate.log</log4j.appender.file.File>
- <log4j.appender.file.layout>org.apache.log4j.PatternLayout</log4j.appender.file.layout>
- <log4j.appender.file.layout.ConversionPattern>%d{ABSOLUTE} %5p %c{1}:%L - %m%n</log4j.appender.file.layout.ConversionPattern>
- -->
- <!--### set log levels - for more verbose logging change 'info' to 'debug' ###-->
- <log4j.rootLogger>info, stdout</log4j.rootLogger>
- <log4j.logger.org.hibernate>info</log4j.logger.org.hibernate>
- <log4j.logger.org.hibernate.cfg.SettingsFactory>warn</log4j.logger.org.hibernate.cfg.SettingsFactory>
- <log4j.logger.org.hibernate.cfg.reveng>warn</log4j.logger.org.hibernate.cfg.reveng>
- <log4j.logger.org.hibernate.cfg.JDBCMetaDataConfiguration>warn</log4j.logger.org.hibernate.cfg.JDBCMetaDataConfiguration>
- <log4j.logger.org.hibernate.cfg.JDBCBinder>warn</log4j.logger.org.hibernate.cfg.JDBCBinder>
- <!--log4j.logger.freemarker>debug</log4j.logger.freemarker-->
- <!--### log just the SQL-->
- <!--log4j.logger.org.hibernate.SQL>debug</log4j.logger.org.hibernate.SQL-->
- <!--### log JDBC bind parameters ###-->
- <!--log4j.logger.org.hibernate.type>info</log4j.logger.org.hibernate.type-->
- <!--### log schema export/update ###-->
- <!--log4j.logger.org.hibernate.tool.hbm2ddl>debug</log4j.logger.org.hibernate.tool.hbm2ddl-->
- <!--### log cache activity ###-->
- <!--log4j.logger.org.hibernate.cache>debug</log4j.logger.org.hibernate.cache-->
- <!--### log JDBC resource acquisition-->
- <!--log4j.logger.org.hibernate.jdbc>debug</log4j.logger.org.hibernate.jdbc-->
- <!--### enable the following line if you want to track down connection ###-->
- <!--### leakages when using DriverManagerConnectionProvider ###-->
- <!--log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider>trace</log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider-->
- <!--log4j.logger.org.hibernate.tool>debug</log4j.logger.org.hibernate.tool-->
- <!--log4j.logger.org.hibernate.tool.hbm2x.TemplateHelper>info</log4j.logger.org.hibernate.tool.hbm2x.TemplateHelper-->
- <!--log4j.logger.org.apache.velocity>off</log4j.logger.org.apache.velocity-->
- </properties>
- </profile>
-
- <profile>
- <id>hibernate.properties</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <properties>
- <!--### Query Language ###-->
- <!--## define query language constants / function names-->
- <hibernate.query.substitutions>true 1, false 0, yes 'Y', no 'N'</hibernate.query.substitutions>
- <!--### Hibernate Connection Pool ###-->
- <hibernate.connection.pool_size>1</hibernate.connection.pool_size>
- <!--### C3P0 Connection Pool###-->
- <!--hibernate.c3p0.max_size>2</hibernate.c3p0.max_size-->
- <!--hibernate.c3p0.min__size>2</hibernate.c3p0.min__size-->
- <!--hibernate.c3p0.timeout>5000</hibernate.c3p0.timeout-->
- <!--hibernate.c3p0.max_statements>100</hibernate.c3p0.max_statements-->
- <!--hibernate.c3p0.idle_test_period>3000</hibernate.c3p0.idle_test_period-->
- <!--hibernate.c3p0.acquire_increment>2</hibernate.c3p0.acquire_increment-->
- <!--hibernate.c3p0.validate>false</hibernate.c3p0.validate-->
- <!--### Proxool Connection Pool###-->
- <!--## Properties for external configuration of Proxool-->
- <hibernate.proxool.pool_alias>pool1</hibernate.proxool.pool_alias>
- <!--## Only need one of the following-->
- <hibernate.proxool.existing_pool>true</hibernate.proxool.existing_pool>
- <hibernate.proxool.xml>proxool.xml</hibernate.proxool.xml>
- <hibernate.proxool.properties>proxool.properties</hibernate.proxool.properties>
- <!--### Plugin ConnectionProvider ###-->
- <!--## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics)-->
- <!--hibernate.connection.provider_class>org.hibernate.connection.DriverManagerConnectionProvider</hibernate.connection.provider_class-->
- <!--hibernate.connection.provider_class>org.hibernate.connection.DatasourceConnectionProvider</hibernate.connection.provider_class-->
- <!--hibernate.connection.provider_class>org.hibernate.connection.C3P0ConnectionProvider</hibernate.connection.provider_class-->
- <!--hibernate.connection.provider_class>org.hibernate.connection.DBCPConnectionProvider</hibernate.connection.provider_class-->
- <!--hibernate.connection.provider_class>org.hibernate.connection.ProxoolConnectionProvider</hibernate.connection.provider_class-->
- <!--### Transaction API ###-->
- <!--## Enable automatic flush during the JTA beforeCompletion() callback-->
- <!--## (This setting is relevant with or without the Transaction API)-->
- <!--hibernate.transaction.flush_before_completion></hibernate.transaction.flush_before_completion-->
- <!--## Enable automatic session close at the end of transaction-->
- <!--## (This setting is relevant with or without the Transaction API)-->
- <!--hibernate.transaction.auto_close_session></hibernate.transaction.auto_close_session-->
- <!--## the Transaction API abstracts application code from the underlying JTA or JDBC transactions-->
- <!--hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory</hibernate.transaction.factory_class-->
- <!--hibernate.transaction.factory_class>org.hibernate.transaction.JDBCTransactionFactory</hibernate.transaction.factory_class-->
- <!--## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI-->
- <!--## default is java:comp/UserTransaction-->
- <!--## you do NOT need this setting if you specify hibernate.transaction.manager_lookup_class-->
- <!--jta.UserTransaction>jta/usertransaction</jta.UserTransaction-->
- <!--jta.UserTransaction>javax.transaction.UserTransaction</jta.UserTransaction-->
- <!--jta.UserTransaction>UserTransaction</jta.UserTransaction-->
- <!--## to use the second-level cache with JTA, Hibernate must be able to obtain the JTA TransactionManager-->
- <!--hibernate.transaction.manager_lookup_class>org.hibernate.transaction.JBossTransactionManagerLookup</hibernate.transaction.manager_lookup_class-->
- <!--hibernate.transaction.manager_lookup_class>org.hibernate.transaction.WeblogicTransactionManagerLookup</hibernate.transaction.manager_lookup_class-->
- <!--hibernate.transaction.manager_lookup_class>org.hibernate.transaction.WebSphereTransactionManagerLookup</hibernate.transaction.manager_lookup_class-->
- <!--hibernate.transaction.manager_lookup_class>org.hibernate.transaction.OrionTransactionManagerLookup</hibernate.transaction.manager_lookup_class-->
- <!--hibernate.transaction.manager_lookup_class>org.hibernate.transaction.ResinTransactionManagerLookup</hibernate.transaction.manager_lookup_class-->
- <!--### Miscellaneous Settings ###-->
- <!--## print all generated SQL to the console-->
- <!--hibernate.show_sql>true</hibernate.show_sql-->
- <!--## add comments to the generated SQL-->
- <!--hibernate.use_sql_comments>true</hibernate.use_sql_comments-->
- <!--## generate statistics-->
- <!--hibernate.generate_statistics>true</hibernate.generate_statistics-->
- <!--## auto schema export-->
- <!--hibernate.hbm2ddl.auto>create-drop</hibernate.hbm2ddl.auto-->
- <!--hibernate.hbm2ddl.auto>create</hibernate.hbm2ddl.auto-->
- <!--hibernate.hbm2ddl.auto>update</hibernate.hbm2ddl.auto-->
- <!--## rollback generated identifier values of deleted entities to default values-->
- <!--hibernate.use_identifer_rollback>true</hibernate.use_identifer_rollback-->
- <!--## specify a default schema and catalog for unqualified tablenames-->
- <!--hibernate.default_schema>HR</hibernate.default_schema-->
- <hibernate.default_schema>PUBLIC</hibernate.default_schema>
- <!--## set the maximum depth of the outer join fetch tree-->
- <hibernate.max_fetch_depth>1</hibernate.max_fetch_depth>
- <!--## enable CGLIB reflection optimizer (enabled by default)-->
- <!--hibernate.cglib.use_reflection_optimizer>false</hibernate.cglib.use_reflection_optimizer-->
- <!--## use a custom stylesheet for XML generation (if not specified, hibernate-default.xslt will be used)-->
- <!--hibernate.xml.output_stylesheet>C:/Hibernate/net/sf/hibernate/hibernate-default.xslt</hibernate.xml.output_stylesheet-->
- <!--### JDBC Settings ###-->
- <!--## specify a JDBC isolation level-->
- <!--hibernate.connection.isolation>4</hibernate.connection.isolation-->
- <!--## enable JDBC autocommit (not recommended!)-->
- <!--hibernate.connection.autocommit>true</hibernate.connection.autocommit-->
- <!--## set the JDBC fetch size-->
- <!--hibernate.jdbc.fetch_size>25</hibernate.jdbc.fetch_size-->
- <!--## set the maximum JDBC 2 batch size (a nonzero value enables batching)-->
- <!--hibernate.jdbc.batch_size>5</hibernate.jdbc.batch_size-->
- <!--## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default)-->
- <!--hibernate.jdbc.use_scrollable_resultset>true</hibernate.jdbc.use_scrollable_resultset-->
- <!--## enable batch updates even for versioned data-->
- <hibernate.jdbc.batch_versioned_data>true</hibernate.jdbc.batch_versioned_data>
- <!--## use streams when writing binary types to / from JDBC-->
- <hibernate.jdbc.use_streams_for_binary>true</hibernate.jdbc.use_streams_for_binary>
- <!--## use JDBC 3 PreparedStatement.getGeneratedKeys() to get the identifier of an inserted row-->
- <!--hibernate.jdbc.use_get_generated_keys>false</hibernate.jdbc.use_get_generated_keys-->
- <!--### Second-level Cache ###-->
- <!--## optimize chache for minimal "puts" instead of minimal "gets" (good for clustered cache)-->
- <!--hibernate.cache.use_minimal_puts>true</hibernate.cache.use_minimal_puts-->
- <!--## set a prefix for cache region names-->
- <!--hibernate.cache.region_prefix>hibernate.test</hibernate.cache.region_prefix-->
- <!--## disable the second-level cache-->
- <!--hibernate.cache.use_second_level_cache>false</hibernate.cache.use_second_level_cache-->
- <!--## enable the query cache-->
- <!--hibernate.cache.use_query_cache>true</hibernate.cache.use_query_cache-->
- <!--## choose a cache implementation-->
- <!--hibernate.cache.provider_class>org.hibernate.cache.EhCacheProvider</hibernate.cache.provider_class-->
- <!--hibernate.cache.provider_class>org.hibernate.cache.EmptyCacheProvider</hibernate.cache.provider_class-->
- <!--hibernate.cache.provider_class>org.hibernate.cache.HashtableCacheProvider</hibernate.cache.provider_class-->
- <!--hibernate.cache.provider_class>org.hibernate.cache.TreeCacheProvider</hibernate.cache.provider_class-->
- <!--hibernate.cache.provider_class>org.hibernate.cache.OSCacheProvider</hibernate.cache.provider_class-->
- <!--hibernate.cache.provider_class>org.hibernate.cache.SwarmCacheProvider</hibernate.cache.provider_class-->
- <!--### JNDI ###-->
- <!--## specify a JNDI name for the SessionFactory-->
- <!--hibernate.session_factory_name>hibernate/session_factory</hibernate.session_factory_name-->
- <!--## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction;-->
- <!--## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which-->
- <!--## is the best approach in an application server-->
- <!--#file system-->
- <!--hibernate.jndi.class>com.sun.jndi.fscontext.RefFSContextFactory</hibernate.jndi.class-->
- <!--hibernate.jndi.url>file:/</hibernate.jndi.url-->
- <!--#WebSphere-->
- <!--hibernate.jndi.class>com.ibm.websphere.naming.WsnInitialContextFactory</hibernate.jndi.class-->
- <!--hibernate.jndi.url>iiop://localhost:900/</hibernate.jndi.url-->
- <!--hibernatetool.metadatadialect>org.hibernate.cfg.reveng.dialect.H2MetaDataDialect</hibernatetool.metadatadialect-->
- </properties>
- </profile>
<!-- =============================== -->
<!-- Database profiles -->
@@ -620,44 +471,24 @@
<!-- HSQLDB is the default -->
<profile>
<id>hsqldb</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <dependencies>
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>${hsqldbVersion}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <properties>
- <!--### Platforms ###-->
- <!--## JNDI Datasource-->
- <hibernate.dialect>org.hibernate.dialect.HSQLDialect</hibernate.dialect>
- <hibernate.connection.driver_class>org.hsqldb.jdbcDriver</hibernate.connection.driver_class>
- <hibernate.connection.url>jdbc:hsqldb:testdb/hsqldb;shutdown=true</hibernate.connection.url>
- <hibernate.connection.username>sa</hibernate.connection.username>
- <hibernate.connection.password/>
- <db.dialect>org.hibernate.dialect.HSQLDialect</db.dialect>
- <jdbc.driver>org.hsqldb.jdbcDriver</jdbc.driver>
- <jdbc.url>jdbc:hsqldb:.</jdbc.url>
- <jdbc.user>sa</jdbc.user>
- <jdbc.pass/>
- <jdbc.isolation/>
- </properties>
+ <properties>
+ <db.dialect>org.hibernate.dialect.HSQLDialect</db.dialect>
+ <jdbc.driver>org.hsqldb.jdbcDriver</jdbc.driver>
+ <jdbc.url>jdbc:hsqldb:testdb/hsqldb;shutdown=true</jdbc.url>
+ <jdbc.user>sa</jdbc.user>
+ <jdbc.pass />
+ <jdbc.driver.groupId>hsqldb</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>hsqldb</jdbc.driver.artifactId>
+ <jdbc.driver.jdbc.driver.version>1.8.0.2</jdbc.driver.jdbc.driver.version>
+
+ </properties>
</profile>
<profile>
<id>h2</id>
- <dependencies>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
<properties>
+ <jdbc.driver.groupId>com.h2database</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>h2</jdbc.driver.artifactId>
<db.dialect>org.hibernate.dialect.H2Dialect</db.dialect>
<jdbc.driver>org.h2.Driver</jdbc.driver>
<jdbc.url>jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE</jdbc.url>
@@ -677,15 +508,10 @@
<!-- The MySQL 5 test envionment -->
<profile>
<id>mysql50</id>
- <dependencies>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.0.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <properties>
+ <properties>
+ <jdbc.driver.groupId>mysql</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>mysql-connector-java</jdbc.driver.artifactId>
+ <jdbc.driver.jdbc.driver.version>5.0.5</jdbc.driver.jdbc.driver.version>
<db.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</db.dialect>
<jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
<jdbc.url>jdbc:mysql://vmg08.mw.lab.eng.bos.redhat.com/hibbrtru</jdbc.url>
@@ -698,15 +524,10 @@
<!-- The MySQL 5.1 test envionment -->
<profile>
<id>mysql51</id>
- <dependencies>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.0.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
<properties>
+ <jdbc.driver.groupId>mysql</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>mysql-connector-java</jdbc.driver.artifactId>
+ <jdbc.driver.jdbc.driver.version>5.0.5</jdbc.driver.jdbc.driver.version>
<db.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</db.dialect>
<jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
<jdbc.url>jdbc:mysql://vmg02.mw.lab.eng.bos.redhat.com/hibbrtru</jdbc.url>
@@ -719,15 +540,10 @@
<!-- The MySQL 5.1 Cluster test envionment -->
<profile>
<id>mysql51-cluster</id>
- <dependencies>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.8</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
<properties>
+ <jdbc.driver.groupId>mysql</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>mysql-connector-java</jdbc.driver.artifactId>
+ <jdbc.driver.jdbc.driver.version>5.1.8</jdbc.driver.jdbc.driver.version>
<db.dialect>org.hibernate.dialect.MySQL5Dialect</db.dialect>
<jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
<jdbc.url>jdbc:mysql:loadbalance://dev61.qa.atl2.redhat.com:3306,dev62.qa.atl2.redhat.com:3306/hibbrtru
@@ -741,15 +557,10 @@
<!-- The PostgreSQL 8.2.4 test envionment -->
<profile>
<id>postgresql82</id>
- <dependencies>
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>8.2-504.jdbc3</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
<properties>
+ <jdbc.driver.groupId>postgresql</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>postgresql</jdbc.driver.artifactId>
+ <jdbc.driver.jdbc.driver.version>8.2-504.jdbc3</jdbc.driver.jdbc.driver.version>
<db.dialect>org.hibernate.dialect.PostgreSQLDialect</db.dialect>
<jdbc.driver>org.postgresql.Driver</jdbc.driver>
<jdbc.url>jdbc:postgresql://vmg01.mw.lab.eng.bos.redhat.com:5432:hibbrtru</jdbc.url>
@@ -762,15 +573,10 @@
<!-- The PostgreSQL 8.3.7 test envionment -->
<profile>
<id>postgresql83</id>
- <dependencies>
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>8.2-504.jdbc3</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <properties>
+ <properties>
+ <jdbc.driver.groupId>postgresql</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>postgresql</jdbc.driver.artifactId>
+ <jdbc.driver.jdbc.driver.version>8.2-504.jdbc3</jdbc.driver.jdbc.driver.version>
<db.dialect>org.hibernate.dialect.PostgreSQLDialect</db.dialect>
<jdbc.driver>org.postgresql.Driver</jdbc.driver>
<jdbc.url>jdbc:postgresql://vmg03.mw.lab.eng.bos.redhat.com:5432:hibbrtru</jdbc.url>
@@ -792,24 +598,21 @@
<dependencies>
<dependency>
<groupId>com.ibm</groupId>
- <artifactId>db2jcc</artifactId>
- <version>3.1.57</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.ibm</groupId>
<artifactId>db2jcc_license_cu</artifactId>
<version>3.1.57</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
- <db.dialect>org.hibernate.dialect.DB2Dialect</db.dialect>
- <jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
- <jdbc.url>jdbc:db2://dev32.qa.atl.jboss.com:50000/jbossqa</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
- <jdbc.isolation />
+ <jdbc.driver.groupId>com.ibm</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>db2jcc</jdbc.driver.artifactId>
+ <jdbc.driver.jdbc.driver.version>3.1.57</jdbc.driver.jdbc.driver.version>
+ <db.dialect>org.hibernate.dialect.DB2Dialect</db.dialect>
+ <jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
+ <jdbc.url>jdbc:db2://dev32.qa.atl.jboss.com:50000/jbossqa</jdbc.url>
+ <jdbc.user>hibbrtru</jdbc.user>
+ <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.isolation />
</properties>
</profile>
@@ -819,18 +622,15 @@
<dependencies>
<dependency>
<groupId>com.ibm</groupId>
- <artifactId>db2jcc</artifactId>
- <version>3.8.47</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.ibm</groupId>
<artifactId>db2jcc_license_cu</artifactId>
<version>3.8.47</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
+ <jdbc.driver.groupId>com.ibm</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>db2jcc</jdbc.driver.artifactId>
+ <jdbc.driver.jdbc.driver.version>3.8.47</jdbc.driver.jdbc.driver.version>
<db.dialect>org.hibernate.dialect.DB2Dialect</db.dialect>
<jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
<jdbc.url>jdbc:db2://dev67.qa.atl.jboss.com:50000/jbossqa</jdbc.url>
@@ -846,18 +646,15 @@
<dependencies>
<dependency>
<groupId>com.ibm</groupId>
- <artifactId>db2jcc</artifactId>
- <version>3.57.86</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.ibm</groupId>
<artifactId>db2jcc_license_cu</artifactId>
<version>3.57.86</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
+ <jdbc.driver.groupId>com.ibm</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>db2jcc</jdbc.driver.artifactId>
+ <jdbc.driver.jdbc.driver.version>3.57.86</jdbc.driver.jdbc.driver.version>
<db.dialect>org.hibernate.dialect.DB2Dialect</db.dialect>
<jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
<jdbc.url>jdbc:db2://vmg06.mw.lab.eng.bos.redhat.com:50000/jbossqa</jdbc.url>
@@ -870,16 +667,11 @@
<!-- The Oracle9i test envionment -->
<profile>
<id>oracle9i</id>
- <dependencies>
- <dependency>
- <groupId>com.oracle</groupId>
- <artifactId>ojdbc14</artifactId>
- <!-- use the 10g drivers which are surprisingly largely bug free -->
- <version>10.0.2.0</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
<properties>
+ <jdbc.driver.groupId>com.oracle</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>ojdbc14</jdbc.driver.artifactId>
+ <!-- use the 10g drivers which are surprisingly largely bug free -->
+ <jdbc.driver.version>10.0.2.0</jdbc.driver.version>
<db.dialect>org.hibernate.dialect.Oracle9iDialect</db.dialect>
<jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
<jdbc.url>jdbc:oracle:thin:@dev20.qa.atl.jboss.com:1521:qa</jdbc.url>
@@ -892,16 +684,11 @@
<!-- The Oracle10g test envionment -->
<profile>
<id>oracle10g</id>
- <dependencies>
- <dependency>
- <groupId>com.oracle</groupId>
- <artifactId>ojdbc14</artifactId>
- <!-- use the 10g drivers which are surprisingly largely bug free -->
- <version>10.0.2.0</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
<properties>
+ <jdbc.driver.groupId>com.oracle</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>ojdbc14</jdbc.driver.artifactId>
+ <!-- use the 10g drivers which are surprisingly largely bug free -->
+ <jdbc.driver.version>10.0.2.0</jdbc.driver.version>
<db.dialect>org.hibernate.dialect.Oracle10gDialect</db.dialect>
<jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
<jdbc.url>jdbc:oracle:thin:@vmg05.mw.lab.eng.bos.redhat.com:1521:qaora10</jdbc.url>
@@ -914,15 +701,10 @@
<!-- The Oracle11g test envionment -->
<profile>
<id>oracle11g</id>
- <dependencies>
- <dependency>
- <groupId>com.oracle</groupId>
- <artifactId>ojdbc5</artifactId>
- <version>11.1.0.7.0</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
<properties>
+ <jdbc.driver.groupId>com.oracle</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>ojdbc5</jdbc.driver.artifactId>
+ <jdbc.driver.version>11.1.0.7.0</jdbc.driver.version>
<db.dialect>org.hibernate.dialect.Oracle10gDialect</db.dialect>
<jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
<jdbc.url>jdbc:oracle:thin:@dev04.qa.atl2.redhat.com:1521:qaora11</jdbc.url>
@@ -935,15 +717,11 @@
<!-- The Oracle11gRAC test envionment -->
<profile>
<id>oracle11gRAC</id>
- <dependencies>
- <dependency>
- <groupId>com.oracle</groupId>
- <artifactId>ojdbc5</artifactId>
- <version>11.1.0.7.0</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
<properties>
+ <jdbc.driver.groupId>com.oracle</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>ojdbc5</jdbc.driver.artifactId>
+ <jdbc.driver.version>11.1.0.7.0</jdbc.driver.version>
+ <scope>test</scope>
<db.dialect>org.hibernate.dialect.Oracle10gDialect</db.dialect>
<jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
<jdbc.url>
@@ -958,15 +736,10 @@
<!-- The Sybase 15 test envionment -->
<profile>
<id>sybase15</id>
- <dependencies>
- <dependency>
- <groupId>com.sybase</groupId>
- <artifactId>jconnect</artifactId>
- <version>6.0.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
<properties>
+ <jdbc.driver.groupId>com.sybase</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>jconnect</jdbc.driver.artifactId>
+ <jdbc.driver.version>6.0.5</jdbc.driver.version>
<db.dialect>org.hibernate.dialect.SybaseASE15Dialect</db.dialect>
<jdbc.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.driver>
<jdbc.url>jdbc:sybase:Tds:vmg07.mw.lab.eng.bos.redhat.com:5000/hibbrtru</jdbc.url>
@@ -979,15 +752,10 @@
<!-- The SQLServer2005 (MS JDBC) test envionment -->
<profile>
<id>mssql2005</id>
- <dependencies>
- <dependency>
- <groupId>com.microsoft.sqlserver</groupId>
- <artifactId>msjdbc</artifactId>
- <version>2.0.1008.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
<properties>
+ <jdbc.driver.groupId>com.microsoft.sqlserver</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>msjdbc</jdbc.driver.artifactId>
+ <jdbc.driver.version>2.0.1008.2</jdbc.driver.version>
<db.dialect>org.hibernate.dialect.SQLServerDialect</db.dialect>
<jdbc.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc.driver>
<jdbc.url>jdbc:sqlserver://dev30.qa.atl.jboss.com:3918</jdbc.url>
@@ -1000,15 +768,11 @@
<!-- The SQLServer2005 (MS JDBC) test envionment -->
<profile>
<id>mssql2008</id>
- <dependencies>
- <dependency>
- <groupId>com.microsoft.sqlserver</groupId>
- <artifactId>msjdbc</artifactId>
- <version>2.0.1008.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
<properties>
+ <jdbc.driver.groupId>com.microsoft.sqlserver</jdbc.driver.groupId>
+ <jdbc.driver.artifactId>msjdbc</jdbc.driver.artifactId>
+ <jdbc.driver.version>2.0.1008.2</jdbc.driver.version>
+
<db.dialect>org.hibernate.dialect.SQLServerDialect</db.dialect>
<jdbc.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc.driver>
<jdbc.url>jdbc:sqlserver://vmg04.mw.lab.eng.bos.redhat.com:1433</jdbc.url>
View
24 src/java/org/hibernate/cfg/reveng/dialect/JDBCMetaDataDialect.java
@@ -53,30 +53,6 @@ protected Throwable handleSQLException(SQLException e) {
}
}
-
- private void dumpHeader(ResultSet columnRs) throws SQLException {
- ResultSetMetaData md2 = columnRs.getMetaData();
-
- int columnCount = md2.getColumnCount();
- for (int i = 1; i <= columnCount; i++) {
- System.out.print(md2.getColumnName(i) + "|");
- }
- System.out.println();
- }
-
- private void dumpRow(ResultSet columnRs) throws SQLException {
- ResultSetMetaData md2 = columnRs.getMetaData();
-
- int columnCount = md2.getColumnCount();
- for (int i = 1; i <= columnCount; i++) {
- System.out.print(columnRs.getObject(i) + "|");
- }
- System.out.println();
- }
-
-
-
-
public Iterator getIndexInfo(final String xcatalog, final String xschema, final String xtable) {
try {
final String catalog = caseForSearch( xcatalog );
View
7 src/test/org/hibernate/tool/BaseTestCase.java
@@ -105,7 +105,8 @@ public BaseTestCase(String name, String out) {
}
protected void setUp() throws Exception {
- super.setUp();
+ assertNoTables();
+
if(getOutputDir()!=null) {
getOutputDir().mkdirs();
}
@@ -120,7 +121,9 @@ protected void tearDown() throws Exception {
}
protected void cleanupOutputDir() {
- if (getOutputDir()!=null) TestHelper.deleteDir(getOutputDir());
+ if (getOutputDir()!=null) {
+ TestHelper.deleteDir(getOutputDir());
+ }
}
View
2  src/test/org/hibernate/tool/JDBCMetaDataBinderTestCase.java
@@ -144,7 +144,7 @@ protected void setUp() throws Exception {
}
protected void tearDown() throws Exception {
- executeDDL(getDropSQL(), false);
+ executeDDL(getDropSQL(), true);
super.tearDown();
}
View
7 src/test/org/hibernate/tool/ant/AntHibernateToolTest.java
@@ -9,6 +9,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.tools.ant.BuildException;
import org.hibernate.tool.test.TestHelper;
@@ -18,6 +20,9 @@
*/
public class AntHibernateToolTest extends BuildFileTestCase {
+
+ private static final Log log = LogFactory.getLog(AntHibernateToolTest.class);
+
private String property;
public AntHibernateToolTest(String name) {
@@ -46,6 +51,7 @@ private void cleanup(){
short attempt = 1;
do {
try {
+ log.debug("Attempt " + attempt + " for calling 'remmoveDirs'");
executeTarget("removeDirs");
removed = true;
} catch (BuildException be){
@@ -58,6 +64,7 @@ private void cleanup(){
//User SA not found for all the next tests.
}
attempt++;
+
if (attempt > ATTEMPT_COUNT && !removed){
fail("Could not complete cleanup. Next tests behaviour is unpredictable.");
}
View
1  src/test/org/hibernate/tool/hbm2x/DocExporterTest.java
@@ -120,7 +120,6 @@ public void testInheritedProperties()
private void testHtml(final Tidy tidy, File dir) {
try {
- System.out.println("*****Parsing " + dir);
tidy.parse( new FileInputStream(dir), (OutputStream)null );
assertEquals(dir + "has errors ", 0, tidy.getParseErrors());
assertEquals(dir + "has warnings ", 0, tidy.getParseWarnings());
View
4 src/test/org/hibernate/tool/hbmlint/HbmLintTest.java
@@ -41,8 +41,6 @@ public void testValidateCache() {
List result = analyzer.getResults();
assertEquals(1,result.size());
-
- System.out.println(result);
}
@@ -60,7 +58,6 @@ public void testValidateIdentifier() {
assertEquals(1,result.size());
- System.out.println(result);
}
@@ -78,7 +75,6 @@ public void testBytecodeRestrictions() {
assertEquals(2,result.size());
- System.out.println(result);
}
View
13 src/test/org/hibernate/tool/test/TestHelper.java
@@ -20,7 +20,10 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.eclipse.jdt.internal.compiler.batch.Main;
+import org.hibernate.cfg.reveng.JDBCReader;
import org.hibernate.util.StringHelper;
import org.xml.sax.SAXException;
@@ -30,6 +33,8 @@
*/
public final class TestHelper {
+ private static final Log log = LogFactory.getLog(TestHelper.class);
+
private TestHelper() {
// noop
}
@@ -160,15 +165,17 @@ public static boolean deleteDir(File dir) {
if ( dir.isDirectory() ) {
String[] children = dir.list();
for (int i = 0; i < children.length; i++) {
- boolean success = deleteDir( new File( dir, children[i] ) );
+ File childFile = new File( dir, children[i] );
+ boolean success = deleteDir( childFile );
if ( !success ) {
- return false;
+ throw new RuntimeException("Could not delete " + childFile);
+ //return false;
}
}
}
// The directory is now empty so delete it
- System.out.println("deleting: " + dir);
+ log.debug("deleting: " + dir);
return dir.delete();
}
View
10 etc/hibernate.properties → src/testresources/hibernate.properties
@@ -33,12 +33,12 @@ hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'
## HypersonicSQL
-hibernate.dialect org.hibernate.dialect.HSQLDialect
-hibernate.connection.driver_class org.hsqldb.jdbcDriver
-hibernate.connection.username sa
-hibernate.connection.password
+hibernate.dialect @db.dialect@
+hibernate.connection.driver_class @jdbc.driver@
+hibernate.connection.username @jdbc.user@
+hibernate.connection.password @jdbc.pass@
#hibernate.connection.url jdbc:hsqldb:hsql://localhost
-hibernate.connection.url jdbc:hsqldb:testdb/hsqldb;shutdown=true
+hibernate.connection.url @jdbc.url@
#hibernate.connection.url jdbc:hsqldb:.
#hibernate.connection.shutdown=true
View
2  etc/log4j.properties → src/testresources/log4j.properties
@@ -19,6 +19,8 @@ log4j.logger.org.hibernate.cfg.SettingsFactory=warn
log4j.logger.org.hibernate.cfg.reveng=debug
log4j.logger.org.hibernate.cfg.JDBCMetaDataConfiguration=debug
log4j.logger.org.hibernate.cfg.JDBCBinder=debug
+log4j.logger.org.hibernate.tool.BaseTestCase=debug
+log4j.logger.org.hibernate.tool=debug
#log4j.logger.freemarker=debug
### log just the SQL
View
2  src/testsupport/anttest-build.xml
@@ -27,7 +27,7 @@
<path location="${testlibs.dir}/javaassist.jar" />
<path location="${test-classes}" />
<path location="${target.dir}/classes" />
- <path location="./etc" />
+ <path location="${target.dir}/test-classes" />
<path location="${jdbc.lib}" />
</path>
Please sign in to comment.
Something went wrong with that request. Please try again.