diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2007-10-10 03:36:19 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2007-10-10 03:36:19 +0000 |
| commit | 935b2daeb76d7ce3e83bd161a29b4fdabdfa7bbb (patch) | |
| tree | 20ffc45e3f3c25011b2a0bdd744c7893f779c132 /qpid/java/client/src | |
| parent | 307a4cf73eda3392bd8195c78e66a07672667537 (diff) | |
| download | qpid-python-935b2daeb76d7ce3e83bd161a29b4fdabdfa7bbb.tar.gz | |
Removed system.outs and replaced with log statements
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@583351 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client/src')
5 files changed, 37 insertions, 29 deletions
diff --git a/qpid/java/client/src/main/java/client.log4j b/qpid/java/client/src/main/java/client.log4j index 525433e9a9..c7b6630987 100644 --- a/qpid/java/client/src/main/java/client.log4j +++ b/qpid/java/client/src/main/java/client.log4j @@ -6,9 +6,9 @@ # 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
@@ -19,8 +19,15 @@ log4j.rootLogger=${root.logging.level}
-log4j.logger.org.apache.qpid=${amqj.logging.level}, console
+#log4j.logger.org.apache.qpid=${amqj.logging.level}, console
+#log4j.additivity.org.apache.qpid=false
+#log4j.logger.org.apache.qpidity.transport=TRACE, console
+
+log4j.logger.org.apache.qpid=MAJOR, console
log4j.additivity.org.apache.qpid=false
+log4j.logger.org.apache.qpidity.transport=MAJOR, console
+log4j.logger.org.apache.qpid.testutil.QpidTestCase=MAJOR, console
+
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.Threshold=all
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java index cf8ecd74ac..10fd7c410b 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java @@ -96,7 +96,7 @@ public class BasicMessageProducer_0_10 extends BasicMessageProducer BasicContentHeaderProperties contentHeaderProperties = message.getContentHeaderProperties(); // set the application properties qpidityMessage.getMessageProperties().setContentType(contentHeaderProperties.getContentType().toString()); - qpidityMessage.getMessageProperties().setMessageId(message.getJMSMessageID()) ; + qpidityMessage.getMessageProperties().setMessageId(message.getJMSMessageID()) ; AMQShortString correlationID = contentHeaderProperties.getCorrelationId(); if( correlationID != null ) { @@ -125,7 +125,7 @@ public class BasicMessageProducer_0_10 extends BasicMessageProducer for(String key:qpidityMessage.getMessageProperties().getApplicationHeaders().keySet()) { - System.out.println(key + "=" + qpidityMessage.getMessageProperties().getApplicationHeaders().get(key)); + _logger.debug(key + "=" + qpidityMessage.getMessageProperties().getApplicationHeaders().get(key)); } } // send the message diff --git a/qpid/java/client/src/main/java/org/apache/qpidity/nclient/interop/BasicInteropTest.java b/qpid/java/client/src/main/java/org/apache/qpidity/nclient/interop/BasicInteropTest.java index 4ea8df3273..54765ea72e 100644 --- a/qpid/java/client/src/main/java/org/apache/qpidity/nclient/interop/BasicInteropTest.java +++ b/qpid/java/client/src/main/java/org/apache/qpidity/nclient/interop/BasicInteropTest.java @@ -81,6 +81,8 @@ public class BasicInteropTest implements ClosedListener props.put("spf", 8.5); session.header(new DeliveryProperties().setRoutingKey("testKey"),new MessageProperties().setApplicationHeaders(props)); + //session.header(new DeliveryProperties().setRoutingKey("testKey")); + session.data("TestMessage"); session.endData(); session.sync(); diff --git a/qpid/java/client/src/main/java/org/apache/qpidity/nclient/util/ByteBufferMessage.java b/qpid/java/client/src/main/java/org/apache/qpidity/nclient/util/ByteBufferMessage.java index 8441c9f629..5e87d63966 100644 --- a/qpid/java/client/src/main/java/org/apache/qpidity/nclient/util/ByteBufferMessage.java +++ b/qpid/java/client/src/main/java/org/apache/qpidity/nclient/util/ByteBufferMessage.java @@ -14,8 +14,8 @@ import org.apache.qpidity.api.Message; * for small messages. When the readData methods are called * we assume the message is complete. i.e there want be any * appendData operations after that.</p> - * - * <p>If you need large message support please see + * + * <p>If you need large message support please see * <code>FileMessage</code> and <code>StreamingMessage</code> * </p> */ @@ -23,7 +23,7 @@ public class ByteBufferMessage implements Message { private Queue<ByteBuffer> _data = new LinkedList<ByteBuffer>(); private ByteBuffer _readBuffer; - private int _dataSize; + private int _dataSize; private DeliveryProperties _currentDeliveryProps; private MessageProperties _currentMessageProps; private long _transferId; @@ -37,19 +37,19 @@ public class ByteBufferMessage implements Message public ByteBufferMessage(long transferId) { _transferId = transferId; - } - + } + public long getMessageTransferId() { return _transferId; } - + public void clearData() { _data = new LinkedList<ByteBuffer>(); _readBuffer = null; } - + public void appendData(byte[] src) throws IOException { appendData(ByteBuffer.wrap(src)); @@ -61,9 +61,9 @@ public class ByteBufferMessage implements Message public void appendData(ByteBuffer src) throws IOException { _data.offer(src); - _dataSize += src.remaining(); + _dataSize += src.remaining(); } - + public DeliveryProperties getDeliveryProperties() { return _currentDeliveryProps; @@ -71,10 +71,9 @@ public class ByteBufferMessage implements Message public MessageProperties getMessageProperties() { - System.out.println("MessageProperties is null ? " + _currentMessageProps == null? "true":"false"); return _currentMessageProps; } - + public void setDeliveryProperties(DeliveryProperties props) { _currentDeliveryProps = props; @@ -84,17 +83,17 @@ public class ByteBufferMessage implements Message { _currentMessageProps = props; } - + public void readData(byte[] target) throws IOException { getReadBuffer().get(target); } - + public ByteBuffer readData() throws IOException - { + { return getReadBuffer(); } - + private void buildReadBuffer() { //optimize for the simple cases @@ -112,13 +111,13 @@ public class ByteBufferMessage implements Message _readBuffer.flip(); } } - + private ByteBuffer getReadBuffer() throws IOException { if (_readBuffer != null ) { return _readBuffer.slice(); - } + } else { if (_data.size() >0) @@ -132,7 +131,7 @@ public class ByteBufferMessage implements Message } } } - + //hack for testing @Override public String toString() { diff --git a/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidTestCase.java b/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidTestCase.java index bd27550387..fcdd42639d 100644 --- a/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidTestCase.java +++ b/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidTestCase.java @@ -5,9 +5,9 @@ * 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 @@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory; */ public class QpidTestCase extends TestCase { - + /* this clas logger */ private static final Logger _logger = LoggerFactory.getLogger(QpidTestCase.class); @@ -91,7 +91,7 @@ public class QpidTestCase extends TestCase // create an in_VM broker TransportConnection.createVMBroker(1); } - _logger.info("========================================="); + _logger.info("========================================="); _logger.info("= " + _shel + " " + _brokerPath + " " + _brokerParams); } @@ -116,7 +116,7 @@ public class QpidTestCase extends TestCase super.tearDown(); } - //--------- Util method + //--------- Util method /** * This method starts a remote server by spawning an external process. @@ -134,7 +134,7 @@ public class QpidTestCase extends TestCase //bad, we had an error starting the broker throw new Exception("Problem when starting the broker: " + reader.readLine()); } - // We need to wait for th ebroker to start ideally we would need to ping it + // We need to wait for th ebroker to start ideally we would need to ping it synchronized(this) { this.wait(1000); |
