You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2017/01/09 15:24:41 UTC
[05/34] qpid-proton git commit: PROTON-1385: remove proton-j from the
existing repo, it now has its own repo at:
https://git-wip-us.apache.org/repos/asf/qpid-proton-j.git
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/java/org/apache/qpid/proton/systemtests/ProtonEngineExampleTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/ProtonEngineExampleTest.java b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/ProtonEngineExampleTest.java
deleted file mode 100644
index cb167f8..0000000
--- a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/ProtonEngineExampleTest.java
+++ /dev/null
@@ -1,371 +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.proton.systemtests;
-
-import static java.util.EnumSet.of;
-import static org.apache.qpid.proton.engine.EndpointState.ACTIVE;
-import static org.apache.qpid.proton.engine.EndpointState.CLOSED;
-import static org.apache.qpid.proton.engine.EndpointState.UNINITIALIZED;
-import static org.apache.qpid.proton.systemtests.TestLoggingHelper.bold;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Arrays;
-import java.util.logging.Logger;
-
-import org.apache.qpid.proton.Proton;
-import org.apache.qpid.proton.amqp.messaging.Accepted;
-import org.apache.qpid.proton.amqp.messaging.AmqpValue;
-import org.apache.qpid.proton.amqp.messaging.Section;
-import org.apache.qpid.proton.amqp.messaging.Source;
-import org.apache.qpid.proton.amqp.messaging.Target;
-import org.apache.qpid.proton.amqp.transport.ReceiverSettleMode;
-import org.apache.qpid.proton.amqp.transport.SenderSettleMode;
-import org.apache.qpid.proton.engine.Delivery;
-import org.apache.qpid.proton.engine.Receiver;
-import org.apache.qpid.proton.message.Message;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * Simple example to illustrate the use of the Engine and Message APIs.
- *
- * Implemented as a JUnit test for convenience, although the main purpose is to educate the reader
- * rather than test the code.
- *
- * To see the protocol trace, add the following line to test/resources/logging.properties:
- *
- * org.apache.qpid.proton.logging.LoggingProtocolTracer.sent.level = ALL
- *
- * and to see the byte level trace, add the following:
- *
- * org.apache.qpid.proton.systemtests.ProtonEngineExampleTest.level = ALL
- *
- * Does not illustrate use of the Messenger API.
- */
-public class ProtonEngineExampleTest extends EngineTestBase
-{
- private static final Logger LOGGER = Logger.getLogger(ProtonEngineExampleTest.class.getName());
-
- private static final int BUFFER_SIZE = 4096;
-
- private final String _targetAddress = getServer().containerId + "-link1-target";
-
- @Test
- public void test() throws Exception
- {
- LOGGER.fine(bold("======== About to create transports"));
-
- getClient().transport = Proton.transport();
- ProtocolTracerEnabler.setProtocolTracer(getClient().transport, TestLoggingHelper.CLIENT_PREFIX);
-
- getServer().transport = Proton.transport();
- ProtocolTracerEnabler.setProtocolTracer(getServer().transport, " " + TestLoggingHelper.SERVER_PREFIX);
-
- doOutputInputCycle();
-
- getClient().connection = Proton.connection();
- getClient().transport.bind(getClient().connection);
-
- getServer().connection = Proton.connection();
- getServer().transport.bind(getServer().connection);
-
- LOGGER.fine(bold("======== About to open connections"));
- getClient().connection.open();
- getServer().connection.open();
-
- doOutputInputCycle();
-
- LOGGER.fine(bold("======== About to open sessions"));
- getClient().session = getClient().connection.session();
- getClient().session.open();
-
- pumpClientToServer();
-
- getServer().session = getServer().connection.sessionHead(of(UNINITIALIZED), of(ACTIVE));
- assertEndpointState(getServer().session, UNINITIALIZED, ACTIVE);
-
- getServer().session.open();
- assertEndpointState(getServer().session, ACTIVE, ACTIVE);
-
- pumpServerToClient();
- assertEndpointState(getClient().session, ACTIVE, ACTIVE);
-
- LOGGER.fine(bold("======== About to create sender"));
-
- getClient().source = new Source();
- getClient().source.setAddress(null);
-
- getClient().target = new Target();
- getClient().target.setAddress(_targetAddress);
-
- getClient().sender = getClient().session.sender("link1");
- getClient().sender.setTarget(getClient().target);
- getClient().sender.setSource(getClient().source);
- // Exactly once delivery semantics
- getClient().sender.setSenderSettleMode(SenderSettleMode.UNSETTLED);
- getClient().sender.setReceiverSettleMode(ReceiverSettleMode.SECOND);
-
- assertEndpointState(getClient().sender, UNINITIALIZED, UNINITIALIZED);
-
- getClient().sender.open();
- assertEndpointState(getClient().sender, ACTIVE, UNINITIALIZED);
-
- pumpClientToServer();
-
- LOGGER.fine(bold("======== About to set up implicitly created receiver"));
-
- // A real application would be interested in more states than simply ACTIVE, as there
- // exists the possibility that the link could have moved to another state already e.g. CLOSED.
- // (See pipelining).
- getServer().receiver = (Receiver) getServer().connection.linkHead(of(UNINITIALIZED), of(ACTIVE));
- // Accept the settlement modes suggested by the client
- getServer().receiver.setSenderSettleMode(getServer().receiver.getRemoteSenderSettleMode());
- getServer().receiver.setReceiverSettleMode(getServer().receiver.getRemoteReceiverSettleMode());
-
- org.apache.qpid.proton.amqp.transport.Target serverRemoteTarget = getServer().receiver.getRemoteTarget();
- assertTerminusEquals(getClient().target, serverRemoteTarget);
-
- getServer().receiver.setTarget(applicationDeriveTarget(serverRemoteTarget));
-
- assertEndpointState(getServer().receiver, UNINITIALIZED, ACTIVE);
- getServer().receiver.open();
-
- assertEndpointState(getServer().receiver, ACTIVE, ACTIVE);
-
- pumpServerToClient();
- assertEndpointState(getClient().sender, ACTIVE, ACTIVE);
-
- getServer().receiver.flow(1);
- pumpServerToClient();
-
- LOGGER.fine(bold("======== About to create a message and send it to the server"));
-
- getClient().message = Proton.message();
- Section messageBody = new AmqpValue("Hello");
- getClient().message.setBody(messageBody);
- getClient().messageData = new byte[BUFFER_SIZE];
- int lengthOfEncodedMessage = getClient().message.encode(getClient().messageData, 0, BUFFER_SIZE);
- getTestLoggingHelper().prettyPrint(TestLoggingHelper.MESSAGE_PREFIX, Arrays.copyOf(getClient().messageData, lengthOfEncodedMessage));
-
- byte[] deliveryTag = "delivery1".getBytes();
- getClient().delivery = getClient().sender.delivery(deliveryTag);
- int numberOfBytesAcceptedBySender = getClient().sender.send(getClient().messageData, 0, lengthOfEncodedMessage);
- assertEquals("For simplicity, assume the sender can accept all the data",
- lengthOfEncodedMessage, numberOfBytesAcceptedBySender);
-
- assertNull(getClient().delivery.getLocalState());
-
- boolean senderAdvanced = getClient().sender.advance();
- assertTrue("sender has not advanced", senderAdvanced);
-
- pumpClientToServer();
-
- LOGGER.fine(bold("======== About to process the message on the server"));
-
- getServer().delivery = getServer().connection.getWorkHead();
- assertEquals("The received delivery should be on our receiver",
- getServer().receiver, getServer().delivery.getLink());
- assertNull(getServer().delivery.getLocalState());
- assertNull(getServer().delivery.getRemoteState());
-
- assertFalse(getServer().delivery.isPartial());
- assertTrue(getServer().delivery.isReadable());
-
- getServer().messageData = new byte[BUFFER_SIZE];
- int numberOfBytesProducedByReceiver = getServer().receiver.recv(getServer().messageData, 0, BUFFER_SIZE);
- assertEquals(numberOfBytesAcceptedBySender, numberOfBytesProducedByReceiver);
-
- getServer().message = Proton.message();
- getServer().message.decode(getServer().messageData, 0, numberOfBytesProducedByReceiver);
-
- boolean messageProcessed = applicationProcessMessage(getServer().message);
- assertTrue(messageProcessed);
-
- getServer().delivery.disposition(Accepted.getInstance());
- assertEquals(Accepted.getInstance(), getServer().delivery.getLocalState());
-
- pumpServerToClient();
- assertEquals(Accepted.getInstance(), getClient().delivery.getRemoteState());
-
- LOGGER.fine(bold("======== About to accept and settle the message on the client"));
-
- Delivery clientDelivery = getClient().connection.getWorkHead();
- assertEquals(getClient().delivery, clientDelivery);
- assertTrue(clientDelivery.isUpdated());
- assertEquals(getClient().sender, clientDelivery.getLink());
- clientDelivery.disposition(clientDelivery.getRemoteState());
- assertEquals(Accepted.getInstance(), getClient().delivery.getLocalState());
-
- clientDelivery.settle();
- assertNull("Now we've settled, the delivery should no longer be in the work list", getClient().connection.getWorkHead());
-
- pumpClientToServer();
-
- LOGGER.fine(bold("======== About to settle the message on the server"));
-
- assertEquals(Accepted.getInstance(), getServer().delivery.getRemoteState());
- Delivery serverDelivery = getServer().connection.getWorkHead();
- assertEquals(getServer().delivery, serverDelivery);
- assertTrue(serverDelivery.isUpdated());
- assertTrue("Client should have already settled", serverDelivery.remotelySettled());
- serverDelivery.settle();
- assertTrue(serverDelivery.isSettled());
- assertNull("Now we've settled, the delivery should no longer be in the work list", getServer().connection.getWorkHead());
-
- // Increment the receiver's credit so its ready for another message.
- // When using proton-c, this call is required in order to generate a Flow frame
- // (proton-j sends one even without it to eagerly restore the session incoming window).
- getServer().receiver.flow(1);
- pumpServerToClient();
-
- LOGGER.fine(bold("======== About to close client's sender"));
-
- getClient().sender.close();
-
- pumpClientToServer();
-
- LOGGER.fine(bold("======== Server about to process client's link closure"));
-
- assertSame(getServer().receiver, getServer().connection.linkHead(of(ACTIVE), of(CLOSED)));
- getServer().receiver.close();
-
- pumpServerToClient();
-
- LOGGER.fine(bold("======== About to close client's session"));
-
- getClient().session.close();
-
- pumpClientToServer();
-
- LOGGER.fine(bold("======== Server about to process client's session closure"));
-
- assertSame(getServer().session, getServer().connection.sessionHead(of(ACTIVE), of(CLOSED)));
- getServer().session.close();
-
- pumpServerToClient();
-
- LOGGER.fine(bold("======== About to close client's connection"));
-
- getClient().connection.close();
-
- pumpClientToServer();
-
- LOGGER.fine(bold("======== Server about to process client's connection closure"));
-
- assertEquals(CLOSED, getServer().connection.getRemoteState());
- getServer().connection.close();
-
- pumpServerToClient();
-
- LOGGER.fine(bold("======== Checking client has nothing more to pump"));
-
- assertClientHasNothingToOutput();
-
- LOGGER.fine(bold("======== Done!"));
- }
-
- @Ignore("This test does not have a fix yet")
- @Test
- public void testPROTON_1017() throws Exception
- {
- LOGGER.fine(bold("======== About to create transports"));
-
- getClient().transport = Proton.transport();
- ProtocolTracerEnabler.setProtocolTracer(getClient().transport, TestLoggingHelper.CLIENT_PREFIX);
-
- getServer().transport = Proton.transport();
- ProtocolTracerEnabler.setProtocolTracer(getServer().transport, " " + TestLoggingHelper.SERVER_PREFIX);
-
- doOutputInputCycle();
-
- getClient().connection = Proton.connection();
- getClient().transport.bind(getClient().connection);
-
- getServer().connection = Proton.connection();
- getServer().transport.bind(getServer().connection);
-
- LOGGER.fine(bold("======== About to open connections"));
- getClient().connection.open();
- getServer().connection.open();
-
- doOutputInputCycle();
-
- LOGGER.fine(bold("======== About to open and close client session"));
- getClient().session = getClient().connection.session();
- getClient().session.open();
- getClient().session.close();
- pumpClientToServer();
-
- getServer().session = getServer().connection.sessionHead(of(UNINITIALIZED), of(CLOSED));
- assertEndpointState(getServer().session, UNINITIALIZED, CLOSED);
-
- getServer().session.open();
- assertEndpointState(getServer().session, ACTIVE, CLOSED);
-
- getServer().session.close();
- assertEndpointState(getServer().session, CLOSED, CLOSED);
-
- pumpServerToClient();
- assertEndpointState(getClient().session, CLOSED, CLOSED);
-
- LOGGER.fine(bold("======== About to close client's connection"));
-
- getClient().connection.close();
-
- pumpClientToServer();
-
- LOGGER.fine(bold("======== Server about to process client's connection closure"));
-
- assertEquals(CLOSED, getServer().connection.getRemoteState());
- getServer().connection.close();
-
- pumpServerToClient();
-
- LOGGER.fine(bold("======== Checking client has nothing more to pump"));
-
- assertClientHasNothingToOutput();
-
- LOGGER.fine(bold("======== Done!"));
- }
-
- /**
- * Simulates creating a local terminus using the properties supplied by the remote link endpoint.
- *
- * In a broker you'd usually overlay serverRemoteTarget (eg its filter properties) onto
- * an existing object (which eg contains whether it's a queue or a topic), creating a new one from that
- * overlay. Also if this is link recovery then you'd fetch the unsettled map too.
- */
- private org.apache.qpid.proton.amqp.transport.Target applicationDeriveTarget(org.apache.qpid.proton.amqp.transport.Target serverRemoteTarget)
- {
- return serverRemoteTarget;
- }
-
- /**
- * Simulates processing a message.
- */
- private boolean applicationProcessMessage(Message message)
- {
- Object messageBody = ((AmqpValue)message.getBody()).getValue();
- return "Hello".equals(messageBody);
- }
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SaslTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SaslTest.java b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SaslTest.java
deleted file mode 100644
index 2980565..0000000
--- a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SaslTest.java
+++ /dev/null
@@ -1,100 +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.proton.systemtests;
-
-import static org.apache.qpid.proton.systemtests.TestLoggingHelper.bold;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-
-import java.util.logging.Logger;
-
-import org.apache.qpid.proton.Proton;
-import org.apache.qpid.proton.engine.Sasl;
-import org.junit.Test;
-
-public class SaslTest extends EngineTestBase
-{
- private static final Logger LOGGER = Logger.getLogger(SaslTest.class.getName());
-
- @Test
- public void testSaslHostnamePropagationAndRetrieval() throws Exception
- {
- LOGGER.fine(bold("======== About to create transports"));
-
- getClient().transport = Proton.transport();
- ProtocolTracerEnabler.setProtocolTracer(getClient().transport, TestLoggingHelper.CLIENT_PREFIX);
-
- Sasl clientSasl = getClient().transport.sasl();
- clientSasl.client();
-
- // Set the server hostname we are connecting to from the client
- String hostname = "my-remote-host-123";
- clientSasl.setRemoteHostname(hostname);
-
- // Verify we can't get the hostname on the client
- try
- {
- clientSasl.getHostname();
- fail("should have throw IllegalStateException");
- }
- catch (IllegalStateException ise)
- {
- // expected
- }
-
- getServer().transport = Proton.transport();
- ProtocolTracerEnabler.setProtocolTracer(getServer().transport, " " + TestLoggingHelper.SERVER_PREFIX);
-
- // Configure the server to do ANONYMOUS
- Sasl serverSasl = getServer().transport.sasl();
- serverSasl.server();
- serverSasl.setMechanisms("ANONYMOUS");
-
- // Verify we can't set the hostname on the server
- try
- {
- serverSasl.setRemoteHostname("some-other-host");
- fail("should have throw IllegalStateException");
- }
- catch (IllegalStateException ise)
- {
- // expected
- }
-
- assertNull(serverSasl.getHostname());
- assertArrayEquals(new String[0], clientSasl.getRemoteMechanisms());
-
- pumpClientToServer();
- pumpServerToClient();
-
- // Verify we got the mechs, set the chosen mech, and verify the
- // server still doesnt know the hostname set/requested by the client
- assertArrayEquals(new String[] {"ANONYMOUS"} , clientSasl.getRemoteMechanisms());
- clientSasl.setMechanisms("ANONYMOUS");
- assertNull(serverSasl.getHostname());
-
- pumpClientToServer();
-
- // Verify the server now knows that the client set the hostname field
- assertEquals(hostname, serverSasl.getHostname());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SessionTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SessionTest.java b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SessionTest.java
deleted file mode 100644
index 728c6b9..0000000
--- a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SessionTest.java
+++ /dev/null
@@ -1,198 +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.proton.systemtests;
-
-import static java.util.EnumSet.of;
-import static org.apache.qpid.proton.engine.EndpointState.ACTIVE;
-import static org.apache.qpid.proton.engine.EndpointState.UNINITIALIZED;
-import static org.apache.qpid.proton.systemtests.TestLoggingHelper.bold;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import org.apache.qpid.proton.Proton;
-import org.apache.qpid.proton.amqp.Symbol;
-import org.junit.Test;
-
-public class SessionTest extends EngineTestBase
-{
- private static final Logger LOGGER = Logger.getLogger(SessionTest.class.getName());
-
- @Test
- public void testCapabilities() throws Exception
- {
- final Symbol clientOfferedCap = Symbol.valueOf("clientOfferedCapability");
- final Symbol clientDesiredCap = Symbol.valueOf("clientDesiredCapability");
- final Symbol serverOfferedCap = Symbol.valueOf("serverOfferedCapability");
- final Symbol serverDesiredCap = Symbol.valueOf("serverDesiredCapability");
-
- Symbol[] clientOfferedCapabilities = new Symbol[] { clientOfferedCap };
- Symbol[] clientDesiredCapabilities = new Symbol[] { clientDesiredCap };
-
- Symbol[] serverOfferedCapabilities = new Symbol[] { serverOfferedCap };
- Symbol[] serverDesiredCapabilities = new Symbol[] { serverDesiredCap };
-
- LOGGER.fine(bold("======== About to create transports"));
-
- getClient().transport = Proton.transport();
- ProtocolTracerEnabler.setProtocolTracer(getClient().transport, TestLoggingHelper.CLIENT_PREFIX);
-
- getServer().transport = Proton.transport();
- ProtocolTracerEnabler.setProtocolTracer(getServer().transport, " " + TestLoggingHelper.SERVER_PREFIX);
-
- doOutputInputCycle();
-
- getClient().connection = Proton.connection();
- getClient().transport.bind(getClient().connection);
-
- getServer().connection = Proton.connection();
- getServer().transport.bind(getServer().connection);
-
- LOGGER.fine(bold("======== About to open connections"));
- getClient().connection.open();
- getServer().connection.open();
-
- doOutputInputCycle();
-
- LOGGER.fine(bold("======== About to open sessions"));
- getClient().session = getClient().connection.session();
-
- // Set the client session capabilities
- getClient().session.setOfferedCapabilities(clientOfferedCapabilities);
- getClient().session.setDesiredCapabilities(clientDesiredCapabilities);
-
- getClient().session.open();
-
- pumpClientToServer();
-
- getServer().session = getServer().connection.sessionHead(of(UNINITIALIZED), of(ACTIVE));
- assertEndpointState(getServer().session, UNINITIALIZED, ACTIVE);
-
- // Set the server session capabilities
- getServer().session.setOfferedCapabilities(serverOfferedCapabilities);
- getServer().session.setDesiredCapabilities(serverDesiredCapabilities);
-
- getServer().session.open();
- assertEndpointState(getServer().session, ACTIVE, ACTIVE);
-
- pumpServerToClient();
-
- // Verify server side got the clients session capabilities as expected
- Symbol[] serverRemoteOfferedCapabilities = getServer().session.getRemoteOfferedCapabilities();
- assertNotNull("Server had no remote offered capabilities", serverRemoteOfferedCapabilities);
- assertEquals("Server remote offered capabilities not expected size", 1, serverRemoteOfferedCapabilities.length);
- assertTrue("Server remote offered capabilities lack expected value: " + clientOfferedCap, Arrays.asList(serverRemoteOfferedCapabilities).contains(clientOfferedCap));
-
- Symbol[] serverRemoteDesiredCapabilities = getServer().session.getRemoteDesiredCapabilities();
- assertNotNull("Server had no remote desired capabilities", serverRemoteDesiredCapabilities);
- assertEquals("Server remote desired capabilities not expected size", 1, serverRemoteDesiredCapabilities.length);
- assertTrue("Server remote desired capabilities lack expected value: " + clientDesiredCap, Arrays.asList(serverRemoteDesiredCapabilities).contains(clientDesiredCap));
-
- // Verify the client side got the servers session capabilities as expected
- Symbol[] clientRemoteOfferedCapabilities = getClient().session.getRemoteOfferedCapabilities();
- assertNotNull("Client had no remote offered capabilities", clientRemoteOfferedCapabilities);
- assertEquals("Client remote offered capabilities not expected size", 1, clientRemoteOfferedCapabilities.length);
- assertTrue("Client remote offered capabilities lack expected value: " + serverOfferedCap, Arrays.asList(clientRemoteOfferedCapabilities).contains(serverOfferedCap));
-
- Symbol[] clientRemoteDesiredCapabilities = getClient().session.getRemoteDesiredCapabilities();
- assertNotNull("Client had no remote desired capabilities", clientRemoteDesiredCapabilities);
- assertEquals("Client remote desired capabilities not expected size", 1, clientRemoteDesiredCapabilities.length);
- assertTrue("Client remote desired capabilities lack expected value: " + serverDesiredCap, Arrays.asList(clientRemoteDesiredCapabilities).contains(serverDesiredCap));
- }
-
- @Test
- public void testProperties() throws Exception
- {
- final Symbol clientPropName = Symbol.valueOf("ClientPropName");
- final Integer clientPropValue = 1234;
- final Symbol serverPropName = Symbol.valueOf("ServerPropName");
- final Integer serverPropValue = 5678;
-
- Map<Symbol, Object> clientProps = new HashMap<>();
- clientProps.put(clientPropName, clientPropValue);
-
- Map<Symbol, Object> serverProps = new HashMap<>();
- serverProps.put(serverPropName, serverPropValue);
-
- LOGGER.fine(bold("======== About to create transports"));
-
- getClient().transport = Proton.transport();
- ProtocolTracerEnabler.setProtocolTracer(getClient().transport, TestLoggingHelper.CLIENT_PREFIX);
-
- getServer().transport = Proton.transport();
- ProtocolTracerEnabler.setProtocolTracer(getServer().transport, " " + TestLoggingHelper.SERVER_PREFIX);
-
- doOutputInputCycle();
-
- getClient().connection = Proton.connection();
- getClient().transport.bind(getClient().connection);
-
- getServer().connection = Proton.connection();
- getServer().transport.bind(getServer().connection);
-
- LOGGER.fine(bold("======== About to open connections"));
- getClient().connection.open();
- getServer().connection.open();
-
- doOutputInputCycle();
-
- LOGGER.fine(bold("======== About to open sessions"));
- getClient().session = getClient().connection.session();
-
- // Set the client session properties
- getClient().session.setProperties(clientProps);
-
- getClient().session.open();
-
- pumpClientToServer();
-
- getServer().session = getServer().connection.sessionHead(of(UNINITIALIZED), of(ACTIVE));
- assertEndpointState(getServer().session, UNINITIALIZED, ACTIVE);
-
- // Set the server session properties
- getServer().session.setProperties(serverProps);
-
- getServer().session.open();
-
- assertEndpointState(getServer().session, ACTIVE, ACTIVE);
-
- pumpServerToClient();
-
- assertEndpointState(getClient().session, ACTIVE, ACTIVE);
-
- // Verify server side got the clients session properties as expected
- Map<Symbol, Object> serverRemoteProperties = getServer().session.getRemoteProperties();
- assertNotNull("Server had no remote properties", serverRemoteProperties);
- assertEquals("Server remote properties not expected size", 1, serverRemoteProperties.size());
- assertTrue("Server remote properties lack expected key: " + clientPropName, serverRemoteProperties.containsKey(clientPropName));
- assertEquals("Server remote properties contain unexpected value for key: " + clientPropName, clientPropValue, serverRemoteProperties.get(clientPropName));
-
- // Verify the client side got the servers session properties as expected
- Map<Symbol, Object> clientRemoteProperties = getClient().session.getRemoteProperties();
- assertNotNull("Client had no remote properties", clientRemoteProperties);
- assertEquals("Client remote properties not expected size", 1, clientRemoteProperties.size());
- assertTrue("Client remote properties lack expected key: " + serverPropName, clientRemoteProperties.containsKey(serverPropName));
- assertEquals("Client remote properties contain unexpected value for key: " + serverPropName, serverPropValue, clientRemoteProperties.get(serverPropName));
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SimpleTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SimpleTest.java b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SimpleTest.java
deleted file mode 100644
index 2a4df7e..0000000
--- a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/SimpleTest.java
+++ /dev/null
@@ -1,51 +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.proton.systemtests;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.qpid.proton.Proton;
-import org.apache.qpid.proton.engine.Connection;
-import org.apache.qpid.proton.engine.EndpointState;
-import org.apache.qpid.proton.engine.Transport;
-import org.junit.Test;
-
-public class SimpleTest
-{
-
- @Test
- public void test()
- {
- Connection connection1 = Proton.connection();
- Connection connection2 = Proton.connection();;
- Transport transport1 = Proton.transport();
- transport1.bind(connection1);
-
- Transport transport2 = Proton.transport();
- transport2.bind(connection2);
-
- assertEquals(EndpointState.UNINITIALIZED, connection1.getLocalState());
- assertEquals(EndpointState.UNINITIALIZED, connection1.getRemoteState());
-
- connection1.open();
- connection2.open();
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/java/org/apache/qpid/proton/systemtests/TestLoggingHelper.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/TestLoggingHelper.java b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/TestLoggingHelper.java
deleted file mode 100644
index 1dd71f1..0000000
--- a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/TestLoggingHelper.java
+++ /dev/null
@@ -1,87 +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.proton.systemtests;
-
-import java.nio.ByteBuffer;
-import java.util.logging.Logger;
-
-/**
- * Provides functions for Proton tests to produce readable logging.
- * Uses terminal colours if system property {@value #PROTON_TEST_TERMINAL_COLOURS_PROPERTY}
- * is true
- */
-public class TestLoggingHelper
-{
- public static final String PROTON_TEST_TERMINAL_COLOURS_PROPERTY = "proton.test.terminal.colours";
-
- private static final String COLOUR_RESET;
- private static final String SERVER_COLOUR;
- private static final String CLIENT_COLOUR;
- private static final String BOLD;
-
- static
- {
- if(Boolean.getBoolean(PROTON_TEST_TERMINAL_COLOURS_PROPERTY))
- {
- BOLD = "\033[1m";
- SERVER_COLOUR = "\033[34m"; // blue
- CLIENT_COLOUR = "\033[32m"; // green
- COLOUR_RESET = "\033[0m";
- }
- else
- {
- BOLD = SERVER_COLOUR = CLIENT_COLOUR = COLOUR_RESET = "";
- }
- }
-
- public static final String CLIENT_PREFIX = CLIENT_COLOUR + "CLIENT" + COLOUR_RESET;
- public static final String SERVER_PREFIX = SERVER_COLOUR + "SERVER" + COLOUR_RESET;
- public static final String MESSAGE_PREFIX = "MESSAGE";
-
-
- private final BinaryFormatter _binaryFormatter = new BinaryFormatter();
- private Logger _logger;
-
- public TestLoggingHelper(Logger logger)
- {
- _logger = logger;
- }
-
- public void prettyPrint(String prefix, byte[] bytes)
- {
- _logger.fine(prefix + " " + bytes.length + " byte(s) " + _binaryFormatter.format(bytes));
- }
-
- /**
- * Note that ByteBuffer is assumed to be readable. Its state is unchanged by this operation.
- */
- public void prettyPrint(String prefix, ByteBuffer buf)
- {
- byte[] bytes = new byte[buf.remaining()];
- buf.duplicate().get(bytes);
- prettyPrint(prefix, bytes);
- }
-
- public static String bold(String string)
- {
- return BOLD + string + TestLoggingHelper.COLOUR_RESET;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/ConnectionTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/ConnectionTest.java b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/ConnectionTest.java
deleted file mode 100644
index 10f6d52..0000000
--- a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/ConnectionTest.java
+++ /dev/null
@@ -1,789 +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.proton.systemtests.engine;
-
-import static java.util.EnumSet.of;
-import static org.apache.qpid.proton.engine.EndpointState.ACTIVE;
-import static org.apache.qpid.proton.engine.EndpointState.CLOSED;
-import static org.apache.qpid.proton.engine.EndpointState.UNINITIALIZED;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.qpid.proton.Proton;
-import org.apache.qpid.proton.amqp.Symbol;
-import org.apache.qpid.proton.amqp.transport.Close;
-import org.apache.qpid.proton.amqp.transport.ErrorCondition;
-import org.apache.qpid.proton.amqp.transport.Open;
-import org.apache.qpid.proton.engine.Connection;
-import org.apache.qpid.proton.engine.Endpoint;
-import org.apache.qpid.proton.engine.EndpointState;
-import org.apache.qpid.proton.engine.Session;
-import org.apache.qpid.proton.engine.Transport;
-import org.apache.qpid.proton.engine.impl.AmqpFramer;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * Implicitly tests both {@link Connection} and {@link Transport} (e.g. for stuff like the AMQP header exchange).
- *
- * TODO test that the connection properties, connection capability, and error info maps have keys that are exclusively of type Symbol.
- */
-public class ConnectionTest
-{
- private static final String SERVER_CONTAINER = "serverContainer";
- private static final String CLIENT_CONTAINER = "clientContainer";
-
- private final Transport _clientTransport = Proton.transport();
- private final Transport _serverTransport = Proton.transport();
-
- private final TransportPumper _pumper = new TransportPumper(_clientTransport, _serverTransport);
-
- private final Connection _clientConnection = Proton.connection();
- private final Connection _serverConnection = Proton.connection();
-
- private final AmqpFramer _framer = new AmqpFramer();
-
- // 2.4.1 Opening A Connection
-
- /** */
- @Test
- public void testOpenConnection()
- {
- _pumper.pumpAll();
-
- bindAndOpenConnections();
- }
-
-
- /** Container id is a mandatory field so this should cause an error */
- @Test
- public void testReceiptOfOpenWithoutContainerId_causesTODO()
- {
- _pumper.pumpAll();
-
- Open openWithoutContainerId = new Open();
- byte[] openFrameBuffer = _framer.generateFrame(0, openWithoutContainerId);
-
- int serverConsumed = _serverTransport.input(openFrameBuffer, 0, openFrameBuffer.length);
- assertEquals(openFrameBuffer.length, serverConsumed);
- assertEquals(_serverTransport.capacity(), Transport.END_OF_STREAM);
- }
-
- /**
- * "Prior to any explicit negotiation, the maximum frame size is 512 (MIN-MAX-FRAME-SIZE) and the maximum channel number is 0"
- * */
- @Test
- public void testReceiptOfOpenExactlyDefaultMaximumFrameSize()
- {
- _pumper.pumpAll();
-
- _serverTransport.bind(_serverConnection);
- assertEnpointState(_serverConnection, UNINITIALIZED, UNINITIALIZED);
-
- // containerId and extended header sized to give an open frame
- // exactly 512 bytes in length.
- String containerId = "12345678";
- int extendedHeaderSize = 122 * 4;
-
- Open open = new Open();
- open.setContainerId(containerId);
- byte[] openFrameBuffer = _framer.generateFrame(0, new byte[extendedHeaderSize], open);
- assertEquals("Test requires a frame of size MIN_MAX_FRAME_SIZE",
- Transport.MIN_MAX_FRAME_SIZE, openFrameBuffer.length);
-
- int serverConsumed = _serverTransport.input(openFrameBuffer, 0, openFrameBuffer.length);
- assertEquals(openFrameBuffer.length, serverConsumed);
-
- // Verify that the server has seen the Open arrive
- assertEnpointState(_serverConnection, UNINITIALIZED, ACTIVE);
- assertEquals(containerId, _serverConnection.getRemoteContainer());
- }
-
- /**
- * "Prior to any explicit negotiation, the maximum frame size is 512 (MIN-MAX-FRAME-SIZE) and the maximum channel number is 0"
- */
- @Test
- public void testReceiptOfOpenBiggerThanDefaultMaximumFrameSize_causesTODO()
- {
- _pumper.pumpAll();
-
- _serverTransport.bind(_serverConnection);
- assertEnpointState(_serverConnection, UNINITIALIZED, UNINITIALIZED);
-
- // containerId and extended header sized to give an open frame
- // 1 byte larger the than 512 bytes permitted before negotiation by the AMQP spec.
-
- String containerId = "123456789";
- int extendedHeaderSize = 122 * 4;
-
- Open bigOpen = new Open();
- bigOpen.setContainerId(containerId);
- byte[] openFrameBuffer = _framer.generateFrame(0, new byte[extendedHeaderSize], bigOpen);
- assertEquals("Test requires a frame of size MIN_MAX_FRAME_SIZE + 1",
- Transport.MIN_MAX_FRAME_SIZE + 1, openFrameBuffer.length);
-
- int serverConsumed = _serverTransport.input(openFrameBuffer, 0, openFrameBuffer.length);
- assertEquals(openFrameBuffer.length, serverConsumed);
-
- // TODO server should indicate error but currently both implementations currently process
- // the larger frames. The following assertions should fail but currently pass.
- assertEnpointState(_serverConnection, UNINITIALIZED, ACTIVE);
- assertNotNull(_serverConnection.getRemoteContainer());
- }
-
- @Test
- public void testReceiptOfSecondOpen_causesTODO()
- {
- bindAndOpenConnections();
-
- Open secondOpen = new Open(); // erroneous
- secondOpen.setContainerId("secondOpen");
- byte[] openFrameBuffer = _framer.generateFrame(0, secondOpen);
-
- int serverConsumed = _serverTransport.input(openFrameBuffer, 0, openFrameBuffer.length);
- assertEquals(openFrameBuffer.length, serverConsumed);
-
- // TODO server should indicate error but currently both implementation currently
- // allow this condition
- }
-
- /** "each peer MUST send an open frame before sending any other frames"
- *
- * @see ConnectionTest#testReceiptOfCloseBeforeOpen_causesTODO()
- */
- public void testReceiptOfIntialFrameOtherThanOpen_causesTODO()
- {
- }
-
- /**
- * 2.4.5 "Implementations MUST be prepared to handle empty frames arriving on any valid channel"
- *
- * TODO consider moving to {@link TransportTest} once we have a less Connection-centric way of
- * checking health than calling {@link #bindAndOpenConnections()}
- */
- @Test
- public void testReceiptOfInitialEmptyFrame_isAllowed()
- {
- _pumper.pumpAll();
-
- byte[] emptyFrame = _framer.createEmptyFrame(0);
- int bytesConsumed = _serverTransport.input(emptyFrame, 0, emptyFrame.length);
- assertEquals(emptyFrame.length, bytesConsumed);
-
- bindAndOpenConnections();
- }
-
-
- /** "The open frame can only be sent on channel 0" */
- @Test
- @Ignore("Reinstate once it is agreed how error condition will be reported to user of API")
- public void testReceiptOfOpenOnNonZeroChannelNumber_causesTODO()
- {
- _pumper.pumpAll();
-
- Open open = new Open();
- open.setContainerId(SERVER_CONTAINER);
-
- int nonZeroChannelId = 1;
- byte[] buf = _framer.generateFrame(nonZeroChannelId, open);
- int rv = _serverTransport.input(buf, 0, buf.length);
- // TODO server should indicate error
- }
-
-
- /**
- * "After sending the open frame and reading its partner's open frame a peer MUST operate within
- * mutually acceptable limitations from this point forward"
- * see 2.7.1 "A peer that receives an oversized frame MUST close the connection with the framing-error error-code"
- */
- public void testReceiptOfFrameLargerThanAgreedMaximumSize_causesTODO()
- {
- }
-
- public void testThatSentFramesAreWithinMaximumSizeLimit()
- {
- }
-
- // 2.4.2 Pipelined Open
-
- /** test that the other peer accepts the pipelined frames and creates an open connection */
- @Test
- public void testReceiptOfOpenUsingPipelining()
- {
- _clientConnection.setContainer(CLIENT_CONTAINER);
- _clientTransport.bind(_clientConnection);
- _clientConnection.open();
-
- _serverTransport.bind(_serverConnection);
-
- // when pipelining, we delay pumping until the connection is both bound and opened
- _pumper.pumpOnceFromClientToServer();
-
- assertEnpointState(_clientConnection, ACTIVE, UNINITIALIZED);
- assertEnpointState(_serverConnection, UNINITIALIZED, ACTIVE);
- }
-
-
- /** test that the other peer accepts the pipelined frames and creates an already-closed connection */
- @Test
- public void testReceiptOfOpenThenCloseUsingPipelining()
- {
- _clientConnection.setContainer(CLIENT_CONTAINER);
- _clientTransport.bind(_clientConnection);
- _clientConnection.open();
- _clientConnection.close();
-
- _serverTransport.bind(_serverConnection);
- _pumper.pumpOnceFromClientToServer();
-
- assertEnpointState(_clientConnection, CLOSED, UNINITIALIZED);
- assertEnpointState(_serverConnection, UNINITIALIZED, CLOSED);
- }
-
- /**
- * Similar to {@link #testReceiptOfOpenUsingPipelining()} but opens both ends of the connection
- * so we can actually use it.
- */
- @Test
- public void testOpenConnectionUsingPipelining()
- {
- _clientConnection.setContainer(CLIENT_CONTAINER);
- _clientTransport.bind(_clientConnection);
- _clientConnection.open();
-
-
- _serverConnection.setContainer(SERVER_CONTAINER);
- _serverTransport.bind(_serverConnection);
- _serverConnection.open();
-
- _pumper.pumpAll();
-
- assertEnpointState(_clientConnection, ACTIVE, ACTIVE);
- assertEnpointState(_serverConnection, ACTIVE, ACTIVE);
-
- assertConnectionIsUsable();
- }
-
- // 2.4.3 Closing A Connection and 2.7.9 Close
-
- /**
- * "each peer MUST write a close frame"
- * Omits the optional error field
- */
- @Test
- public void testCloseConnection()
- {
- bindAndOpenConnections();
-
- assertEnpointState(_clientConnection, ACTIVE, ACTIVE);
- assertEnpointState(_serverConnection, ACTIVE, ACTIVE);
-
- _clientConnection.close();
-
- assertEnpointState(_clientConnection, CLOSED, ACTIVE);
- assertEnpointState(_serverConnection, ACTIVE, ACTIVE);
-
- _pumper.pumpAll();
-
- assertEnpointState(_clientConnection, CLOSED, ACTIVE);
- assertEnpointState(_serverConnection, ACTIVE, CLOSED);
-
- _serverConnection.close();
-
- assertEnpointState(_clientConnection, CLOSED, ACTIVE);
- assertEnpointState(_serverConnection, CLOSED, CLOSED);
-
- _pumper.pumpAll();
-
- assertEnpointState(_clientConnection, CLOSED, CLOSED);
- assertEnpointState(_serverConnection, CLOSED, CLOSED);
- }
-
- /**
- * "each peer MUST write a close frame with a code indicating the reason for closing"
- * Also see 2.8.16 Connection Error
- */
- @Test
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public void testCloseConnectionWithErrorCode_causesCloseFrameContainingErrorCodeToBeSent()
- {
- bindAndOpenConnections();
-
- /*
- * TODO javadoc for {@link Connection#getCondition()} states null is returned if there is no condition,
- * this differs from the implementation of both Proton-c and Proton-j.
- */
- assertNull(_clientConnection.getCondition().getCondition());
- assertNull(_serverConnection.getCondition().getCondition());
-
- assertNull(_clientConnection.getRemoteCondition().getCondition());
- assertNull(_serverConnection.getRemoteCondition().getCondition());
-
- ErrorCondition clientErrorCondition = new ErrorCondition(Symbol.getSymbol("myerror"), "mydescription");
- Map info = new HashMap();
- info.put(Symbol.getSymbol("simplevalue"), "value");
- info.put(Symbol.getSymbol("list"), Arrays.asList("e1", "e2", "e3"));
- clientErrorCondition.setInfo(info);
- _clientConnection.setCondition(clientErrorCondition);
-
- _clientConnection.close();
- _pumper.pumpAll();
-
- assertEquals(clientErrorCondition, _serverConnection.getRemoteCondition());
- assertNull(_serverConnection.getCondition().getCondition());
- }
-
- /**
- * "each peer MUST write a close frame with a code indicating the reason for closing"
- */
- public void testReceiptOfConnectionCloseContainingErrorCode_allowsErrorCodeToBeObserved()
- {
- }
-
- /**
- * A test for when the connection close frame contains a session error
- * rather than a connection error. This is allowed by the spec.
- */
- public void testReceiptOfConnectionCloseContainingNonConnectionErrorCode_causesTODO()
- {
- }
-
- /** "This frame MUST be the last thing ever written onto a connection." */
- public void testUsingProtonAfterClosingConnection_doesntCauseFrameToBeSent()
- {
- }
-
- /** "This frame MUST be the last thing ever written onto a connection." */
- public void testReceiptOfFrameAfterClose_causesTODO()
- {
- }
-
- /** "A close frame MAY be received on any channel up to the maximum channel number negotiated in open" */
- public void testReceiptOfCloseOnNonZeroChannelNumber_causesHappyPathTODO()
- {
- }
-
- /**
- * "each peer MUST send an open frame before sending any other frames"
- */
- @Test
- public void testReceiptOfCloseBeforeOpen_causesTODO()
- {
- _pumper.pumpAll();
-
- Close surprisingClose = new Close();
-
- byte[] buf = _framer.generateFrame(0, surprisingClose);
- _serverTransport.input(buf, 0, buf.length);
-
- // TODO server should indicate error
- }
-
- // 2.4.4 Simultaneous Close
-
- /** "both endpoints MAY simultaneously" */
- public void testPeersCloseConnectionSimultaneously()
- {
- }
-
- // 2.4.5 Idle Timeout Of A Connection
-
- public void testReceiptOfFrame_preventsIdleTimeoutOccurring()
- {
- }
-
- /** "If the threshold is exceeded, then a peer SHOULD try to gracefully close the connection using a close frame with an error explaining why" */
- public void testReceiptOfFrameTooLate_causedIdleTimeoutToOccur()
- {
- }
-
- /** "Each peer has its own (independent) idle timeout." */
- public void testPeersWithDifferentIdleTimeouts_timeOutAtTheCorrectTimes()
- {
- }
-
- /**
- * "If the value is not set, then the sender does not have an idle time-out. However,
- * senders doing this SHOULD be aware that implementations MAY choose to use an internal default
- * to efficiently manage a peer's resources."
- */
- public void testReceiptOfFrameWithZeroIdleTimeout_causesNoIdleFramesToBeSent()
- {
- }
-
- /**
- * "If a peer can not, for any reason support a proposed idle timeout,
- * then it SHOULD close the connection using a close frame with an error explaining why"
- */
- public void testReceiptOfOpenWithUnsupportedTimeout_causesCloseWithError()
- {
- }
-
- /**
- * implementations ... MUST use channel 0 if a maximum channel number has not yet been negotiated
- * (i.e., before an open frame has been received)
- */
- public void testReceiptOfEmptyFrameOnNonZeroChannelBeforeMaximumChannelsNegotiated_causesTODO()
- {
- }
-
-
- // 2.4.7 State transitions
-
- /**
- * The DISCARDING state is a variant of the CLOSE_SENT state where the close is triggered by an error.
- * In this case any incoming frames on the connection MUST be silently discarded until the peer's close frame is received
- */
- public void testReceiptOfFrameWhenInDiscardingState_isIgnored()
- {
- }
-
- // 2.7.1 Open
-
- public void testReceiptOfOpen_containerCanBeRetrieved()
- {
- }
-
- /**
- * The spec says:
- * "If no hostname is provided the receiving peer SHOULD select a default based on its own configuration"
- * but Proton's Engine layer does not do any defaulting - this is the responsibility
- * of other layers e.g. Messenger or Driver.
- */
- public void testReceiptOfOpenWithoutHostname_nullHostnameIsRetrieved()
- {
- }
-
- public void testReceiptOfOpenWithHostname_hostnameCanBeRetrieved()
- {
- }
-
- /**
- * "Both peers MUST accept frames of up to 512 (MIN-MAX-FRAME-SIZE) octets."
- */
- public void testReceiptOfOpenWithMaximumFramesizeLowerThanMinMaxFrameSize_causesTODO()
- {
- }
-
- public void testInitiatingPeerAndReceivingPeerUseDifferentMaxFrameSizes()
- {
- }
-
- public void testReceiptOfSessionBeginThatBreaksChannelMax_causesTODO()
- {
- }
-
- public void testCreationOfSessionThatBreaksChannelMax_causesTODO()
- {
- }
-
- public void testOpenConnectionWithPeersUsingUnequalChannelMax_enforcesLowerOfTwoValues()
- {
- }
-
- public void testOpenConnectionWithOnePeerUsingUnsetChannelMax_enforcesTheSetValue()
- {
- }
-
- public void testReceiptOfBeginWithInUseChannelId_causesTODO()
- {
- }
-
- /** "If a session is locally initiated, the remote-channel MUST NOT be set." */
- public void testReceiptOfUnsolicitedBeginWithChannelId_causesTODO()
- {
- }
-
- /**
- * "When an endpoint responds to a remotely initiated session, the remote-channel MUST be set
- * to the channel on which the remote session sent the begin."
- */
- public void testThatBeginResponseContainsChannelId()
- {
- }
-
- /**
- * I imagine we will want to begin ChannelMax number of sessions, then end
- * a session from the 'middle'. Then check we are correctly begin a new
- * channel.
- */
- public void testEnd_channelNumberAvailableForReuse()
- {
- }
-
- public void testReceiptOfOpenWithOutgoingLocales_outgoingLocalesCanBeRetrieved()
- {
- }
-
- /** "A null value or an empty list implies that only en-US is supported. " */
- public void testReceiptOfOpenWithNullOutgoingLocales_defaultOutgoingLocaleCanBeRetrieved()
- {
- }
-
- /** "A null value or an empty list implies that only en-US is supported. " */
- public void testReceiptOfOpenWithEmptyListOfOutgoingLocales_defaultOutgoingLocaleCanBeRetrieved()
- {
- }
-
- public void testReceiptOfOpenWithIncomingLocales_incomingLocalesCanBeRetrieved()
- {
- }
-
- /** "A null value or an empty list implies that only en-US is supported. " */
- public void testReceiptOfOpenWithNullIncomingLocales_defaultIncomingLocaleCanBeRetrieved()
- {
- }
-
- /** "A null value or an empty list implies that only en-US is supported. " */
- public void testReceiptOfOpenWithEmptyListOfIncomingLocales_defaultIncomingLocaleCanBeRetrieved()
- {
- }
-
- // TODO It seems that currently Proton-j merely exposes the remote capabilities to
- // the user and is seems to be a end-user responsibility to enforce "If the receiver of the
- // offered-capabilities requires an extension capability which is not present in the
- // offered-capability list then it MUST close the connection.". However, i wonder if this
- // is an omission -- surely Proton could valid that request desirable capabilities are
- // offered by the remote???
-
- public void testReceiptOfOpenWithOfferedCapabilities_offeredCapabilitiesCanBeRetrieved()
- {
- }
-
- public void testReceiptOfOpenWithDesiredCapabilities_desiredCapabilitiesCanBeRetrieved()
- {
- }
-
- public void testReceiptOfOpenWithProperties_propertiesCanBeRetrieved()
- {
- }
-
- // Transport/Connection related api-inspired tests
-
- /**
- * TODO is there a limit on the number of connections?
- * Also try closing them in a different order to their creation.
- */
- public void testCreateMultipleConnections()
- {
- }
-
- public void testBindTwoConnectionsToATransport_causesTODO()
- {
- }
-
- public void testBindAConnectionToTwoTransports_causesTODO()
- {
- }
-
- /**
- * TODO possibly try to bind this "opened" connection too if it doesn't go pop before this.
- */
- public void testOpenBeforeBind_causesTODO()
- {
- }
-
- public void testOpenTwice_throwsExceptionTODO()
- {
- }
-
- public void testOpenAfterClose_throwsExceptionTODO()
- {
- }
-
- // Connection.java-related api-inspired tests
-
- /**
- * also test that the session appears in the connection's session list
- */
- public void testCreateSession()
- {
- }
-
- public void testSessionHeadWhenNoSessionsExist_returnsNull()
- {
- }
-
- public void testSessionHead_returnsSessionsMatchingCriteria()
- {
- }
-
- public void testLinkHeadWhenNoLinksExist_returnsNull()
- {
- }
-
- public void testLinkHead_returnsLinksMatchingCriteria()
- {
- }
-
- public void testGetWorkHeadWhenNoWork_returnsNull()
- {
- }
-
- public void testGetWorkHeadWhenOneDeliveryIsPending_returnsTheDelivery()
- {
- }
-
- /**
- * use a name that is longer than the limit of AMQShortString
- */
- public void testSetContainerWithLongName_isAllowed()
- {
- }
-
- public void testSetContainerWithNullName_throwsException()
- {
- }
-
- public void testSetContainerWithEmptyName_throwsException()
- {
- }
-
- public void testSetContainerAfterOpeningConnection_throwsExceptionTODO()
- {
- }
-
- public void testOpenWithoutContainerName_throwsExceptionTODO()
- {
- }
-
- public void testGetRemoteContainerBeforeOpen_returnsNull()
- {
- }
-
- public void testGetRemoteContainerBeforeReceiptOfOpen_returnsNull()
- {
- }
-
- public void testSetHostnameWithLongName_isAllowed()
- {
- }
-
- /**
- * Proton does not require the conventional foo.bar.com format for hostnames.
- */
- public void testSetHostnameWithNonstandardName_isAllowed()
- {
- }
-
- public void testSetHostnameAfterOpeningConnection_throwsExceptionTODO()
- {
- }
-
- public void testSetOfferedCapabilitiesAfterOpeningConnection_throwsExceptionTODO()
- {
- }
-
- public void testSetDesiredCapabilitiesAfterOpeningConnection_throwsExceptionTODO()
- {
- }
-
- public void testSetPropertiesAfterOpeningConnection_throwsExceptionTODO()
- {
- }
-
- // Endpoint api-inspired tests
-
- public void testGetLocalStateBeforeOpen_returnsUninitialised()
- {
- }
-
- public void testGetLocalStateAfterClose_returnsClosed()
- {
- }
-
- public void testGetRemoteStateBeforeReceiptOfOpen_returnsUninitialised()
- {
- }
-
- public void testGetRemoteStateAfterReceiptOfClose_returnsClosed()
- {
- }
-
- public void testFree_isAllowed()
- {
- }
-
- public void testSetContext_contextCanBeRetrieved()
- {
- }
-
- public void testGetContextWithoutSettingContext_returnsNull()
- {
- }
-
- private void assertConnectionIsUsable()
- {
- Session clientSesion = _clientConnection.session();
- clientSesion.open();
- _pumper.pumpAll();
-
- Session serverSession = _serverConnection.sessionHead(of(UNINITIALIZED), of(ACTIVE));
- serverSession.open();
- _pumper.pumpAll();
-
- assertEnpointState(clientSesion, ACTIVE, ACTIVE);
- assertEnpointState(serverSession, ACTIVE, ACTIVE);
- }
-
- private void bindAndOpenConnections()
- {
- // TODO should we be checking local and remote error conditions as part of this?
-
- _clientConnection.setContainer(CLIENT_CONTAINER);
- _serverConnection.setContainer(SERVER_CONTAINER);
-
- assertEnpointState(_clientConnection, UNINITIALIZED, UNINITIALIZED);
- assertEnpointState(_serverConnection, UNINITIALIZED, UNINITIALIZED);
-
- _clientTransport.bind(_clientConnection);
- _serverTransport.bind(_serverConnection);
-
- _clientConnection.open();
-
- assertEnpointState(_clientConnection, ACTIVE, UNINITIALIZED);
- assertEnpointState(_serverConnection, UNINITIALIZED, UNINITIALIZED);
-
- _pumper.pumpAll();
-
- assertEnpointState(_clientConnection, ACTIVE, UNINITIALIZED);
- assertEnpointState(_serverConnection, UNINITIALIZED, ACTIVE);
-
- _serverConnection.open();
-
- assertEnpointState(_clientConnection, ACTIVE, UNINITIALIZED);
- assertEnpointState(_serverConnection, ACTIVE, ACTIVE);
-
- _pumper.pumpAll();
-
- assertEnpointState(_clientConnection, ACTIVE, ACTIVE);
- assertEnpointState(_serverConnection, ACTIVE, ACTIVE);
- }
-
- private void assertEnpointState(Endpoint endpoint, EndpointState localState, EndpointState remoteState)
- {
- assertEquals("Unexpected local state", localState, endpoint.getLocalState());
- assertEquals("Unexpected remote state", remoteState, endpoint.getRemoteState());
- }
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/TransportPumper.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/TransportPumper.java b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/TransportPumper.java
deleted file mode 100644
index fd1d198..0000000
--- a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/TransportPumper.java
+++ /dev/null
@@ -1,73 +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.proton.systemtests.engine;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.qpid.proton.engine.Transport;
-
-public class TransportPumper
-{
- private static final String SERVER_ROLE = "server";
- private static final String CLIENT_ROLE = "client";
-
- private final Transport _clientTransport;
- private final Transport _serverTransport;
-
- public TransportPumper(Transport clientTransport, Transport serverTransport)
- {
- _clientTransport = clientTransport;
- _serverTransport = serverTransport;
- }
-
- public void pumpAll()
- {
- boolean bytesToTransfer = true;
- while(bytesToTransfer)
- {
- int clientOutputLength = pumpOnceFromClientToServer();
- int serverOutputLength = pumpOnceFromServerToClient();
- bytesToTransfer = clientOutputLength > 0 || serverOutputLength > 0;
- }
- }
-
- public int pumpOnceFromClientToServer()
- {
- return pumpOnce(_clientTransport, CLIENT_ROLE, _serverTransport, SERVER_ROLE);
- }
-
- public int pumpOnceFromServerToClient()
- {
- return pumpOnce(_serverTransport, SERVER_ROLE, _clientTransport, CLIENT_ROLE);
- }
-
- private int pumpOnce(Transport transportFrom, String fromRole, Transport transportTo, String toRole)
- {
- final byte[] output = new byte[1024];
- int outputLength = transportFrom.output(output, 0, output.length);
- if (outputLength > 0)
- {
- int numberConsumedByServer = transportTo.input(output, 0, outputLength);
- assertEquals("Expecting " + toRole + " to consume all of " + fromRole + "'s output", outputLength, numberConsumedByServer);
- }
- return outputLength;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/TransportTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/TransportTest.java b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/TransportTest.java
deleted file mode 100644
index 01852bb..0000000
--- a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/TransportTest.java
+++ /dev/null
@@ -1,86 +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.proton.systemtests.engine;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-
-import org.apache.qpid.proton.Proton;
-import org.apache.qpid.proton.engine.Transport;
-import org.apache.qpid.proton.engine.TransportException;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * TODO add test for 2.3.1 "The frame is malformed if the size is less than the size of the frame header (8 bytes)"
- * TODO add test using empty byte arrays (calling {@link Transport#input(byte[], int, int)} with empty byte array in Proton-j-impl currently throws "TransportException Unexpected EOS")
- */
-public class TransportTest
-{
- private final Transport _transport = Proton.transport();
-
- /**
- * Note that Proton does not yet give the application explicit control over protocol version negotiation
- * TODO does Proton give *visibility* of the negotiated protocol version?
- */
- public void testReceiptOfHeaderContainingUnsupportedProtocolVersionNumber_causesAmqp10Response()
- {
- }
-
- @Test
- @Ignore("Reinstate once it is agreed how error condition will be reported by to use of API")
- public void testReceiptOfNonAmqpHeader_causesAmqp10Response()
- {
- byte[] nonAmqpHeader = "HTTP/1.0".getBytes();
- try
- {
- _transport.input(nonAmqpHeader, 0, nonAmqpHeader.length);
-
- // TODO Proton-c gives rv PN_ERROR and a pn_transport_error "AMQP header mismatch: 'HTTP/1.0'" and then
- // jni layer turns this into a TransportException.
- // Proton-j just throws TransportException
- }
- catch (TransportException te)
- {
- // TODO - exception should not be thrown
- }
-
- byte[] buf = new byte[255];
- int bytesWritten = _transport.output(buf, 0, buf.length);
- byte[] response = new byte[bytesWritten];
- System.arraycopy(buf, 0, response, 0, bytesWritten);
- assertArrayEquals("AMQP\0\1\0\0".getBytes(), response);
-
- // how should further input be handled??
-
- assertTransportRefusesFurtherInputOutput(_transport);
- }
-
- private void assertTransportRefusesFurtherInputOutput(Transport transport)
- {
- byte[] sourceBufferThatShouldBeUnread = "REFUSEME".getBytes();
- int bytesConsumed = transport.input(sourceBufferThatShouldBeUnread, 0, sourceBufferThatShouldBeUnread.length);
- // assertEquals(-1, bytesConsumed); // TODO reinstate with testReceiptOfNonAmqpHeader_causesAmqp10Response
-
- byte[] destBufferThatShouldRemainUnwritten = new byte[255];
- int bytesWritten = transport.output(destBufferThatShouldRemainUnwritten, 0, destBufferThatShouldRemainUnwritten.length);
- assertEquals(-1, bytesWritten);
- }
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/java/org/apache/qpid/proton/test/ProtonTestCase.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/test/ProtonTestCase.java b/proton-j/src/test/java/org/apache/qpid/proton/test/ProtonTestCase.java
deleted file mode 100644
index 68a00d8..0000000
--- a/proton-j/src/test/java/org/apache/qpid/proton/test/ProtonTestCase.java
+++ /dev/null
@@ -1,110 +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.proton.test;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-
-public class ProtonTestCase
-{
- private static final Logger _logger = Logger.getLogger(ProtonTestCase.class.getName());
-
- private final Map<String, String> _propertiesSetForTest = new HashMap<String, String>();
-
- @Rule public TestName _testName = new TestName();
-
- /**
- * Set a System property for duration of this test only. The tearDown will
- * guarantee to reset the property to its previous value after the test
- * completes.
- *
- * @param property The property to set
- * @param value the value to set it to, if null, the property will be cleared
- */
- protected void setTestSystemProperty(final String property, final String value)
- {
- if (!_propertiesSetForTest.containsKey(property))
- {
- // Record the current value so we can revert it later.
- _propertiesSetForTest.put(property, System.getProperty(property));
- }
-
- if (value == null)
- {
- System.clearProperty(property);
- _logger.info("Set system property '" + property + "' to be cleared");
- }
- else
- {
- System.setProperty(property, value);
- _logger.info("Set system property '" + property + "' to: '" + value + "'");
- }
-
- }
-
- /**
- * Restore the System property values that were set by this test run.
- */
- protected void revertTestSystemProperties()
- {
- if(!_propertiesSetForTest.isEmpty())
- {
- for (String key : _propertiesSetForTest.keySet())
- {
- String value = _propertiesSetForTest.get(key);
- if (value != null)
- {
- System.setProperty(key, value);
- _logger.info("Reverted system property '" + key + "' to: '" + value + "'");
- }
- else
- {
- System.clearProperty(key);
- _logger.info("Reverted system property '" + key + "' to be cleared");
- }
- }
-
- _propertiesSetForTest.clear();
- }
- }
-
- @After
- public void tearDown() throws java.lang.Exception
- {
- _logger.info("========== tearDown " + getTestName() + " ==========");
- revertTestSystemProperties();
- }
-
- @Before
- public void setUp() throws Exception
- {
- _logger.info("========== start " + getTestName() + " ==========");
- }
-
- protected String getTestName()
- {
- return getClass().getSimpleName() + "." +_testName.getMethodName();
- }
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/resources/META-INF/services/org.apache.qpid.proton.factoryloadertesting.DummyProtonFactory
----------------------------------------------------------------------
diff --git a/proton-j/src/test/resources/META-INF/services/org.apache.qpid.proton.factoryloadertesting.DummyProtonFactory b/proton-j/src/test/resources/META-INF/services/org.apache.qpid.proton.factoryloadertesting.DummyProtonFactory
deleted file mode 100644
index bd4307b..0000000
--- a/proton-j/src/test/resources/META-INF/services/org.apache.qpid.proton.factoryloadertesting.DummyProtonFactory
+++ /dev/null
@@ -1,2 +0,0 @@
-org.apache.qpid.proton.factoryloadertesting.DummyProtonCFactory
-org.apache.qpid.proton.factoryloadertesting.DummyProtonJFactory
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/README.txt
----------------------------------------------------------------------
diff --git a/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/README.txt b/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/README.txt
deleted file mode 100644
index 24e1f13..0000000
--- a/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/README.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-# These resources are used during the unittesting of the SSL capabilities
-#
-# cert.pem.txt - A public certificate
-# key.pem.txt - A passphrase protected private key
-# private-key-clear.pem.txt - An unprotected private key
-
-# Files have a .txt suffix to prevent undesired handling by other tooling (IDEs etc)
-# and can easilly be re-created using the following openssl commands or you can
-# execute this file directly with
-# sh README.txt
-
-## Clean Up
-
-echo
-echo Clean Up
-echo
-
-rm *.pem.txt
-
-# 1. Generate a certificate and protected private key
-
-echo
-echo when prompted use 'unittest' as the passphase, all other fields can be random values
-echo
-
-openssl req -x509 -newkey rsa:2048 -keyout key.pem.txt -out cert.pem.txt -days 10000
-
-# 2. The following command produces an unprotected private key
-
-echo
-echo when prompted, use 'unittest' as the passphrase
-echo
-
-openssl rsa -in key.pem.txt -out private-key-clear.pem.txt -outform PEM
-
-echo
-
-# 3. The following command produces an unprotected PKCS#8 private key
-
-echo
-echo when prompted, use 'unittest' as the passphrase
-echo
-
-openssl pkcs8 -topk8 -nocrypt -in key.pem.txt -out private-key-clear-pkcs8.pem.txt
-
-echo
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/cert.pem.txt
----------------------------------------------------------------------
diff --git a/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/cert.pem.txt b/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/cert.pem.txt
deleted file mode 100644
index 84ec75a..0000000
--- a/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/cert.pem.txt
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIEmzCCA4OgAwIBAgIJAPjD77mpHLocMA0GCSqGSIb3DQEBBQUAMIGPMQswCQYD
-VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2Ux
-EDAOBgNVBAoTB1Rlc3RpbmcxDzANBgNVBAsTBlRlc3RlcjETMBEGA1UEAxMKdGVz
-dGluZy5pdDEgMB4GCSqGSIb3DQEJARYRbm9ib2R5QHRlc3RpbmcuaXQwHhcNMTYw
-NjA5MTgxNjA0WhcNNDMxMDI2MTgxNjA0WjCBjzELMAkGA1UEBhMCVVMxEzARBgNV
-BAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCFNhbiBKb3NlMRAwDgYDVQQKEwdUZXN0
-aW5nMQ8wDQYDVQQLEwZUZXN0ZXIxEzARBgNVBAMTCnRlc3RpbmcuaXQxIDAeBgkq
-hkiG9w0BCQEWEW5vYm9keUB0ZXN0aW5nLml0MIIBIjANBgkqhkiG9w0BAQEFAAOC
-AQ8AMIIBCgKCAQEAxbIpYVTdItTeWy1qaG3Lzs6IeMzAzHFsOw6rmeSM8GZ5S/vS
-PzsKfRCXKc52/2KblROsK2Eez/wt9CB9HgksHr/sjYtivwn/V/jumLb8z9R8jBnF
-jZ0KXyWxtiJFowh+Zd1BxJeQTmmbvJpYGVmKYu+4t66TQGhNUu8e+J5GIgJjDPnA
-TE5bGBMi7HtoXVy+Tp0sO/S7cXLXmWpeyCXS7HFUj+Jdzbed0yMs/JmbBXyLIYMU
-Rq1oSI8DOn5jtrTQz7/xI5qOebIwACcYk6LRI83zIIvcv6olpnzViDjAGT6PQtj5
-FuUe1WHKVjd4Bjyoo+zULwQoF1b6qSe5m6O7IQIDAQABo4H3MIH0MB0GA1UdDgQW
-BBQjS5wYZlVLz3eNVIxFGroXSPhl/zCBxAYDVR0jBIG8MIG5gBQjS5wYZlVLz3eN
-VIxFGroXSPhl/6GBlaSBkjCBjzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlm
-b3JuaWExETAPBgNVBAcTCFNhbiBKb3NlMRAwDgYDVQQKEwdUZXN0aW5nMQ8wDQYD
-VQQLEwZUZXN0ZXIxEzARBgNVBAMTCnRlc3RpbmcuaXQxIDAeBgkqhkiG9w0BCQEW
-EW5vYm9keUB0ZXN0aW5nLml0ggkA+MPvuakcuhwwDAYDVR0TBAUwAwEB/zANBgkq
-hkiG9w0BAQUFAAOCAQEAM41jrwVEQZltTWiQ8kBMSl4K80gBlLLDu/XD9Dfe6snD
-8wQZD21LLBlsLaVwR8Fk1umFHnwYoTD1tghfW7LeTS3zTMRu269a5xbZ82rOoeYk
-MQwFK7rMXPfNKGSk06lXAzjrlZD+qd8qfm1UEoUmWlmJyBinCnX8x8G5Z6Za4UsK
-LmdZShnbXRvToPZ/xGMeWmB2NGG5uF3evLM6+cdOLhqxoei90dmufWUcRDBXBEED
-8cZpXARYS2Q5EflmrDWOwMN+1cfEZDNssb/GmKouNuVoobxgIo9lftTds+gR319N
-usu7JUbh5QbAOdXg4prQ3ASNq9a95J4Y8O9cW4XdSg==
------END CERTIFICATE-----
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/key.pem.txt
----------------------------------------------------------------------
diff --git a/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/key.pem.txt b/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/key.pem.txt
deleted file mode 100644
index e1f72f5..0000000
--- a/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/key.pem.txt
+++ /dev/null
@@ -1,30 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: DES-EDE3-CBC,F0AAE930E2D9E692
-
-L9c43ZBCX8aRwhqrpbhKP2jNFi2c5MQO6qNV9/Ubk3fWC2pb0dqnHLBSzdOupIKa
-56wrzz9wtDUbPO3AsFBJmX5ov9rSLhAKeTdrYAUMk7qPhiMTUOvrDtGLHxhnBtYi
-2VV4I4ONhg+uYDa2GW8U/YI216E/t2nA4L6KuxI7ac8kWyMn5IJgk/GvnDlePxTc
-bDUGgRC/kiXhTTeBQoMih09MxCSJEgXbSKKB5FpNwzwwXGf2bHvdId8AY0e/7KDO
-pO5E9YpKu+HO+HbyhQJiIQr9CKkyfsdYST/ojGPGH+Yn8M4ZdBtPclisHkt7mIAz
-swqjpt9XHzVXJh4+Di0VPmvOnDcU8SV62VpyMnPbXL2eexEGrofIwfTHQQTHMfNZ
-OJOtXRJXBijGOd0mAT8ijTnuelBCsQtc0fMT8R0jSaQjONynaewNzBLnRD4E/9Gw
-gGPjEiLtXNSVjCFhIDgLFvuljrOqH+MIgkSFhpM/C9LnPXx3I7Mxe7198Fp/jDRZ
-GVpOQqAo4tbvw3cCOtRxdzwpUi9p6lnBGDRHjRRDMqzqncJhNej/cC8QonUw/7JO
-Rv3OMWIy682rCvS00q0dhm+If0f5Nox7rt1yxWYyX3zj/RdkeZezJTDuxDsyLpiw
-NzRSvLUVfdh1v6Ofcnh/6eDIi4uyCt+rDeZjvG3HGAssOD+27s6i18QDbbuolrkc
-yypQ7Bo/UeuUUCNE/G9ItHOCC1qxdJYIC30dAlmWPjYQrapQOuQWXzxs5u8+hxkb
-u32KA8nuCS1codbxPNXnVbrDyU/vWsxTjPr/ODChWfLeIu/9KwjxLLoOUwkRGJnm
-dQVZeawiSggIL2nwsS2c5hOV0yZZuNzB3RAqYV7ZfB5Xdk3LAEXjrYOELeFUY1vJ
-V3pcEdD8VfTLiEwQ/TMmg03ju+1dA5lMsLaQ0KrhUJbarkAeFEtAPgpaIhHoCAa5
-3ObLx/8dctrbHx4rRgkN6xWQz0qEMzAtpQaUYaFbnRrLKF4fqq+PC35BfwM5hVOa
-rXM1aQ065pV1cPVstqk0jN/36m+tMv5l7NperNS78UaFy+4KyX2/Lj3YvbLlTT75
-Hn6gf+nekTwW2V+P1Yn8MKr7jelCCai1MoLMugrUNfILKAohA/CGdupoUmxr5F3b
-F7XnY1RMAr0FROl5f5Fc6In12mey9mvHh1yT5HZa0SoK79/Bfv+3oiOXbqgKBJ8O
-2FkJtlBd/nx7EYx3teLXClvX+FfQL4gZkyvEE0m8HAFY0HfozNhKfi+PFDXz/R7X
-yCvBdIzE26nRtY9h4uhAcn3AefO8b0Slpmlq/+BDf8Pta9TF8zFWyzPRMIyuEE4l
-GTk1i6p9PDzu7lhC93tIfWZe5Xz1DB+c4bFQbzxAghoEOFz3NA17VEKEkl0t04sA
-lUqJmEftUPBZocgv7zO5v7z17G5yGqS+HyBGWaBqBRH9rGPhHxyEpPtwGNhP+biN
-7cvnlMbhD41KAkYDy3tQkztH/A0g/xNZTElhpXnnHq5AXnn46y/SVH5q6Tdy1xGz
-aEeKdL7JdPZ7XNmkHgbHLmxNFGtoJwx1hKw6slg+kh0j4xcNTpjJcQ==
------END RSA PRIVATE KEY-----
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/private-key-clear-pkcs8.pem.txt
----------------------------------------------------------------------
diff --git a/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/private-key-clear-pkcs8.pem.txt b/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/private-key-clear-pkcs8.pem.txt
deleted file mode 100644
index 2956f92..0000000
--- a/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/private-key-clear-pkcs8.pem.txt
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDFsilhVN0i1N5b
-LWpobcvOzoh4zMDMcWw7DquZ5IzwZnlL+9I/Owp9EJcpznb/YpuVE6wrYR7P/C30
-IH0eCSwev+yNi2K/Cf9X+O6YtvzP1HyMGcWNnQpfJbG2IkWjCH5l3UHEl5BOaZu8
-mlgZWYpi77i3rpNAaE1S7x74nkYiAmMM+cBMTlsYEyLse2hdXL5OnSw79LtxcteZ
-al7IJdLscVSP4l3Nt53TIyz8mZsFfIshgxRGrWhIjwM6fmO2tNDPv/Ejmo55sjAA
-JxiTotEjzfMgi9y/qiWmfNWIOMAZPo9C2PkW5R7VYcpWN3gGPKij7NQvBCgXVvqp
-J7mbo7shAgMBAAECggEALVFU2QHqGyTuv7nebYfVs1d2wzI0c+kAJV2Mip9wi18C
-KR/VpzbyhY67CBNTBeHlxjuXOO5vcL/fDNoxtCPoIDhgkmXEQgSZquHeV9WCiGWu
-EzOJLJg2G295mEWs7t1wlAsvG1Ce/MqKr6Y10cHLzjgjgL+c86O1LfCwic9GRl8c
-ec6AwUs/sWvZma44yQsulBXT00v94Xtn64D6MG/TPcjXF7fF7KdzOFQO8G/2Wr3R
-5IywXOP8E6Sofybfb0ZCGTSup/i5vLlp08vn3P9Jwnn83mxxMM9niwYegfWslg5A
-oosvebd6wL0xjtjG54tVT2wWLmSrmKt296HSIjNgAQKBgQDqVjnHSLoB5yk27z+2
-x1XzCTCt1b9Dr/0x1bHrMYE3IDzuHOqu2yuPF/vlIVH0BwVmEEsNQ3JyuwbebsAH
-+6umz+xwILw4qR6+8sBQ3HHadPm1B3/QEbc6RUQBAUpmKCyguS+dGJuY86Pk22LL
-Mr0vUfJrk9ppvVbl7irJ13r+IQKBgQDX+MykLC/gq0FstFHbAc75xS/UuXjX0npp
-egWdxhVnx5F6SrP4a0GB4LS/Jh+lChWGmdtlgnL0d/aHqxZuTWKafjg3RAIKRDGE
-bIJf46W/HiRlN0WNBkbjotV1LxWATfX03P4rdqmOMaD03eG3IVXHN3kuEE1gIO42
-Lem8Y38dAQKBgAaiACqq3VD2eQ0sAnKq+7zQUsdo2GwTDCif8tREZ3Lm/7KBsQbX
-/0iilierJMWyeS2lYmpysUecEZq0Kc1QC1DCa9/UnV9BMjSXbGgdhT94tiSwnKaI
-CdalZUJeBfwUQQcflsBslOLkaowsxYQY4I/5UtJGshTyHgaOEjn6VmnhAoGAHrXD
-K6kY2cKgV/vAE/tK2hte9Mm21EGapHr0Z33uN0aaeiA7PRzLQNOaAABEyawIaY5h
-Myr8e6S/SoVaeC7K0ZsXFUy3WYxe2iyv0UDGpcl8dWQJoMb+t4nE/pfGX+s2CS6P
-edCyxYRrFcajPO4hi2Vo9tLcncmw9cVLkj03qwECgYEAgJABS6gx+a0aP9W8wqBJ
-VJogDeAruq3j8+bwr/PqP8bUbjj5gNbblE75jQ890lGv0I71IdxxORprc92pMDRc
-xX6OY4ZzZ2f7fp4kGHF7pHQsg0anYuI1h+87G6Gkyd4RsdZ5EHD1iSJk6DcyD8OH
-ao1P1UBLB8/lyWe+muVftZA=
------END PRIVATE KEY-----
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/private-key-clear.pem.txt
----------------------------------------------------------------------
diff --git a/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/private-key-clear.pem.txt b/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/private-key-clear.pem.txt
deleted file mode 100644
index e3de94c..0000000
--- a/proton-j/src/test/resources/org/apache/qpid/proton/engine/impl/ssl/private-key-clear.pem.txt
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEowIBAAKCAQEAxbIpYVTdItTeWy1qaG3Lzs6IeMzAzHFsOw6rmeSM8GZ5S/vS
-PzsKfRCXKc52/2KblROsK2Eez/wt9CB9HgksHr/sjYtivwn/V/jumLb8z9R8jBnF
-jZ0KXyWxtiJFowh+Zd1BxJeQTmmbvJpYGVmKYu+4t66TQGhNUu8e+J5GIgJjDPnA
-TE5bGBMi7HtoXVy+Tp0sO/S7cXLXmWpeyCXS7HFUj+Jdzbed0yMs/JmbBXyLIYMU
-Rq1oSI8DOn5jtrTQz7/xI5qOebIwACcYk6LRI83zIIvcv6olpnzViDjAGT6PQtj5
-FuUe1WHKVjd4Bjyoo+zULwQoF1b6qSe5m6O7IQIDAQABAoIBAC1RVNkB6hsk7r+5
-3m2H1bNXdsMyNHPpACVdjIqfcItfAikf1ac28oWOuwgTUwXh5cY7lzjub3C/3wza
-MbQj6CA4YJJlxEIEmarh3lfVgohlrhMziSyYNhtveZhFrO7dcJQLLxtQnvzKiq+m
-NdHBy844I4C/nPOjtS3wsInPRkZfHHnOgMFLP7Fr2ZmuOMkLLpQV09NL/eF7Z+uA
-+jBv0z3I1xe3xeynczhUDvBv9lq90eSMsFzj/BOkqH8m329GQhk0rqf4uby5adPL
-59z/ScJ5/N5scTDPZ4sGHoH1rJYOQKKLL3m3esC9MY7YxueLVU9sFi5kq5irdveh
-0iIzYAECgYEA6lY5x0i6AecpNu8/tsdV8wkwrdW/Q6/9MdWx6zGBNyA87hzqrtsr
-jxf75SFR9AcFZhBLDUNycrsG3m7AB/urps/scCC8OKkevvLAUNxx2nT5tQd/0BG3
-OkVEAQFKZigsoLkvnRibmPOj5NtiyzK9L1Hya5Paab1W5e4qydd6/iECgYEA1/jM
-pCwv4KtBbLRR2wHO+cUv1Ll419J6aXoFncYVZ8eRekqz+GtBgeC0vyYfpQoVhpnb
-ZYJy9Hf2h6sWbk1imn44N0QCCkQxhGyCX+Olvx4kZTdFjQZG46LVdS8VgE319Nz+
-K3apjjGg9N3htyFVxzd5LhBNYCDuNi3pvGN/HQECgYAGogAqqt1Q9nkNLAJyqvu8
-0FLHaNhsEwwon/LURGdy5v+ygbEG1/9IopYnqyTFsnktpWJqcrFHnBGatCnNUAtQ
-wmvf1J1fQTI0l2xoHYU/eLYksJymiAnWpWVCXgX8FEEHH5bAbJTi5GqMLMWEGOCP
-+VLSRrIU8h4GjhI5+lZp4QKBgB61wyupGNnCoFf7wBP7StobXvTJttRBmqR69Gd9
-7jdGmnogOz0cy0DTmgAARMmsCGmOYTMq/Hukv0qFWnguytGbFxVMt1mMXtosr9FA
-xqXJfHVkCaDG/reJxP6Xxl/rNgkuj3nQssWEaxXGozzuIYtlaPbS3J3JsPXFS5I9
-N6sBAoGBAICQAUuoMfmtGj/VvMKgSVSaIA3gK7qt4/Pm8K/z6j/G1G44+YDW25RO
-+Y0PPdJRr9CO9SHccTkaa3PdqTA0XMV+jmOGc2dn+36eJBhxe6R0LINGp2LiNYfv
-OxuhpMneEbHWeRBw9YkiZOg3Mg/Dh2qNT9VASwfP5clnvprlX7WQ
------END RSA PRIVATE KEY-----
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org