juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcunn...@apache.org
Subject svn commit: r780030 - in /webservices/juddi/branches/v3_trunk/uddi-client: log4j.properties pom.xml src/test/java/org/apache/juddi/client/UDDI_090_SubscriptionListenerIntegrationTest.java
Date Fri, 29 May 2009 16:43:29 GMT
Author: tcunning
Date: Fri May 29 16:43:29 2009
New Revision: 780030

URL: http://svn.apache.org/viewvc?rev=780030&view=rev
Log:
Fix up logging for uddi-client so we can run asserts on notifications.

Added:
    webservices/juddi/branches/v3_trunk/uddi-client/log4j.properties
Modified:
    webservices/juddi/branches/v3_trunk/uddi-client/pom.xml
    webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_090_SubscriptionListenerIntegrationTest.java

Added: webservices/juddi/branches/v3_trunk/uddi-client/log4j.properties
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-client/log4j.properties?rev=780030&view=auto
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-client/log4j.properties (added)
+++ webservices/juddi/branches/v3_trunk/uddi-client/log4j.properties Fri May 29 16:43:29 2009
@@ -0,0 +1,32 @@
+log4j.logger.org.apache.juddi.api.impl=INFO, UDDICLIENT
+log4j.rootLogger=INFO, logfile
+
+# in case any output is given to stdout, format it
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
+
+log4j.appender.logfile=org.apache.log4j.RollingFileAppender
+log4j.appender.logfile.File=${catalina.home}/logs/juddi.log
+log4j.appender.logfile.MaxFileSize=512MB
+# Keep three backup files.
+log4j.appender.logfile.MaxBackupIndex=3
+# Pattern to output: date priority [category] - message
+log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
+log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n
+
+# in case any output is given to stdout, format it
+log4j.appender.UDDICLIENT=org.apache.log4j.FileAppender
+log4j.appender.UDDICLIENT.File=${catalina.home}/../uddiclient.log
+log4j.appender.UDDICLIENT.MaxFileSize=512MB
+log4j.appender.UDDICLIENT.layout=org.apache.log4j.PatternLayout
+log4j.appender.UDDICLIENT.layout.ConversionPattern=%m%n
+
+#log4j.category.org.springframework.beans.property editors.CustomDateEditor=DEBUG
+
+log4j.debug=false
+
+# showing sql
+#log4j.category.org.hibernate.hql.ast.QueryTranslatorImpl=DEBUG
+#log4j.category.org.hibernate.SQL=DEBUG
+#log4j.category.org.hibernate.loader.hql.QueryLoad er=DEBUG 

Modified: webservices/juddi/branches/v3_trunk/uddi-client/pom.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-client/pom.xml?rev=780030&r1=780029&r2=780030&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-client/pom.xml (original)
+++ webservices/juddi/branches/v3_trunk/uddi-client/pom.xml Fri May 29 16:43:29 2009
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-	<!--
-		* Copyright 2001-2009 The Apache Software Foundation. * * Licensed
-		under the Apache License, Version 2.0 (the "License"); * you may not
-		use this file except in compliance with the License. * You may obtain
-		a copy of the License at * *
+<!--
+	* Copyright 2001-2009 The Apache Software Foundation. * * Licensed
+	under the Apache License, Version 2.0 (the "License"); * you may not
+	use this file except in compliance with the License. * You may obtain
+	a copy of the License at * *
 		http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by
 		applicable law or agreed to in writing, software * distributed under
 		the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES
@@ -131,6 +131,10 @@
 							<tasks>
 								<unzip dest="target" src="target/juddi-tomcat-3.0.0.SNAPSHOT.zip" />
 								<copy file="${basedir}/server.xml" todir="target/juddi-tomcat-${project.version}/conf"
overwrite="true"/>
+								<copy file="${basedir}/log4j.properties" todir="target/juddi-tomcat-${project.version}/webapps/juddi/WEB-INF/classes"
overwrite="true"/>
+								<!--
+								     <copy file="${basedir}/log4j.xml" todir="target/juddi-tomcat-${project.version}/webapps/juddi/log4j.xml"/>
+								-->
 							</tasks>
 						</configuration>
 						<goals>

Modified: webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_090_SubscriptionListenerIntegrationTest.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_090_SubscriptionListenerIntegrationTest.java?rev=780030&r1=780029&r2=780030&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_090_SubscriptionListenerIntegrationTest.java
(original)
+++ webservices/juddi/branches/v3_trunk/uddi-client/src/test/java/org/apache/juddi/client/UDDI_090_SubscriptionListenerIntegrationTest.java
Fri May 29 16:43:29 2009
@@ -14,6 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+import java.io.BufferedReader;
+import java.io.FileReader;
+
 import org.apache.log4j.Logger;
 import org.apache.log4j.helpers.Loader;
 import org.junit.Assert;
@@ -102,12 +105,33 @@
 			tckSubscriptionListener.saveService(authInfoJoe);
 			tckSubscriptionListener.saveNotifierSubscription(authInfoJoe);
 			tckSubscriptionListener.changeSubscribedObject(authInfoJoe);			
-		} 
-		finally {
+
+			String test = readLogAsString("./target/uddiclient.log");
+			System.out.println(test);
+		} catch (Exception e) {
+			Assert.fail();
+			e.printStackTrace();
+		} finally {
 			tckSubscriptionListener.deleteNotifierSubscription(authInfoJoe);
 			tckBusinessService.deleteJoePublisherService(authInfoJoe);
 			tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
 			tckTModel.deleteJoePublisherTmodel(authInfoJoe);
 		}
 	}	
+	
+    private static String readLogAsString(String filePath)
+    throws java.io.IOException{
+        StringBuffer data = new StringBuffer(1000);
+        BufferedReader reader = new BufferedReader(
+                new FileReader(filePath));
+        char[] buf = new char[1024];
+        int numRead=0;
+        while((numRead=reader.read(buf)) != -1){
+            data.append(buf, 0, numRead);
+        }
+        reader.close();
+        String notify = data.toString().replace("Notification received by UDDISubscriptionListenerService
: ", "");
+        	
+        return notify;
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: juddi-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: juddi-cvs-help@ws.apache.org


Mime
View raw message