Updated to work with latest releases of jboss-logging and jboss-logging-tools

This commit is contained in:
JPAV 2011-02-16 16:14:27 -06:00
parent 9b725c471c
commit ece77365dc
12 changed files with 45 additions and 65 deletions

View File

@ -61,8 +61,8 @@ libraries = [
jacc: 'org.jboss.javaee:jboss-jacc-api:1.1.0.GA',
// logging
logging: 'org.jboss.logging:jboss-logging:3.0.0.Beta4',
logging_tools: 'org.jboss.logging:jboss-logging-tools:1.0.0.Beta3',
logging: 'org.jboss.logging:jboss-logging:3.0.0.Beta5',
logging_tools: 'org.jboss.logging:jboss-logging-tools:1.0.0.Beta4',
slf4j_api: 'org.slf4j:slf4j-api:' + slf4jVersion,
slf4j_simple: 'org.slf4j:slf4j-simple:' + slf4jVersion,
jcl_slf4j: 'org.slf4j:jcl-over-slf4j:' + slf4jVersion,
@ -107,8 +107,7 @@ subprojects { subProject ->
// appropriately inject the common dependencies into each sub-project
dependencies {
compile fileTree(dir: 'lib', includes: ['*.jar'])
// compile( libraries.logging )
compile( libraries.logging )
compile( libraries.logging_tools )
compile( libraries.slf4j_api )
testCompile( libraries.junit )
@ -120,32 +119,34 @@ subprojects { subProject ->
testRuntime( libraries.h2 )
deployerJars "org.apache.maven.wagon:wagon-http:1.0-beta-6"
}
task compileJavaAnnotations(type: Compile) {
generatedSrcDirName = buildDirName + "/generated-src/main/java"
generatedSrcDir = dir( generatedSrcDirName )
task compileJavaAnnotations(type: Compile, dependsOn: generatedSrcDir) {
classpath = compileJava.classpath
source = compileJava.source
destinationDir = compileJava.destinationDir
options.define(compilerArgs: ['-proc:only'])
options.define(compilerArgs: ["-proc:only", "-s", "$generatedSrcDir.dir.absolutePath"])
}
compileJava {
options.define(compilerArgs: ['-proc:none'])
}
compileJava.dependsOn compileJavaAnnotations
compileJava.source += fileTree(generatedSrcDirName)
compileJava.options.define(compilerArgs: ["-proc:none"])
generatedTestSrcDirName = buildDirName + "/generated-src/test/java"
generatedTestSrcDir = dir( generatedTestSrcDirName )
task compileTestJavaAnnotations(type: Compile) {
task compileTestJavaAnnotations(type: Compile, dependsOn: generatedTestSrcDir) {
classpath = compileTestJava.classpath
source = compileTestJava.source
destinationDir = compileTestJava.destinationDir
options.define(compilerArgs: ['-proc:only'])
options.define(compilerArgs: ["-proc:only", "-s", "$generatedTestSrcDir.dir.absolutePath"])
}
compileTestJava {
options.define(compilerArgs: ['-proc:none'])
}
compileTestJava.dependsOn compileTestJavaAnnotations
compileTestJava.source += fileTree(generatedTestSrcDirName)
compileTestJava.options.define(compilerArgs: ["-proc:none"])
sourceSets {
main {
@ -163,7 +164,6 @@ subprojects { subProject ->
test {
systemProperties['hibernate.test.validatefailureexpected'] = true
// systemProperties['jboss.i18n.generate-proxies'] = true
maxHeapSize = "1024m"
}
@ -193,6 +193,8 @@ subprojects { subProject ->
whenConfigured { module ->
module.dependencies*.exported = true
}
testSourceDirs.add( file( generatedSrcDirName ) )
testSourceDirs.add( file( generatedTestSrcDirName ) )
}
eclipseClasspath {
plusConfigurations.add( configurations.provided )

View File

@ -10,54 +10,39 @@ package org.hibernate.service.jdbc.connections.internal;
import static org.jboss.logging.Logger.Level.INFO;
import static org.jboss.logging.Logger.Level.WARN;
import java.sql.SQLException;
import java.util.Properties;
import org.hibernate.HibernateLogger;
import org.jboss.logging.Cause;
import org.jboss.logging.LogMessage;
import org.jboss.logging.Message;
import org.jboss.logging.MessageLogger;
/**
* Defines internationalized messages for this hibernate-c3p0, with IDs ranging from 10001 to 15000 inclusively. New messages must
* be added after the last message defined to ensure message codes are unique.
*/
@MessageLogger( projectCode = "HHH" )
public interface C3P0Logger extends HibernateLogger {
@LogMessage( level = INFO )
@Message( value = "Autocommit mode: %s", id = 10001 )
void autoCommitMode( boolean autocommit );
@LogMessage( level = WARN )
@Message( value = "Both hibernate-style property '%s' and c3p0-style property '%s' have been set in hibernate.properties. "
+ "Hibernate-style property '%s' will be used and c3p0-style property '%s' will be ignored!", id = 10002 )
+ "Hibernate-style property '%s' will be used and c3p0-style property '%s' will be ignored!", id = 10001 )
void bothHibernateAndC3p0StylesSet( String hibernateStyle,
String c3p0Style,
String hibernateStyle2,
String c3p0Style2 );
@LogMessage( level = INFO )
@Message( value = "C3P0 using driver: %s at URL: %s", id = 10003 )
@Message( value = "C3P0 using driver: %s at URL: %s", id = 10002 )
void c3p0UsingDriver( String jdbcDriverClass,
String jdbcUrl );
@LogMessage( level = INFO )
@Message( value = "Connection properties: %s", id = 10004 )
void connectionProperties( Properties maskOut );
@Message( value = "JDBC Driver class not found: %s", id = 10005 )
@Message( value = "JDBC Driver class not found: %s", id = 10003 )
String jdbcDriverNotFound( String jdbcDriverClass );
@LogMessage( level = WARN )
@Message( value = "No JDBC Driver class was specified by property %s", id = 10006 )
void jdbcDriverNotSpecified( String driver );
@LogMessage( level = INFO )
@Message( value = "JDBC isolation level: %s", id = 10007 )
void jdbcIsolationLevel( String isolationLevelToString );
@LogMessage( level = WARN )
@Message( value = "Could not destroy C3P0 connection pool", id = 10008 )
@Message( value = "Could not destroy C3P0 connection pool", id = 10004 )
void unableToDestroyC3p0ConnectionPool( @Cause SQLException e );
@Message( value = "Could not instantiate C3P0 connection pool", id = 10009 )
@Message( value = "Could not instantiate C3P0 connection pool", id = 10005 )
String unableToInstantiateC3p0ConnectionPool();
}

Binary file not shown.

View File

@ -665,7 +665,7 @@ public interface HibernateLogger extends BasicLogger {
String jdbcBeginFailed();
@LogMessage( level = WARN )
@Message( value = "no JDBC Driver class was specified by property %s", id = 148 )
@Message( value = "No JDBC Driver class was specified by property %s", id = 148 )
void jdbcDriverNotSpecified( String driver );
@LogMessage( level = INFO )

View File

@ -8,10 +8,12 @@
package org.hibernate;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.MessageLogger;
/**
* Defines internationalized messages for all modules part of hibernate-core.
*/
@MessageLogger( projectCode = "HHH" )
public interface TestLogger extends BasicLogger {
public static final TestLogger LOG = Logger.getMessageLogger(TestLogger.class, TestLogger.class.getName());

View File

@ -76,7 +76,6 @@ public class QueryKeyTest extends TestCase {
// settings are lazily initialized when calling transformTuple(),
// so they have not been initialized for the following test
// (it *should* be initialized before creating a QueryKey)
System.out.println("jboss.i18n.generate-proxies=" + System.getProperty("jboss.i18n.generate-proxies"));
doResultTransformerTest( new AliasToBeanResultTransformer( AClass.class ), false );
// initialize settings for the next test

View File

@ -10,11 +10,13 @@ import static org.jboss.logging.Logger.Level.WARN;
import org.hibernate.HibernateLogger;
import org.jboss.logging.LogMessage;
import org.jboss.logging.Message;
import org.jboss.logging.MessageLogger;
/**
* Defines internationalized messages for this hibernate-ehcache, with IDs ranging from 20001 to 25000 inclusively. New messages
* must be added after the last message defined to ensure message codes are unique.
*/
@MessageLogger( projectCode = "HHH" )
public interface EhCacheLogger extends HibernateLogger {
@LogMessage( level = WARN )

View File

@ -17,19 +17,9 @@ dependencies {
testCompile( libraries.shrinkwrap_api )
testCompile( libraries.shrinkwrap )
testCompile( libraries.validation )
testCompile( libraries.slf4j_api )
testRuntime( libraries.validator )
}
procTargetDirName = buildDirName + "/generated-src/jpamodelgen"
procTargetDir = dir( procTargetDirName )
compileTestJava {
configure( options ) {
compilerArgs = [ "-s", "$procTargetDir.dir.absolutePath" ]
}
}
compileTestJava.dependsOn procTargetDir
bundlesTargetDirName = "$buildDirName/bundles"
bundlesTargetDir = dir( bundlesTargetDirName )
task copyBundleResources (type: Copy) {
@ -49,10 +39,6 @@ copyBundleResources.dependsOn bundlesTargetDir
// make sure that the bundles for the packaged test (PackagingTestCase) are copied as well
processTestResources.dependsOn copyBundleResources
ideaModule {
testSourceDirs.add( file( procTargetDirName ) )
}

View File

@ -15,11 +15,13 @@ import org.hibernate.HibernateLogger;
import org.jboss.logging.Cause;
import org.jboss.logging.LogMessage;
import org.jboss.logging.Message;
import org.jboss.logging.MessageLogger;
/**
* Defines internationalized messages for this hibernate-entitymanager, with IDs ranging from 15001 to 20000 inclusively. New
* messages must be added after the last message defined to ensure message codes are unique.
*/
@MessageLogger( projectCode = "HHH" )
public interface EntityManagerLogger extends HibernateLogger {
@LogMessage( level = INFO )

View File

@ -10,11 +10,13 @@ import static org.jboss.logging.Logger.Level.WARN;
import org.hibernate.HibernateLogger;
import org.jboss.logging.LogMessage;
import org.jboss.logging.Message;
import org.jboss.logging.MessageLogger;
/**
* Defines internationalized messages for this hibernate-envers, with IDs ranging from 25001 to 30000 inclusively. New messages must
* be added after the last message defined to ensure message codes are unique.
*/
@MessageLogger( projectCode = "HHH" )
public interface EnversLogger extends HibernateLogger {
@LogMessage( level = WARN )

View File

@ -1,3 +1,5 @@
apply plugin: 'java'
dependencies {
infinispanVersion = '4.2.0.CR4'
jnpVersion = '5.0.3.GA'

View File

@ -10,11 +10,13 @@ import static org.jboss.logging.Logger.Level.INFO;
import org.hibernate.HibernateLogger;
import org.jboss.logging.LogMessage;
import org.jboss.logging.Message;
import org.jboss.logging.MessageLogger;
/**
* Defines internationalized messages for this hibernate-proxool, with IDs ranging from 30001 to 35000 inclusively. New messages
* must be added after the last message defined to ensure message codes are unique.
*/
@MessageLogger( projectCode = "HHH" )
public interface ProxoolLogger extends HibernateLogger {
@LogMessage( level = INFO )
@ -40,22 +42,18 @@ public interface ProxoolLogger extends HibernateLogger {
@Message( value = "Exception occured when closing the Proxool pool", id = 30006 )
String exceptionClosingProxoolPool();
@LogMessage( level = INFO )
@Message( value = "JDBC isolation level: %s", id = 30007 )
void jdbcIsolationLevel( String isolationLevelToString );
@Message( value = "Cannot configure Proxool Provider to use an existing in memory pool without the %s property set.", id = 30008 )
@Message( value = "Cannot configure Proxool Provider to use an existing in memory pool without the %s property set.", id = 30007 )
String unableToConfigureProxoolProviderToUseExistingInMemoryPool( String proxoolPoolAlias );
@Message( value = "Cannot configure Proxool Provider to use JAXP without the %s property set.", id = 30009 )
@Message( value = "Cannot configure Proxool Provider to use JAXP without the %s property set.", id = 30008 )
String unableToConfigureProxoolProviderToUseJaxp( String proxoolPoolAlias );
@Message( value = "Cannot configure Proxool Provider to use Properties File without the %s property set.", id = 30010 )
@Message( value = "Cannot configure Proxool Provider to use Properties File without the %s property set.", id = 30009 )
String unableToConfigureProxoolProviderToUsePropertiesFile( String proxoolPoolAlias );
@Message( value = "Proxool Provider unable to load JAXP configurator file: %s", id = 30011 )
@Message( value = "Proxool Provider unable to load JAXP configurator file: %s", id = 30010 )
String unableToLoadJaxpConfiguratorFile( String jaxpFile );
@Message( value = "Proxool Provider unable to load Property configurator file: %s", id = 30012 )
@Message( value = "Proxool Provider unable to load Property configurator file: %s", id = 30011 )
String unableToLoadPropertyConfiguratorFile( String propFile );
}