activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r491857 - in /incubator/activemq/trunk/activemq-jpa-store/src: main/java/org/apache/activemq/store/jpa/JPAMessageStore.java main/java/org/apache/activemq/store/jpa/JPATopicMessageStore.java test/resources/log4j.properties
Date Tue, 02 Jan 2007 17:26:36 GMT
Author: chirino
Date: Tue Jan  2 09:26:32 2007
New Revision: 491857

URL: http://svn.apache.org/viewvc?view=rev&rev=491857
Log:
Fix test failures

Added:
    incubator/activemq/trunk/activemq-jpa-store/src/test/resources/log4j.properties
Modified:
    incubator/activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAMessageStore.java
    incubator/activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPATopicMessageStore.java

Modified: incubator/activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAMessageStore.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAMessageStore.java?view=diff&rev=491857&r1=491856&r2=491857
==============================================================================
--- incubator/activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAMessageStore.java
(original)
+++ incubator/activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAMessageStore.java
Tue Jan  2 09:26:32 2007
@@ -92,17 +92,17 @@
 	}
 
 	public int getMessageCount() throws IOException {
-		Integer rc;
+		Long rc;
 		EntityManager manager = adapter.beginEntityManager(null);
 		try {
 			Query query = manager.createQuery("select count(m) from StoredMessage m");
-			rc = (Integer) query.getSingleResult();
+			rc = (Long) query.getSingleResult();
 		} catch (Throwable e) {
 			adapter.rollbackEntityManager(null,manager);
 			throw IOExceptionSupport.create(e);
 		}
 		adapter.commitEntityManager(null,manager);
-		return rc;
+		return rc.intValue();
 	}
 
 	public String getMessageReference(MessageId identity) throws IOException {

Modified: incubator/activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPATopicMessageStore.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPATopicMessageStore.java?view=diff&rev=491857&r1=491856&r2=491857
==============================================================================
--- incubator/activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPATopicMessageStore.java
(original)
+++ incubator/activemq/trunk/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPATopicMessageStore.java
Tue Jan  2 09:26:32 2007
@@ -123,7 +123,7 @@
 	}
 
 	public int getMessageCount(String clientId, String subscriptionName) throws IOException
{
-		Integer rc;
+		Long rc;
 		EntityManager manager = adapter.beginEntityManager(null);
 		try {	
 			Query query = manager.createQuery(
@@ -131,17 +131,17 @@
 					"where ss.clientId=?1 " +
 					"and   ss.subscriptionName=?2 " +
 					"and   ss.destination=?3 " +
-					"and   m.desination=ss.destination and m.id > ss.lastAckedId");
+					"and   m.destination=ss.destination and m.id > ss.lastAckedId");
 			query.setParameter(1, clientId);
 			query.setParameter(2, subscriptionName);
-			query.setParameter(2, destinationName);
-	        rc = (Integer) query.getSingleResult();	        
+			query.setParameter(3, destinationName);
+	        rc = (Long) query.getSingleResult();	        
 		} catch (Throwable e) {
 			adapter.rollbackEntityManager(null,manager);
 			throw IOExceptionSupport.create(e);
 		}
 		adapter.commitEntityManager(null,manager);
-		return rc;
+		return rc.intValue();
 	}
 
 	public SubscriptionInfo lookupSubscription(String clientId, String subscriptionName) throws
IOException {

Added: incubator/activemq/trunk/activemq-jpa-store/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-jpa-store/src/test/resources/log4j.properties?view=auto&rev=491857
==============================================================================
--- incubator/activemq/trunk/activemq-jpa-store/src/test/resources/log4j.properties (added)
+++ incubator/activemq/trunk/activemq-jpa-store/src/test/resources/log4j.properties Tue Jan
 2 09:26:32 2007
@@ -0,0 +1,35 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You 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 OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#
+# The logging properties used during tests..
+#
+log4j.rootLogger=INFO, out
+
+log4j.logger.org.apache.activemq.spring=WARN
+
+# CONSOLE appender not used by default
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/activemq-test.log
+log4j.appender.out.append=true



Mime
View raw message