Author: nbelaevski
Date: 2009-07-24 15:18:42 -0400 (Fri, 24 Jul 2009)
New Revision: 15011
Removed:
root/framework/trunk/api/src/test/java/org/ajax4jsf/framework/util/
root/framework/trunk/api/src/test/java/org/richfaces/
Modified:
root/framework/trunk/impl/pom.xml
root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java
root/framework/trunk/impl/src/test/resources/log4j.xml
Log:
- framework/impl tests switched to log4j-over-slf4j logger
- added debug statements to AbstractBaseResource
Modified: root/framework/trunk/impl/pom.xml
===================================================================
--- root/framework/trunk/impl/pom.xml 2009-07-24 18:33:17 UTC (rev 15010)
+++ root/framework/trunk/impl/pom.xml 2009-07-24 19:18:42 UTC (rev 15011)
@@ -170,7 +170,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
- <artifactId>slf4j-jdk14</artifactId>
+ <artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java
===================================================================
---
root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java 2009-07-24
18:33:17 UTC (rev 15010)
+++
root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java 2009-07-24
19:18:42 UTC (rev 15011)
@@ -102,17 +102,31 @@
if (classLoader != null) {
URL classResource = classLoader.getResource(thisClass.getName().replace('.',
'/') + ".class");
- URLConnection connection;
- try {
- connection = classResource.openConnection();
- connection.setUseCaches(false);
- long classLastModifiedDate = connection.getLastModified();
- if (classLastModifiedDate > 0) {
- lastModified = new Date(classLastModifiedDate);
+ if (classResource != null) {
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug(MessageFormat.format("Located source for the resource class:
{0}", classResource));
}
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+
+ URLConnection connection;
+ try {
+ connection = classResource.openConnection();
+ connection.setUseCaches(false);
+ long classLastModifiedDate = connection.getLastModified();
+ if (classLastModifiedDate > 0) {
+ lastModified = new Date(classLastModifiedDate);
+
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug(MessageFormat.format("Last source modification date is:
{0,date}", lastModified));
+ }
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ } else {
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("Source for the resource class has not been located");
+ }
}
}
}
@@ -122,6 +136,10 @@
if (lastModified == null) {
lastModified = (Date) ApplicationContext.getInstance(context).
getAttribute(ResourceHandlerImpl.HANDLER_START_TIME_ATTRIBUTE);
+
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug(MessageFormat.format("Using resource handler start time as last
modified date: {0,date}", lastModified));
+ }
}
return lastModified;
Modified: root/framework/trunk/impl/src/test/resources/log4j.xml
===================================================================
--- root/framework/trunk/impl/src/test/resources/log4j.xml 2009-07-24 18:33:17 UTC (rev
15010)
+++ root/framework/trunk/impl/src/test/resources/log4j.xml 2009-07-24 19:18:42 UTC (rev
15011)
@@ -25,7 +25,7 @@
-->
<appender name="DEFAULT"
class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} -
%m:%n"/>
+ <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} [%c]
%C %M %n%-5p: %m%n" />
</layout>
</appender>
@@ -62,7 +62,7 @@
<appender-ref ref="DEFAULT"/>
</category>
- <category name="com.exadel.vcp">
+ <category name="org.richfaces">
<priority value="DEBUG" />
<appender-ref ref="DEFAULT"/>
</category>
Show replies by date