You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2017/10/25 13:50:55 UTC
[3/5] qpid-interop-test git commit: QPIDIT-97: Further fixes and
updates for the release of 0.1.0
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-jms/src/main/java/org/apache/qpid/qpid_interop_test/jms_messages_test/Sender.java
----------------------------------------------------------------------
diff --git a/shims/qpid-jms/src/main/java/org/apache/qpid/qpid_interop_test/jms_messages_test/Sender.java b/shims/qpid-jms/src/main/java/org/apache/qpid/qpid_interop_test/jms_messages_test/Sender.java
deleted file mode 100644
index 5348663..0000000
--- a/shims/qpid-jms/src/main/java/org/apache/qpid/qpid_interop_test/jms_messages_test/Sender.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/**
- * 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.
- */
-package org.apache.qpid.qpid_interop_test.jms_messages_test;
-
-import java.io.Serializable;
-import java.io.StringReader;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-import javax.json.Json;
-import javax.json.JsonArray;
-import javax.json.JsonObject;
-import javax.json.JsonReader;
-import org.apache.qpid.jms.JmsConnectionFactory;
-
-public class Sender {
- private static final String USER = "guest";
- private static final String PASSWORD = "guest";
- private static final String[] SUPPORTED_JMS_MESSAGE_TYPES = {"JMS_MESSAGE_TYPE",
- "JMS_BYTESMESSAGE_TYPE",
- "JMS_MAPMESSAGE_TYPE",
- "JMS_OBJECTMESSAGE_TYPE",
- "JMS_STREAMMESSAGE_TYPE",
- "JMS_TEXTMESSAGE_TYPE"};
- Connection _connection;
- Session _session;
- Queue _queue;
- MessageProducer _messageProducer;
- int _msgsSent;
-
-
- // args[0]: Broker URL
- // args[1]: Queue name
- // args[2]: JMS message type
- // args[3]: JSON Test parameters containing testValueMap
- public static void main(String[] args) throws Exception {
- if (args.length != 4) {
- System.out.println("JmsSenderShim: Incorrect number of arguments");
- System.out.println("JmsSenderShim: Expected arguments: broker_address, queue_name, JMS_msg_type, JSON_send_params");
- System.exit(1);
- }
- String brokerAddress = "amqp://" + args[0];
- String queueName = args[1];
- String jmsMessageType = args[2];
- if (!isSupportedJmsMessageType(jmsMessageType)) {
- System.err.println("ERROR: JmsSender: Unknown or unsupported JMS message type \"" + jmsMessageType + "\"");
- System.exit(1);
- }
-
- JsonReader jsonReader = Json.createReader(new StringReader(args[3]));
- JsonObject testValuesMap = jsonReader.readObject();
- jsonReader.close();
-
- Sender shim = new Sender(brokerAddress, queueName);
- shim.runTests(jmsMessageType, testValuesMap);
- }
-
- public Sender(String brokerAddress, String queueName) {
- try {
- ConnectionFactory factory = (ConnectionFactory)new JmsConnectionFactory(brokerAddress);
-
- _connection = factory.createConnection();
- _connection.setExceptionListener(new MyExceptionListener());
- _connection.start();
-
- _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _queue = _session.createQueue(queueName);
-
- _messageProducer = _session.createProducer(_queue);
-
- _msgsSent = 0;
- } catch (Exception exp) {
- System.out.println("Caught exception, exiting.");
- exp.printStackTrace(System.out);
- System.exit(1);
- }
- }
-
- public void runTests(String jmsMessageType, JsonObject testValuesMap) throws Exception {
- List<String> testValuesKeyList = new ArrayList<String>(testValuesMap.keySet());
- Collections.sort(testValuesKeyList);
- for (String key: testValuesKeyList) {
- JsonArray testValues = testValuesMap.getJsonArray(key);
- for (int i=0; i<testValues.size(); ++i) {
- String testValue = "";
- if (!testValues.isNull(i)) {
- testValue = testValues.getJsonString(i).getString();
- }
-
- // Send message
- Message msg = createMessage(jmsMessageType, key, testValue, i);
- _messageProducer.send(msg, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE);
- _msgsSent++;
- }
- }
- _connection.close();
- }
-
- protected Message createMessage(String jmsMessageType, String key, String testValue, int i) throws Exception {
- Message message = null;
- switch (jmsMessageType) {
- case "JMS_MESSAGE_TYPE":
- message = createJMSMessage(key, testValue);
- break;
- case "JMS_BYTESMESSAGE_TYPE":
- message = createJMSBytesMessage(key, testValue);
- break;
- case "JMS_MAPMESSAGE_TYPE":
- message = createJMSMapMessage(key, testValue, i);
- break;
- case "JMS_OBJECTMESSAGE_TYPE":
- message = createJMSObjectMessage(key, testValue);
- break;
- case "JMS_STREAMMESSAGE_TYPE":
- message = createJMSStreamMessage(key, testValue);
- break;
- case "JMS_TEXTMESSAGE_TYPE":
- message = createTextMessage(testValue);
- break;
- default:
- throw new Exception("Internal exception: Unexpected JMS message type \"" + jmsMessageType + "\"");
- }
- return message;
- }
-
- protected Message createJMSMessage(String testValueType, String testValue) throws Exception, JMSException {
- if (testValueType.compareTo("none") != 0) {
- throw new Exception("Internal exception: Unexpected JMS message sub-type \"" + testValueType + "\"");
- }
- if (testValue.length() > 0) {
- throw new Exception("Internal exception: Unexpected JMS message value \"" + testValue + "\" for sub-type \"" + testValueType + "\"");
- }
- return _session.createMessage();
- }
-
- protected BytesMessage createJMSBytesMessage(String testValueType, String testValue) throws Exception, JMSException {
- BytesMessage message = _session.createBytesMessage();
- switch (testValueType) {
- case "boolean":
- message.writeBoolean(Boolean.parseBoolean(testValue));
- break;
- case "byte":
- message.writeByte(Byte.decode(testValue));
- break;
- case "bytes":
- message.writeBytes(testValue.getBytes());
- break;
- case "char":
- if (testValue.length() == 1) { // Char format: "X" or "\xNN"
- message.writeChar(testValue.charAt(0));
- } else {
- throw new Exception("JmsSenderShim.createJMSBytesMessage() Malformed char string: \"" + testValue + "\" of length " + testValue.length());
- }
- break;
- case "double":
- Long l1 = Long.parseLong(testValue.substring(2, 3), 16) << 60;
- Long l2 = Long.parseLong(testValue.substring(3), 16);
- message.writeDouble(Double.longBitsToDouble(l1 | l2));
- break;
- case "float":
- Long i = Long.parseLong(testValue.substring(2), 16);
- message.writeFloat(Float.intBitsToFloat(i.intValue()));
- break;
- case "int":
- message.writeInt(Integer.decode(testValue));
- break;
- case "long":
- message.writeLong(Long.decode(testValue));
- break;
- case "object":
- Object obj = (Object)createObject(testValue);
- message.writeObject(obj);
- break;
- case "short":
- message.writeShort(Short.decode(testValue));
- break;
- case "string":
- message.writeUTF(testValue);
- break;
- default:
- throw new Exception("Internal exception: Unexpected JMS message sub-type \"" + testValueType + "\"");
- }
- return message;
- }
-
- protected MapMessage createJMSMapMessage(String testValueType, String testValue, int testValueNum) throws Exception, JMSException {
- MapMessage message = _session.createMapMessage();
- String name = String.format("%s%03d", testValueType, testValueNum);
- switch (testValueType) {
- case "boolean":
- message.setBoolean(name, Boolean.parseBoolean(testValue));
- break;
- case "byte":
- message.setByte(name, Byte.decode(testValue));
- break;
- case "bytes":
- message.setBytes(name, testValue.getBytes());
- break;
- case "char":
- if (testValue.length() == 1) { // Char format: "X"
- message.setChar(name, testValue.charAt(0));
- } else if (testValue.length() == 6) { // Char format: "\xNNNN"
- message.setChar(name, (char)Integer.parseInt(testValue.substring(2), 16));
- } else {
- throw new Exception("JmsSenderShim.createJMSMapMessage() Malformed char string: \"" + testValue + "\"");
- }
- break;
- case "double":
- Long l1 = Long.parseLong(testValue.substring(2, 3), 16) << 60;
- Long l2 = Long.parseLong(testValue.substring(3), 16);
- message.setDouble(name, Double.longBitsToDouble(l1 | l2));
- break;
- case "float":
- Long i = Long.parseLong(testValue.substring(2), 16);
- message.setFloat(name, Float.intBitsToFloat(i.intValue()));
- break;
- case "int":
- message.setInt(name, Integer.decode(testValue));
- break;
- case "long":
- message.setLong(name, Long.decode(testValue));
- break;
- case "object":
- Object obj = (Object)createObject(testValue);
- message.setObject(name, obj);
- break;
- case "short":
- message.setShort(name, Short.decode(testValue));
- break;
- case "string":
- message.setString(name, testValue);
- break;
- default:
- throw new Exception("Internal exception: Unexpected JMS message sub-type \"" + testValueType + "\"");
- }
- return message;
- }
-
- protected ObjectMessage createJMSObjectMessage(String className, String testValue) throws Exception, JMSException {
- Serializable obj = createJavaObject(className, testValue);
- if (obj == null) {
- // TODO: Handle error here
- System.out.println("JmsSenderShim.createJMSObjectMessage: obj == null");
- return null;
- }
- ObjectMessage message = _session.createObjectMessage();
- message.setObject(obj);
- return message;
- }
-
- protected StreamMessage createJMSStreamMessage(String testValueType, String testValue) throws Exception, JMSException {
- StreamMessage message = _session.createStreamMessage();
- switch (testValueType) {
- case "boolean":
- message.writeBoolean(Boolean.parseBoolean(testValue));
- break;
- case "byte":
- message.writeByte(Byte.decode(testValue));
- break;
- case "bytes":
- message.writeBytes(testValue.getBytes());
- break;
- case "char":
- if (testValue.length() == 1) { // Char format: "X"
- message.writeChar(testValue.charAt(0));
- } else if (testValue.length() == 6) { // Char format: "\xNNNN"
- message.writeChar((char)Integer.parseInt(testValue.substring(2), 16));
- } else {
- throw new Exception("JmsSenderShim.createJMSStreamMessage() Malformed char string: \"" + testValue + "\"");
- }
- break;
- case "double":
- Long l1 = Long.parseLong(testValue.substring(2, 3), 16) << 60;
- Long l2 = Long.parseLong(testValue.substring(3), 16);
- message.writeDouble(Double.longBitsToDouble(l1 | l2));
- break;
- case "float":
- Long i = Long.parseLong(testValue.substring(2), 16);
- message.writeFloat(Float.intBitsToFloat(i.intValue()));
- break;
- case "int":
- message.writeInt(Integer.decode(testValue));
- break;
- case "long":
- message.writeLong(Long.decode(testValue));
- break;
- case "object":
- Object obj = (Object)createObject(testValue);
- message.writeObject(obj);
- break;
- case "short":
- message.writeShort(Short.decode(testValue));
- break;
- case "string":
- message.writeString(testValue);
- break;
- default:
- throw new Exception("JmsSenderShim.createJMSStreamMessage(): Unexpected JMS message sub-type \"" + testValueType + "\"");
- }
- return message;
- }
-
- protected static Serializable createJavaObject(String className, String testValue) throws Exception {
- Serializable obj = null;
- try {
- Class<?> c = Class.forName(className);
- if (className.compareTo("java.lang.Character") == 0) {
- Constructor ctor = c.getConstructor(char.class);
- if (testValue.length() == 1) {
- // Use first character of string
- obj = (Serializable)ctor.newInstance(testValue.charAt(0));
- } else if (testValue.length() == 4 || testValue.length() == 6) {
- // Format '\xNN' or '\xNNNN'
- obj = (Serializable)ctor.newInstance((char)Integer.parseInt(testValue.substring(2), 16));
- } else {
- throw new Exception("JmsSenderShim.createJavaObject(): Malformed char string: \"" + testValue + "\"");
- }
- } else {
- // Use string constructor
- Constructor ctor = c.getConstructor(String.class);
- obj = (Serializable)ctor.newInstance(testValue);
- }
- }
- catch (ClassNotFoundException e) {
- e.printStackTrace(System.out);
- }
- catch (NoSuchMethodException e) {
- e.printStackTrace(System.out);
- }
- catch (InstantiationException e) {
- e.printStackTrace(System.out);
- }
- catch (IllegalAccessException e) {
- e.printStackTrace(System.out);
- }
- catch (InvocationTargetException e) {
- e.printStackTrace(System.out);
- }
- return obj;
- }
-
- // value has format "classname:ctorstrvalue"
- protected static Serializable createObject(String value) throws Exception {
- Serializable obj = null;
- int colonIndex = value.indexOf(":");
- if (colonIndex >= 0) {
- String className = value.substring(0, colonIndex);
- String testValue = value.substring(colonIndex+1);
- obj = createJavaObject(className, testValue);
- } else {
- throw new Exception("createObject(): Malformed value string");
- }
- return obj;
- }
-
- protected TextMessage createTextMessage(String valueStr) throws JMSException {
- return _session.createTextMessage(valueStr);
- }
-
- protected static boolean isSupportedJmsMessageType(String jmsMessageType) {
- for (String supportedJmsMessageType: SUPPORTED_JMS_MESSAGE_TYPES) {
- if (jmsMessageType.equals(supportedJmsMessageType))
- return true;
- }
- return false;
- }
-
- private static class MyExceptionListener implements ExceptionListener {
- @Override
- public void onException(JMSException exception) {
- System.out.println("Connection ExceptionListener fired, exiting.");
- exception.printStackTrace(System.out);
- System.exit(1);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_dtx_test/Receiver.java
----------------------------------------------------------------------
diff --git a/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_dtx_test/Receiver.java b/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_dtx_test/Receiver.java
deleted file mode 100644
index 0614e15..0000000
--- a/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_dtx_test/Receiver.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/**
- * 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.
- */
-package org.apache.qpid.qpid_interop_test.jms_dtx_test;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.json.Json;
-import javax.json.JsonArray;
-import javax.json.JsonArrayBuilder;
-import javax.json.JsonObject;
-import javax.json.JsonObjectBuilder;
-import javax.json.JsonReader;
-import javax.json.JsonWriter;
-import org.apache.qpid.jms.JmsConnectionFactory;
-
-public class Receiver {
- private static final String USER = "guest";
- private static final String PASSWORD = "guest";
- private static final int TIMEOUT = 1000;
- private static final String[] SUPPORTED_JMS_MESSAGE_TYPES = {"JMS_MESSAGE_TYPE",
- "JMS_BYTESMESSAGE_TYPE",
- "JMS_MAPMESSAGE_TYPE",
- "JMS_OBJECTMESSAGE_TYPE",
- "JMS_STREAMMESSAGE_TYPE",
- "JMS_TEXTMESSAGE_TYPE"};
- private static enum JMS_DESTINATION_TYPE {JMS_QUEUE, JMS_TEMPORARY_QUEUE, JMS_TOPIC, JMS_TEMPORARY_TOPIC};
-
- Connection _connection;
- Session _session;
- Queue _queue;
- MessageConsumer _messageConsumer;
- JsonObjectBuilder _jsonTestValueMapBuilder;
-
- // args[0]: Broker URL
- // args[1]: Queue name
- // args[2]: JMS message type
- // args[3]: JSON Test parameters containing testValuesMap
- public static void main(String[] args) throws Exception {
- if (args.length != 4) {
- System.out.println("JmsReceiverShim: Incorrect number of arguments");
- System.out.println("JmsReceiverShim: Expected arguments: broker_address, queue_name, JMS_msg_type, JSON_receive_params");
- System.exit(1);
- }
- String brokerAddress = "amqp://" + args[0];
- String queueName = args[1];
- String jmsMessageType = args[2];
- if (!isSupportedJmsMessageType(jmsMessageType)) {
- System.out.println("ERROR: JmsReceiverShim: Unknown or unsupported JMS message type \"" + jmsMessageType + "\"");
- System.exit(1);
- }
-
- JsonReader jsonReader = Json.createReader(new StringReader(args[3]));
- JsonObject numTestValuesMap = jsonReader.readObject();
- jsonReader.close();
-
- Receiver shim = new Receiver(brokerAddress, queueName);
- shim.run(jmsMessageType, numTestValuesMap);
- }
-
- public Receiver(String brokerAddress, String queueName) {
- try {
- _connection = null;
- ConnectionFactory factory = (ConnectionFactory)new JmsConnectionFactory(brokerAddress);
- _connection = factory.createConnection(USER, PASSWORD);
- _connection.setExceptionListener(new MyExceptionListener());
- _connection.start();
-
- _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _queue = _session.createQueue(queueName);
-
- _messageConsumer = _session.createConsumer(_queue);
-
- _jsonTestValueMapBuilder = Json.createObjectBuilder();
- } catch (Exception exc) {
- if (_connection != null)
- try { _connection.close(); } catch (JMSException e) {}
- System.out.println("Caught exception, exiting.");
- exc.printStackTrace(System.out);
- System.exit(1);
- }
- }
-
- public void run(String jmsMessageType, JsonObject numTestValuesMap) {
- try {
- List<String> subTypeKeyList = new ArrayList<String>(numTestValuesMap.keySet());
- Collections.sort(subTypeKeyList);
-
- Message message = null;
-
- for (String subType: subTypeKeyList) {
- JsonArrayBuilder jasonTestValuesArrayBuilder = Json.createArrayBuilder();
- for (int i=0; i<numTestValuesMap.getJsonNumber(subType).intValue(); ++i) {
- message = _messageConsumer.receive(TIMEOUT);
- if (message == null) break;
- switch (jmsMessageType) {
- case "JMS_MESSAGE_TYPE":
- processJMSMessage(jasonTestValuesArrayBuilder);
- break;
- case "JMS_BYTESMESSAGE_TYPE":
- processJMSBytesMessage(jmsMessageType, subType, message, jasonTestValuesArrayBuilder);
- break;
- case "JMS_STREAMMESSAGE_TYPE":
- processJMSStreamMessage(jmsMessageType, subType, message, jasonTestValuesArrayBuilder);
- break;
- case "JMS_MAPMESSAGE_TYPE":
- processJMSMapMessage(jmsMessageType, subType, i, message, jasonTestValuesArrayBuilder);
- break;
- case "JMS_OBJECTMESSAGE_TYPE":
- processJMSObjectMessage(subType, message, jasonTestValuesArrayBuilder);
- break;
- case "JMS_TEXTMESSAGE_TYPE":
- processJMSTextMessage(message, jasonTestValuesArrayBuilder);
- break;
- default:
- _connection.close();
- throw new Exception("JmsReceiverShim: Internal error: Unknown or unsupported JMS message type \"" + jmsMessageType + "\"");
- }
- }
- _jsonTestValueMapBuilder.add(subType, jasonTestValuesArrayBuilder);
- }
- _connection.close();
-
- System.out.println(jmsMessageType);
- StringWriter out = new StringWriter();
- writeJsonObject(_jsonTestValueMapBuilder, out);
- System.out.println(out.toString());
- } catch (Exception exp) {
- try { _connection.close(); } catch (JMSException e) {}
- System.out.println("Caught exception, exiting.");
- exp.printStackTrace(System.out);
- System.exit(1);
- }
- }
-
- protected void processJMSMessage(JsonArrayBuilder jasonTestValuesArrayBuilder) {
- jasonTestValuesArrayBuilder.addNull();
- }
-
- protected void processJMSBytesMessage(String jmsMessageType, String subType, Message message, JsonArrayBuilder jasonTestValuesArrayBuilder) throws Exception, JMSException, IOException, ClassNotFoundException {
- switch (subType) {
- case "boolean":
- jasonTestValuesArrayBuilder.add(((BytesMessage)message).readBoolean()?"True":"False");
- break;
- case "byte":
- jasonTestValuesArrayBuilder.add(formatByte(((BytesMessage)message).readByte()));
- break;
- case "bytes":
- {
- byte[] bytesBuff = new byte[65536];
- int numBytesRead = ((BytesMessage)message).readBytes(bytesBuff);
- if (numBytesRead >= 0) {
- jasonTestValuesArrayBuilder.add(new String(Arrays.copyOfRange(bytesBuff, 0, numBytesRead)));
- } else {
- // NOTE: For this case, an empty byte array has nothing to return
- jasonTestValuesArrayBuilder.add(new String());
- }
- }
- break;
- case "char":
- jasonTestValuesArrayBuilder.add(formatChar(((BytesMessage)message).readChar()));
- break;
- case "double":
- long l = Double.doubleToRawLongBits(((BytesMessage)message).readDouble());
- jasonTestValuesArrayBuilder.add(String.format("0x%16s", Long.toHexString(l)).replace(' ', '0'));
- break;
- case "float":
- int i0 = Float.floatToRawIntBits(((BytesMessage)message).readFloat());
- jasonTestValuesArrayBuilder.add(String.format("0x%8s", Integer.toHexString(i0)).replace(' ', '0'));
- break;
- case "int":
- jasonTestValuesArrayBuilder.add(formatInt(((BytesMessage)message).readInt()));
- break;
- case "long":
- jasonTestValuesArrayBuilder.add(formatLong(((BytesMessage)message).readLong()));
- break;
- case "object":
- {
- byte[] bytesBuff = new byte[65536];
- int numBytesRead = ((BytesMessage)message).readBytes(bytesBuff);
- if (numBytesRead >= 0) {
- ByteArrayInputStream bais = new ByteArrayInputStream(Arrays.copyOfRange(bytesBuff, 0, numBytesRead));
- ObjectInputStream ois = new ObjectInputStream(bais);
- Object obj = ois.readObject();
- jasonTestValuesArrayBuilder.add(obj.getClass().getName() + ":" + obj.toString());
- } else {
- jasonTestValuesArrayBuilder.add("<object error>");
- }
- }
- break;
- case "short":
- jasonTestValuesArrayBuilder.add(formatShort(((BytesMessage)message).readShort()));
- break;
- case "string":
- jasonTestValuesArrayBuilder.add(((BytesMessage)message).readUTF());
- break;
- default:
- throw new Exception("JmsReceiverShim: Unknown subtype for " + jmsMessageType + ": \"" + subType + "\"");
- }
- }
-
- protected void processJMSMapMessage(String jmsMessageType, String subType, int count, Message message, JsonArrayBuilder jasonTestValuesArrayBuilder) throws Exception, JMSException {
- String name = String.format("%s%03d", subType, count);
- switch (subType) {
- case "boolean":
- jasonTestValuesArrayBuilder.add(((MapMessage)message).getBoolean(name)?"True":"False");
- break;
- case "byte":
- jasonTestValuesArrayBuilder.add(formatByte(((MapMessage)message).getByte(name)));
- break;
- case "bytes":
- jasonTestValuesArrayBuilder.add(new String(((MapMessage)message).getBytes(name)));
- break;
- case "char":
- jasonTestValuesArrayBuilder.add(formatChar(((MapMessage)message).getChar(name)));
- break;
- case "double":
- long l = Double.doubleToRawLongBits(((MapMessage)message).getDouble(name));
- jasonTestValuesArrayBuilder.add(String.format("0x%16s", Long.toHexString(l)).replace(' ', '0'));
- break;
- case "float":
- int i0 = Float.floatToRawIntBits(((MapMessage)message).getFloat(name));
- jasonTestValuesArrayBuilder.add(String.format("0x%8s", Integer.toHexString(i0)).replace(' ', '0'));
- break;
- case "int":
- jasonTestValuesArrayBuilder.add(formatInt(((MapMessage)message).getInt(name)));
- break;
- case "long":
- jasonTestValuesArrayBuilder.add(formatLong(((MapMessage)message).getLong(name)));
- break;
- case "object":
- Object obj = ((MapMessage)message).getObject(name);
- jasonTestValuesArrayBuilder.add(obj.getClass().getName() + ":" + obj.toString());
- break;
- case "short":
- jasonTestValuesArrayBuilder.add(formatShort(((MapMessage)message).getShort(name)));
- break;
- case "string":
- jasonTestValuesArrayBuilder.add(((MapMessage)message).getString(name));
- break;
- default:
- throw new Exception("JmsReceiverShim: Unknown subtype for " + jmsMessageType + ": \"" + subType + "\"");
- }
- }
-
- protected void processJMSObjectMessage(String subType, Message message, JsonArrayBuilder jasonTestValuesArrayBuilder) throws JMSException {
- jasonTestValuesArrayBuilder.add(((ObjectMessage)message).getObject().toString());
- }
-
- protected void processJMSStreamMessage(String jmsMessageType, String subType, Message message, JsonArrayBuilder jasonTestValuesArrayBuilder) throws Exception, JMSException {
- switch (subType) {
- case "boolean":
- jasonTestValuesArrayBuilder.add(((StreamMessage)message).readBoolean()?"True":"False");
- break;
- case "byte":
- jasonTestValuesArrayBuilder.add(formatByte(((StreamMessage)message).readByte()));
- break;
- case "bytes":
- byte[] bytesBuff = new byte[65536];
- int numBytesRead = ((StreamMessage)message).readBytes(bytesBuff);
- if (numBytesRead >= 0) {
- jasonTestValuesArrayBuilder.add(new String(Arrays.copyOfRange(bytesBuff, 0, numBytesRead)));
- } else {
- System.out.println("StreamMessage.readBytes() returned " + numBytesRead);
- jasonTestValuesArrayBuilder.add("<bytes error>");
- }
- break;
- case "char":
- jasonTestValuesArrayBuilder.add(formatChar(((StreamMessage)message).readChar()));
- break;
- case "double":
- long l = Double.doubleToRawLongBits(((StreamMessage)message).readDouble());
- jasonTestValuesArrayBuilder.add(String.format("0x%16s", Long.toHexString(l)).replace(' ', '0'));
- break;
- case "float":
- int i0 = Float.floatToRawIntBits(((StreamMessage)message).readFloat());
- jasonTestValuesArrayBuilder.add(String.format("0x%8s", Integer.toHexString(i0)).replace(' ', '0'));
- break;
- case "int":
- jasonTestValuesArrayBuilder.add(formatInt(((StreamMessage)message).readInt()));
- break;
- case "long":
- jasonTestValuesArrayBuilder.add(formatLong(((StreamMessage)message).readLong()));
- break;
- case "object":
- Object obj = ((StreamMessage)message).readObject();
- jasonTestValuesArrayBuilder.add(obj.getClass().getName() + ":" + obj.toString());
- break;
- case "short":
- jasonTestValuesArrayBuilder.add(formatShort(((StreamMessage)message).readShort()));
- break;
- case "string":
- jasonTestValuesArrayBuilder.add(((StreamMessage)message).readString());
- break;
- default:
- throw new Exception("JmsReceiverShim: Unknown subtype for " + jmsMessageType + ": \"" + subType + "\"");
- }
- }
-
- protected void processJMSTextMessage(Message message, JsonArrayBuilder jasonTestValuesArrayBuilder) throws JMSException {
- jasonTestValuesArrayBuilder.add(((TextMessage)message).getText());
- }
-
- protected static void writeJsonObject(JsonObjectBuilder builder, StringWriter out) {
- JsonWriter jsonWriter = Json.createWriter(out);
- jsonWriter.writeObject(builder.build());
- jsonWriter.close();
- }
-
- protected static String formatByte(byte b) {
- boolean neg = false;
- if (b < 0) {
- neg = true;
- b = (byte)-b;
- }
- return String.format("%s0x%x", neg?"-":"", b);
- }
-
- protected static String formatChar(char c) {
- if (Character.isLetterOrDigit(c)) {
- return String.format("%c", c);
- }
- char[] ca = {c};
- return new String(ca);
- }
-
- protected static String formatInt(int i) {
- boolean neg = false;
- if (i < 0) {
- neg = true;
- i = -i;
- }
- return String.format("%s0x%x", neg?"-":"", i);
- }
-
- protected static String formatLong(long l) {
- boolean neg = false;
- if (l < 0) {
- neg = true;
- l = -l;
- }
- return String.format("%s0x%x", neg?"-":"", l);
- }
-
- protected static String formatShort(int s) {
- boolean neg = false;
- if (s < 0) {
- neg = true;
- s = -s;
- }
- return String.format("%s0x%x", neg?"-":"", s);
- }
-
- protected static boolean isSupportedJmsMessageType(String jmsMessageType) {
- for (String supportedJmsMessageType: SUPPORTED_JMS_MESSAGE_TYPES) {
- if (jmsMessageType.equals(supportedJmsMessageType))
- return true;
- }
- return false;
- }
-
- private static class MyExceptionListener implements ExceptionListener {
- @Override
- public void onException(JMSException exception) {
- System.out.println("Connection ExceptionListener fired, exiting.");
- exception.printStackTrace(System.out);
- System.exit(1);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_dtx_test/Sender.java
----------------------------------------------------------------------
diff --git a/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_dtx_test/Sender.java b/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_dtx_test/Sender.java
deleted file mode 100644
index c5b3506..0000000
--- a/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_dtx_test/Sender.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * 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.
- */
-package org.apache.qpid.qpid_interop_test.jms_dtx_test;
-
-import java.io.Serializable;
-import java.io.StringReader;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-import javax.json.Json;
-import javax.json.JsonArray;
-import javax.json.JsonObject;
-import javax.json.JsonReader;
-import org.apache.qpid.jms.JmsConnectionFactory;
-
-public class Sender {
- private static final String USER = "guest";
- private static final String PASSWORD = "guest";
- private static final String[] SUPPORTED_JMS_MESSAGE_TYPES = {"JMS_MESSAGE_TYPE",
- "JMS_BYTESMESSAGE_TYPE",
- "JMS_MAPMESSAGE_TYPE",
- "JMS_OBJECTMESSAGE_TYPE",
- "JMS_STREAMMESSAGE_TYPE",
- "JMS_TEXTMESSAGE_TYPE"};
- Connection _connection;
- Session _session;
- Queue _queue;
- MessageProducer _messageProducer;
- int _msgsSent;
-
-
- // args[0]: Broker URL
- // args[1]: Queue name
- // ...
- public static void main(String[] args) throws Exception {
- if (args.length != 2) {
- System.out.println("JmsSenderShim: Incorrect number of arguments");
- System.out.println("JmsSenderShim: Expected arguments: broker_address, queue_name, ...");
- System.exit(1);
- }
- String brokerAddress = "amqp://" + args[0];
- String queueName = args[1];
-
- Sender shim = new Sender(brokerAddress, queueName);
- shim.runTests();
- }
-
- public Sender(String brokerAddress, String queueName) {
- try {
- ConnectionFactory factory = (ConnectionFactory)new JmsConnectionFactory(brokerAddress);
-
- _connection = factory.createConnection();
- _connection.setExceptionListener(new MyExceptionListener());
- _connection.start();
-
- _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _queue = _session.createQueue(queueName);
-
- _messageProducer = _session.createProducer(_queue);
-
- _msgsSent = 0;
- } catch (Exception exp) {
- System.out.println("Caught exception, exiting.");
- exp.printStackTrace(System.out);
- System.exit(1);
- }
- }
-
- public void runTests() throws Exception {
- _connection.close();
- }
-
-
- private static class MyExceptionListener implements ExceptionListener {
- @Override
- public void onException(JMSException exception) {
- System.out.println("Connection ExceptionListener fired, exiting.");
- exception.printStackTrace(System.out);
- System.exit(1);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_large_content_test/Receiver.java
----------------------------------------------------------------------
diff --git a/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_large_content_test/Receiver.java b/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_large_content_test/Receiver.java
deleted file mode 100644
index 2fb8ac7..0000000
--- a/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_large_content_test/Receiver.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/**
- * 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.
- */
-package org.apache.qpid.qpid_interop_test.jms_large_content_test;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.json.Json;
-import javax.json.JsonArray;
-import javax.json.JsonArrayBuilder;
-import javax.json.JsonObject;
-import javax.json.JsonObjectBuilder;
-import javax.json.JsonReader;
-import javax.json.JsonWriter;
-import org.apache.qpid.jms.JmsConnectionFactory;
-
-public class Receiver {
- private static final String USER = "guest";
- private static final String PASSWORD = "guest";
- private static final int TIMEOUT = 1000;
- private static final String[] SUPPORTED_JMS_MESSAGE_TYPES = {"JMS_MESSAGE_TYPE",
- "JMS_BYTESMESSAGE_TYPE",
- "JMS_MAPMESSAGE_TYPE",
- "JMS_OBJECTMESSAGE_TYPE",
- "JMS_STREAMMESSAGE_TYPE",
- "JMS_TEXTMESSAGE_TYPE"};
- private static enum JMS_DESTINATION_TYPE {JMS_QUEUE, JMS_TEMPORARY_QUEUE, JMS_TOPIC, JMS_TEMPORARY_TOPIC};
-
- Connection _connection;
- Session _session;
- Queue _queue;
- MessageConsumer _messageConsumer;
- JsonObjectBuilder _jsonTestValueMapBuilder;
-
- // args[0]: Broker URL
- // args[1]: Queue name
- // args[2]: JMS message type
- // args[3]: JSON Test parameters containing testValuesMap
- public static void main(String[] args) throws Exception {
- if (args.length != 4) {
- System.out.println("JmsReceiverShim: Incorrect number of arguments");
- System.out.println("JmsReceiverShim: Expected arguments: broker_address, queue_name, JMS_msg_type, JSON_receive_params");
- System.exit(1);
- }
- String brokerAddress = "amqp://" + args[0];
- String queueName = args[1];
- String jmsMessageType = args[2];
- if (!isSupportedJmsMessageType(jmsMessageType)) {
- System.out.println("ERROR: JmsReceiverShim: Unknown or unsupported JMS message type \"" + jmsMessageType + "\"");
- System.exit(1);
- }
-
- JsonReader jsonReader = Json.createReader(new StringReader(args[3]));
- JsonObject numTestValuesMap = jsonReader.readObject();
- jsonReader.close();
-
- Receiver shim = new Receiver(brokerAddress, queueName);
- shim.run(jmsMessageType, numTestValuesMap);
- }
-
- public Receiver(String brokerAddress, String queueName) {
- try {
- _connection = null;
- ConnectionFactory factory = (ConnectionFactory)new JmsConnectionFactory(brokerAddress);
- _connection = factory.createConnection(USER, PASSWORD);
- _connection.setExceptionListener(new MyExceptionListener());
- _connection.start();
-
- _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _queue = _session.createQueue(queueName);
-
- _messageConsumer = _session.createConsumer(_queue);
-
- _jsonTestValueMapBuilder = Json.createObjectBuilder();
- } catch (Exception exc) {
- if (_connection != null)
- try { _connection.close(); } catch (JMSException e) {}
- System.out.println("Caught exception, exiting.");
- exc.printStackTrace(System.out);
- System.exit(1);
- }
- }
-
- public void run(String jmsMessageType, JsonObject numTestValuesMap) {
- try {
- List<String> subTypeKeyList = new ArrayList<String>(numTestValuesMap.keySet());
- Collections.sort(subTypeKeyList);
-
- Message message = null;
-
- for (String subType: subTypeKeyList) {
- JsonArrayBuilder jasonTestValuesArrayBuilder = Json.createArrayBuilder();
- for (int i=0; i<numTestValuesMap.getJsonNumber(subType).intValue(); ++i) {
- message = _messageConsumer.receive(TIMEOUT);
- if (message == null) break;
- switch (jmsMessageType) {
- case "JMS_MESSAGE_TYPE":
- processJMSMessage(jasonTestValuesArrayBuilder);
- break;
- case "JMS_BYTESMESSAGE_TYPE":
- processJMSBytesMessage(jmsMessageType, subType, message, jasonTestValuesArrayBuilder);
- break;
- case "JMS_STREAMMESSAGE_TYPE":
- processJMSStreamMessage(jmsMessageType, subType, message, jasonTestValuesArrayBuilder);
- break;
- case "JMS_MAPMESSAGE_TYPE":
- processJMSMapMessage(jmsMessageType, subType, i, message, jasonTestValuesArrayBuilder);
- break;
- case "JMS_OBJECTMESSAGE_TYPE":
- processJMSObjectMessage(subType, message, jasonTestValuesArrayBuilder);
- break;
- case "JMS_TEXTMESSAGE_TYPE":
- processJMSTextMessage(message, jasonTestValuesArrayBuilder);
- break;
- default:
- _connection.close();
- throw new Exception("JmsReceiverShim: Internal error: Unknown or unsupported JMS message type \"" + jmsMessageType + "\"");
- }
- }
- _jsonTestValueMapBuilder.add(subType, jasonTestValuesArrayBuilder);
- }
- _connection.close();
-
- System.out.println(jmsMessageType);
- StringWriter out = new StringWriter();
- writeJsonObject(_jsonTestValueMapBuilder, out);
- System.out.println(out.toString());
- } catch (Exception exp) {
- try { _connection.close(); } catch (JMSException e) {}
- System.out.println("Caught exception, exiting.");
- exp.printStackTrace(System.out);
- System.exit(1);
- }
- }
-
- protected void processJMSMessage(JsonArrayBuilder jasonTestValuesArrayBuilder) {
- jasonTestValuesArrayBuilder.addNull();
- }
-
- protected void processJMSBytesMessage(String jmsMessageType, String subType, Message message, JsonArrayBuilder jasonTestValuesArrayBuilder) throws Exception, JMSException, IOException, ClassNotFoundException {
- switch (subType) {
- case "boolean":
- jasonTestValuesArrayBuilder.add(((BytesMessage)message).readBoolean()?"True":"False");
- break;
- case "byte":
- jasonTestValuesArrayBuilder.add(formatByte(((BytesMessage)message).readByte()));
- break;
- case "bytes":
- {
- byte[] bytesBuff = new byte[65536];
- int numBytesRead = ((BytesMessage)message).readBytes(bytesBuff);
- if (numBytesRead >= 0) {
- jasonTestValuesArrayBuilder.add(new String(Arrays.copyOfRange(bytesBuff, 0, numBytesRead)));
- } else {
- // NOTE: For this case, an empty byte array has nothing to return
- jasonTestValuesArrayBuilder.add(new String());
- }
- }
- break;
- case "char":
- jasonTestValuesArrayBuilder.add(formatChar(((BytesMessage)message).readChar()));
- break;
- case "double":
- long l = Double.doubleToRawLongBits(((BytesMessage)message).readDouble());
- jasonTestValuesArrayBuilder.add(String.format("0x%16s", Long.toHexString(l)).replace(' ', '0'));
- break;
- case "float":
- int i0 = Float.floatToRawIntBits(((BytesMessage)message).readFloat());
- jasonTestValuesArrayBuilder.add(String.format("0x%8s", Integer.toHexString(i0)).replace(' ', '0'));
- break;
- case "int":
- jasonTestValuesArrayBuilder.add(formatInt(((BytesMessage)message).readInt()));
- break;
- case "long":
- jasonTestValuesArrayBuilder.add(formatLong(((BytesMessage)message).readLong()));
- break;
- case "object":
- {
- byte[] bytesBuff = new byte[65536];
- int numBytesRead = ((BytesMessage)message).readBytes(bytesBuff);
- if (numBytesRead >= 0) {
- ByteArrayInputStream bais = new ByteArrayInputStream(Arrays.copyOfRange(bytesBuff, 0, numBytesRead));
- ObjectInputStream ois = new ObjectInputStream(bais);
- Object obj = ois.readObject();
- jasonTestValuesArrayBuilder.add(obj.getClass().getName() + ":" + obj.toString());
- } else {
- jasonTestValuesArrayBuilder.add("<object error>");
- }
- }
- break;
- case "short":
- jasonTestValuesArrayBuilder.add(formatShort(((BytesMessage)message).readShort()));
- break;
- case "string":
- jasonTestValuesArrayBuilder.add(((BytesMessage)message).readUTF());
- break;
- default:
- throw new Exception("JmsReceiverShim: Unknown subtype for " + jmsMessageType + ": \"" + subType + "\"");
- }
- }
-
- protected void processJMSMapMessage(String jmsMessageType, String subType, int count, Message message, JsonArrayBuilder jasonTestValuesArrayBuilder) throws Exception, JMSException {
- String name = String.format("%s%03d", subType, count);
- switch (subType) {
- case "boolean":
- jasonTestValuesArrayBuilder.add(((MapMessage)message).getBoolean(name)?"True":"False");
- break;
- case "byte":
- jasonTestValuesArrayBuilder.add(formatByte(((MapMessage)message).getByte(name)));
- break;
- case "bytes":
- jasonTestValuesArrayBuilder.add(new String(((MapMessage)message).getBytes(name)));
- break;
- case "char":
- jasonTestValuesArrayBuilder.add(formatChar(((MapMessage)message).getChar(name)));
- break;
- case "double":
- long l = Double.doubleToRawLongBits(((MapMessage)message).getDouble(name));
- jasonTestValuesArrayBuilder.add(String.format("0x%16s", Long.toHexString(l)).replace(' ', '0'));
- break;
- case "float":
- int i0 = Float.floatToRawIntBits(((MapMessage)message).getFloat(name));
- jasonTestValuesArrayBuilder.add(String.format("0x%8s", Integer.toHexString(i0)).replace(' ', '0'));
- break;
- case "int":
- jasonTestValuesArrayBuilder.add(formatInt(((MapMessage)message).getInt(name)));
- break;
- case "long":
- jasonTestValuesArrayBuilder.add(formatLong(((MapMessage)message).getLong(name)));
- break;
- case "object":
- Object obj = ((MapMessage)message).getObject(name);
- jasonTestValuesArrayBuilder.add(obj.getClass().getName() + ":" + obj.toString());
- break;
- case "short":
- jasonTestValuesArrayBuilder.add(formatShort(((MapMessage)message).getShort(name)));
- break;
- case "string":
- jasonTestValuesArrayBuilder.add(((MapMessage)message).getString(name));
- break;
- default:
- throw new Exception("JmsReceiverShim: Unknown subtype for " + jmsMessageType + ": \"" + subType + "\"");
- }
- }
-
- protected void processJMSObjectMessage(String subType, Message message, JsonArrayBuilder jasonTestValuesArrayBuilder) throws JMSException {
- jasonTestValuesArrayBuilder.add(((ObjectMessage)message).getObject().toString());
- }
-
- protected void processJMSStreamMessage(String jmsMessageType, String subType, Message message, JsonArrayBuilder jasonTestValuesArrayBuilder) throws Exception, JMSException {
- switch (subType) {
- case "boolean":
- jasonTestValuesArrayBuilder.add(((StreamMessage)message).readBoolean()?"True":"False");
- break;
- case "byte":
- jasonTestValuesArrayBuilder.add(formatByte(((StreamMessage)message).readByte()));
- break;
- case "bytes":
- byte[] bytesBuff = new byte[65536];
- int numBytesRead = ((StreamMessage)message).readBytes(bytesBuff);
- if (numBytesRead >= 0) {
- jasonTestValuesArrayBuilder.add(new String(Arrays.copyOfRange(bytesBuff, 0, numBytesRead)));
- } else {
- System.out.println("StreamMessage.readBytes() returned " + numBytesRead);
- jasonTestValuesArrayBuilder.add("<bytes error>");
- }
- break;
- case "char":
- jasonTestValuesArrayBuilder.add(formatChar(((StreamMessage)message).readChar()));
- break;
- case "double":
- long l = Double.doubleToRawLongBits(((StreamMessage)message).readDouble());
- jasonTestValuesArrayBuilder.add(String.format("0x%16s", Long.toHexString(l)).replace(' ', '0'));
- break;
- case "float":
- int i0 = Float.floatToRawIntBits(((StreamMessage)message).readFloat());
- jasonTestValuesArrayBuilder.add(String.format("0x%8s", Integer.toHexString(i0)).replace(' ', '0'));
- break;
- case "int":
- jasonTestValuesArrayBuilder.add(formatInt(((StreamMessage)message).readInt()));
- break;
- case "long":
- jasonTestValuesArrayBuilder.add(formatLong(((StreamMessage)message).readLong()));
- break;
- case "object":
- Object obj = ((StreamMessage)message).readObject();
- jasonTestValuesArrayBuilder.add(obj.getClass().getName() + ":" + obj.toString());
- break;
- case "short":
- jasonTestValuesArrayBuilder.add(formatShort(((StreamMessage)message).readShort()));
- break;
- case "string":
- jasonTestValuesArrayBuilder.add(((StreamMessage)message).readString());
- break;
- default:
- throw new Exception("JmsReceiverShim: Unknown subtype for " + jmsMessageType + ": \"" + subType + "\"");
- }
- }
-
- protected void processJMSTextMessage(Message message, JsonArrayBuilder jasonTestValuesArrayBuilder) throws JMSException {
- jasonTestValuesArrayBuilder.add(((TextMessage)message).getText());
- }
-
- protected static void writeJsonObject(JsonObjectBuilder builder, StringWriter out) {
- JsonWriter jsonWriter = Json.createWriter(out);
- jsonWriter.writeObject(builder.build());
- jsonWriter.close();
- }
-
- protected static String formatByte(byte b) {
- boolean neg = false;
- if (b < 0) {
- neg = true;
- b = (byte)-b;
- }
- return String.format("%s0x%x", neg?"-":"", b);
- }
-
- protected static String formatChar(char c) {
- if (Character.isLetterOrDigit(c)) {
- return String.format("%c", c);
- }
- char[] ca = {c};
- return new String(ca);
- }
-
- protected static String formatInt(int i) {
- boolean neg = false;
- if (i < 0) {
- neg = true;
- i = -i;
- }
- return String.format("%s0x%x", neg?"-":"", i);
- }
-
- protected static String formatLong(long l) {
- boolean neg = false;
- if (l < 0) {
- neg = true;
- l = -l;
- }
- return String.format("%s0x%x", neg?"-":"", l);
- }
-
- protected static String formatShort(int s) {
- boolean neg = false;
- if (s < 0) {
- neg = true;
- s = -s;
- }
- return String.format("%s0x%x", neg?"-":"", s);
- }
-
- protected static boolean isSupportedJmsMessageType(String jmsMessageType) {
- for (String supportedJmsMessageType: SUPPORTED_JMS_MESSAGE_TYPES) {
- if (jmsMessageType.equals(supportedJmsMessageType))
- return true;
- }
- return false;
- }
-
- private static class MyExceptionListener implements ExceptionListener {
- @Override
- public void onException(JMSException exception) {
- System.out.println("Connection ExceptionListener fired, exiting.");
- exception.printStackTrace(System.out);
- System.exit(1);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_large_content_test/Sender.java
----------------------------------------------------------------------
diff --git a/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_large_content_test/Sender.java b/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_large_content_test/Sender.java
deleted file mode 100644
index 0980e67..0000000
--- a/shims/qpid-jms/src_not_yet_impl/main/java/org/apache/qpid/qpid_interop_test/jms_large_content_test/Sender.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * 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.
- */
-package org.apache.qpid.qpid_interop_test.jms_large_content_test;
-
-import java.io.Serializable;
-import java.io.StringReader;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-import javax.json.Json;
-import javax.json.JsonArray;
-import javax.json.JsonObject;
-import javax.json.JsonReader;
-import org.apache.qpid.jms.JmsConnectionFactory;
-
-public class Sender {
- private static final String USER = "guest";
- private static final String PASSWORD = "guest";
- private static final String[] SUPPORTED_JMS_MESSAGE_TYPES = {"JMS_MESSAGE_TYPE",
- "JMS_BYTESMESSAGE_TYPE",
- "JMS_MAPMESSAGE_TYPE",
- "JMS_OBJECTMESSAGE_TYPE",
- "JMS_STREAMMESSAGE_TYPE",
- "JMS_TEXTMESSAGE_TYPE"};
- Connection _connection;
- Session _session;
- Queue _queue;
- MessageProducer _messageProducer;
- int _msgsSent;
-
-
- // args[0]: Broker URL
- // args[1]: Queue name
- // ...
- public static void main(String[] args) throws Exception {
- if (args.length != 2) {
- System.out.println("JmsSenderShim: Incorrect number of arguments");
- System.out.println("JmsSenderShim: Expected arguments: broker_address, queue_name, ...");
- System.exit(1);
- }
- String brokerAddress = "amqp://" + args[0];
- String queueName = args[1];
-
- Sender shim = new Sender(brokerAddress, queueName);
- shim.runTests();
- }
-
- public Sender(String brokerAddress, String queueName) {
- try {
- ConnectionFactory factory = (ConnectionFactory)new JmsConnectionFactory(brokerAddress);
-
- _connection = factory.createConnection();
- _connection.setExceptionListener(new MyExceptionListener());
- _connection.start();
-
- _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _queue = _session.createQueue(queueName);
-
- _messageProducer = _session.createProducer(_queue);
-
- _msgsSent = 0;
- } catch (Exception exp) {
- System.out.println("Caught exception, exiting.");
- exp.printStackTrace(System.out);
- System.exit(1);
- }
- }
-
- public void runTests() throws Exception {
- _connection.close();
- }
-
-
- private static class MyExceptionListener implements ExceptionListener {
- @Override
- public void onException(JMSException exception) {
- System.out.println("Connection ExceptionListener fired, exiting.");
- exception.printStackTrace(System.out);
- System.exit(1);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Receiver.cpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Receiver.cpp b/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Receiver.cpp
deleted file mode 100644
index eb5dbed..0000000
--- a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Receiver.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-#include "qpidit/amqp_dtx_test/Receiver.hpp"
-
-#include <stdlib.h> // exit()
-
-namespace qpidit
-{
- namespace amqp_dtx_test
- {
- } /* namespace amqp_dtx_test */
-} /* namespace qpidit */
-
-
-/*
- * --- main ---
- * Args: 1: Broker address (ip-addr:port)
- * 2: Queue name
- * ...
- */
-
-int main(int argc, char** argv) {
- exit(0);
-}
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Receiver.hpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Receiver.hpp b/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Receiver.hpp
deleted file mode 100644
index 4b810f0..0000000
--- a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Receiver.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-#ifndef SRC_QPIDIT_AMQP_DTX_TEST_RECEIVER_HPP_
-#define SRC_QPIDIT_AMQP_DTX_TEST_RECEIVER_HPP_
-
-#include <proton/messaging_handler.hpp>
-
-namespace qpidit
-{
- namespace amqp_dtx_test
- {
-
- class Receiver : public proton::messaging_handler
- {
- };
-
- } /* namespace amqp_dtx_test */
-} /* namespace qpidit */
-
-#endif /* SRC_QPIDIT_AMQP_DTX_TEST_RECEIVER_HPP_ */
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Sender.cpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Sender.cpp b/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Sender.cpp
deleted file mode 100644
index 4463954..0000000
--- a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Sender.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-#include "qpidit/amqp_dtx_test/Sender.hpp"
-
-#include <stdlib.h> // exit()
-
-namespace qpidit
-{
- namespace amqp_dtx_test
- {
- } /* namespace amqp_dtx_test */
-} /* namespace qpidit */
-
-
-/*
- * --- main ---
- * Args: 1: Broker address (ip-addr:port)
- * 2: Queue name
- * ...
- */
-
-int main(int argc, char** argv) {
- exit(0);
-}
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Sender.hpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Sender.hpp b/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Sender.hpp
deleted file mode 100644
index 90be683..0000000
--- a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_dtx_test/Sender.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-#ifndef SRC_QPIDIT_AMQP_DTX_TEST_SENDER_HPP_
-#define SRC_QPIDIT_AMQP_DTX_TEST_SENDER_HPP_
-
-#include <proton/messaging_handler.hpp>
-
-namespace qpidit
-{
- namespace amqp_dtx_test
- {
-
- class Sender : public proton::messaging_handler
- {
- };
-
- } /* namespace amqp_dtx_test */
-} /* namespace qpidit */
-
-#endif /* SRC_QPIDIT_AMQP_DTX_TEST_SENDER_HPP_ */
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Receiver.cpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Receiver.cpp b/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Receiver.cpp
deleted file mode 100644
index 923b198..0000000
--- a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Receiver.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-#include "qpidit/amqp_features_test/Receiver.hpp"
-
-#include <stdlib.h> // exit()
-
-namespace qpidit
-{
- namespace amqp_features_test
- {
- } /* namespace amqp_features_test */
-} /* namespace qpidit */
-
-
-/*
- * --- main ---
- * Args: 1: Broker address (ip-addr:port)
- * 2: Queue name
- * ...
- */
-
-int main(int argc, char** argv) {
- exit(0);
-}
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Receiver.hpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Receiver.hpp b/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Receiver.hpp
deleted file mode 100644
index 100cdd2..0000000
--- a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Receiver.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-#ifndef SRC_QPIDIT_AMQP_FEATURES_TEST_RECEIVER_HPP_
-#define SRC_QPIDIT_AMQP_FEATURES_TEST_RECEIVER_HPP_
-
-#include <proton/messaging_handler.hpp>
-
-namespace qpidit
-{
- namespace amqp_features_test
- {
-
- class Receiver : public proton::messaging_handler
- {
- };
-
- } /* namespace amqp_features_test */
-} /* namespace qpidit */
-
-#endif /* SRC_QPIDIT_AMQP_FEATURES_TEST_RECEIVER_HPP_ */
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Sender.cpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Sender.cpp b/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Sender.cpp
deleted file mode 100644
index 9e86ec4..0000000
--- a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Sender.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-#include "qpidit/amqp_features_test/Sender.hpp"
-
-#include <iostream>
-#include <json/json.h>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/error_condition.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-#include <proton/transport.hpp>
-#include <qpidit/QpidItErrors.hpp>
-#include <stdlib.h> // exit()
-
-
-namespace qpidit
-{
- namespace amqp_features_test
- {
- Sender::Sender(const std::string& brokerUrl,
- const std::string& queueName,
- const std::string& testType,
- const Json::Value& testValues) :
- _brokerUrl(brokerUrl),
- _queueName(queueName),
- _testType(testType),
- _testValues(testValues)
- {}
-
- Sender::~Sender() {}
-
- void Sender::on_container_start(proton::container &c) {
- std::ostringstream oss;
- oss << _brokerUrl << "/" << _queueName;
- c.open_sender(oss.str());
- }
-
- void Sender::on_connection_open(proton::connection& c) {
- if (_testType.compare("connection_property") == 0) {
- // Python: self.remote_properties = event.connection.remote_properties
- }
- }
-
- void Sender::on_sendable(proton::sender &s) {
- if (_totalMsgs == 0) {
- s.connection().close();
- } else {
- if (_testType.compare("connection_property") == 0) {
- // Do nothing
- } else {
- // Unknown test
- }
- }
- }
-
- void Sender::on_tracker_accept(proton::tracker &t) {
- _msgsConfirmed++;
- if (_msgsConfirmed == _totalMsgs) {
- t.connection().close();
- }
- }
-
- void Sender::on_transport_close(proton::transport &t) {
- _msgsSent = _msgsConfirmed;
- }
-
- void Sender::on_connection_error(proton::connection &c) {
- std::cerr << "AmqpSender::on_connection_error(): " << c.error() << std::endl;
- }
-
- void Sender::on_sender_error(proton::sender &s) {
- std::cerr << "AmqpSender::on_sender_error(): " << s.error() << std::endl;
- }
-
- void Sender::on_session_error(proton::session &s) {
- std::cerr << "AmqpSender::on_session_error(): " << s.error() << std::endl;
- }
-
- void Sender::on_transport_error(proton::transport &t) {
- std::cerr << "AmqpSender::on_transport_error(): " << t.error() << std::endl;
- }
-
- void Sender::on_error(const proton::error_condition &ec) {
- std::cerr << "AmqpSender::on_error(): " << ec << std::endl;
- }
- } /* namespace amqp_features_test */
-} /* namespace qpidit */
-
-
-/*
- * --- main ---
- * Args: 1: Broker address (ip-addr:port)
- * 2: Queue name
- * 3: Test type
- * 4: JSON test values
- */
-
-int main(int argc, char** argv) {
- // TODO: improve arg management a little...
- if (argc != 5) {
- throw qpidit::ArgumentError("Incorrect number of arguments");
- }
-
- try {
- Json::Value testValues;
- Json::Reader jsonReader;
- if (not jsonReader.parse(argv[4], testValues, false)) {
- throw qpidit::JsonParserError(jsonReader);
- }
-
- qpidit::amqp_features_test::Sender sender(argv[1], argv[2], argv[3], testValues);
- proton::default_container(sender).run();
- } catch (const std::exception& e) {
- std::cerr << "amqp_features_test Sender error: " << e.what() << std::endl;
- exit(1);
- }
- exit(0);
-}
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Sender.hpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Sender.hpp b/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Sender.hpp
deleted file mode 100644
index 62b00f5..0000000
--- a/shims/qpid-proton-cpp/src/not_yet_impl/amqp_features_test/Sender.hpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-#ifndef SRC_QPIDIT_AMQP_DTX_TEST_SENDER_HPP_
-#define SRC_QPIDIT_AMQP_DTX_TEST_SENDER_HPP_
-
-#include <stdint.h>
-#include <json/value.h>
-#include <proton/messaging_handler.hpp>
-#include <string>
-
-namespace qpidit
-{
- namespace amqp_features_test
- {
-
- class Sender : public proton::messaging_handler
- {
- const std::string _brokerUrl;
- const std::string _queueName;
- const std::string _testType;
- const Json::Value _testValues;
- uint32_t _msgsSent;
- uint32_t _msgsConfirmed;
- uint32_t _totalMsgs;
- public:
- Sender(const std::string& brokerUrl,
- const std::string& queueName,
- const std::string& testType,
- const Json::Value& testValues);
- virtual ~Sender();
-
- void on_container_start(proton::container& c);
- void on_connection_open(proton::connection &c);
- void on_sendable(proton::sender& s);
- void on_tracker_accept(proton::tracker& t);
- void on_transport_close(proton::transport& t);
-
- void on_connection_error(proton::connection& c);
- void on_session_error(proton::session& s);
- void on_sender_error(proton::sender& s);
- void on_transport_error(proton::transport& t);
- void on_error(const proton::error_condition& c);
- };
-
- } /* namespace amqp_features_test */
-} /* namespace qpidit */
-
-#endif /* SRC_QPIDIT_AMQP_DTX_TEST_SENDER_HPP_ */
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-proton-cpp/src/not_yet_impl/jms_dtx_test/Receiver.cpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/not_yet_impl/jms_dtx_test/Receiver.cpp b/shims/qpid-proton-cpp/src/not_yet_impl/jms_dtx_test/Receiver.cpp
deleted file mode 100644
index 027518c..0000000
--- a/shims/qpid-proton-cpp/src/not_yet_impl/jms_dtx_test/Receiver.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-#include "qpidit/jms_dtx_test/Receiver.hpp"
-
-#include <stdlib.h> // exit()
-
-namespace qpidit
-{
- namespace jms_dtx_test
- {
- } /* namespace jms_dtx_test */
-} /* namespace qpidit */
-
-
-/*
- * --- main ---
- * Args: 1: Broker address (ip-addr:port)
- * 2: Queue name
- * ...
- */
-
-int main(int argc, char** argv) {
- exit(0);
-}
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-proton-cpp/src/not_yet_impl/jms_dtx_test/Receiver.hpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/not_yet_impl/jms_dtx_test/Receiver.hpp b/shims/qpid-proton-cpp/src/not_yet_impl/jms_dtx_test/Receiver.hpp
deleted file mode 100644
index 2509752..0000000
--- a/shims/qpid-proton-cpp/src/not_yet_impl/jms_dtx_test/Receiver.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-#ifndef SRC_QPIDIT_JMS_DTX_TEST_RECEIVER_HPP_
-#define SRC_QPIDIT_JMS_DTX_TEST_RECEIVER_HPP_
-
-#include <qpidit/JmsTestBase.hpp>
-
-namespace qpidit
-{
- namespace jms_dtx_test
- {
-
- class Receiver : public qpidit::JmsTestBase
- {
- };
-
- } /* namespace jms_dtx_test */
-} /* namespace qpidit */
-
-#endif /* SRC_QPIDIT_JMS_DTX_TEST_RECEIVER_HPP_ */
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/4153bf17/shims/qpid-proton-cpp/src/not_yet_impl/jms_dtx_test/Sender.cpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/not_yet_impl/jms_dtx_test/Sender.cpp b/shims/qpid-proton-cpp/src/not_yet_impl/jms_dtx_test/Sender.cpp
deleted file mode 100644
index 501d0f9..0000000
--- a/shims/qpid-proton-cpp/src/not_yet_impl/jms_dtx_test/Sender.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-#include "qpidit/jms_dtx_test/Sender.hpp"
-
-#include <stdlib.h> // exit()
-
-namespace qpidit
-{
- namespace jms_dtx_test
- {
- } /* namespace jms_dtx_test */
-} /* namespace qpidit */
-
-
-/*
- * --- main ---
- * Args: 1: Broker address (ip-addr:port)
- * 2: Queue name
- * ...
- */
-
-int main(int argc, char** argv) {
- exit(0);
-}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org