You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2016/12/22 17:59:47 UTC
svn commit: r1775689 [4/4] - in /qpid/java/trunk:
bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/upgrade/
bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/upgrade/
bdbstore/systests/src/test/java/org/apache/qpid/server/sto...
Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java?rev=1775689&r1=1775688&r2=1775689&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java Thu Dec 22 17:59:46 2016
@@ -26,6 +26,7 @@ import static org.apache.qpid.test.utils
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -34,10 +35,8 @@ import javax.servlet.http.HttpServletRes
import org.apache.qpid.server.management.plugin.servlet.rest.AbstractServlet;
import org.apache.qpid.server.model.AccessControlProvider;
-import org.apache.qpid.server.model.Binding;
import org.apache.qpid.server.model.Exchange;
import org.apache.qpid.server.model.Queue;
-import org.apache.qpid.server.security.acl.AbstractACLTestCase;
import org.apache.qpid.systest.rest.QpidRestTestCase;
import org.apache.qpid.test.utils.TestBrokerConfiguration;
@@ -233,7 +232,7 @@ public class ExchangeRestACLTest extends
String bindingName = getTestName();
int responseCode = createBinding(bindingName);
- assertEquals("Binding creation should be allowed", 201, responseCode);
+ assertEquals("Binding creation should be allowed", 200, responseCode);
assertBindingExists(bindingName);
}
@@ -276,11 +275,10 @@ public class ExchangeRestACLTest extends
private int createBinding(String bindingName) throws IOException
{
Map<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(Binding.NAME, bindingName);
- attributes.put(Binding.QUEUE, _queueName);
- attributes.put(Binding.EXCHANGE, "amq.direct");
+ attributes.put("bindingKey", bindingName);
+ attributes.put("destination", _queueName);
- int responseCode = getRestTestHelper().submitRequest("binding/test/test/amq.direct/" + _queueName + "/" + bindingName, "PUT", attributes);
+ int responseCode = getRestTestHelper().submitRequest("exchange/test/test/amq.direct/bind", "POST", attributes);
return responseCode;
}
@@ -296,7 +294,23 @@ public class ExchangeRestACLTest extends
private void assertBindingExistence(String bindingName, boolean exists) throws Exception
{
- String path = "binding/test/test/amq.direct/" + _queueName + "/" + bindingName;
- getRestTestHelper().submitRequest(path, "GET", exists ? HttpServletResponse.SC_OK : HttpServletResponse.SC_NOT_FOUND);
+ String path = "exchange/test/test/amq.direct";
+
+ final Map<String, Object> exch = getRestTestHelper().getJsonAsSingletonList(path);
+ final Collection<Map<String, Object>> bindings = (Collection<Map<String, Object>>) exch.get("bindings");
+ boolean found = false;
+ if (bindings != null)
+ {
+ for(Map<String, Object> binding : bindings)
+ {
+ if (bindingName.equals(binding.get("bindingKey")))
+ {
+ found = true;
+ break;
+ }
+ }
+ }
+
+ assertEquals(exists, found);
}
}
Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java?rev=1775689&r1=1775688&r2=1775689&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java Thu Dec 22 17:59:46 2016
@@ -207,16 +207,8 @@ public class DynamicQueueExchangeCreateT
// binding to be deleted. This will trigger the auto deleted exchange to be removed too
consumer.close();
- // Temporarily workaround the fact that exchange deletion is not completely atomic
- // in the Apache Qpid Broker for Java.
- long timeout = System.currentTimeMillis() + 10000;
- boolean exchangeExists = true;
- while (timeout > System.currentTimeMillis() && exchangeExists)
- {
- exchangeExists = exchangeExists(exchangeName);
- }
assertFalse("Exchange " + exchangeName + " should no longer exist",
- exchangeExists);
+ exchangeExists(exchangeName));
}
private void checkExceptionErrorCode(JMSException original, int code)
Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/message/UTF8Test.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/message/UTF8Test.java?rev=1775689&r1=1775688&r2=1775689&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/message/UTF8Test.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/message/UTF8Test.java Thu Dec 22 17:59:46 2016
@@ -116,7 +116,7 @@ public class UTF8Test extends QpidBroker
props.setProperty("topic.sendDest", exch +"/" + routkey);
createEntityUsingAmqpManagement(exch, session, "org.apache.qpid.DirectExchange");
final Map<String, Object> arguments = new HashMap<>();
- arguments.put("queue",qname);
+ arguments.put("destination",qname);
arguments.put("bindingKey", routkey);
performOperationUsingAmqpManagement(exch, "bind", session, "org.apache.qpid.DirectExchange", arguments);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org