You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2017/01/30 16:52:11 UTC
qpid-proton-j git commit: PROTON-1385: remove various non-relevent
tests and associated stale/skipping stub code
Repository: qpid-proton-j
Updated Branches:
refs/heads/master 6961ea089 -> afab5fed2
PROTON-1385: remove various non-relevent tests and associated stale/skipping stub code
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/commit/afab5fed
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/tree/afab5fed
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/diff/afab5fed
Branch: refs/heads/master
Commit: afab5fed274c532ce5a7570f1bd73c2ac842b1ca
Parents: 6961ea0
Author: Robert Gemmell <ro...@apache.org>
Authored: Mon Jan 30 16:51:26 2017 +0000
Committer: Robert Gemmell <ro...@apache.org>
Committed: Mon Jan 30 16:51:26 2017 +0000
----------------------------------------------------------------------
.../java/org/apache/qpid/proton/codec/Data.java | 18 ---
.../apache/qpid/proton/codec/impl/DataImpl.java | 60 +-------
tests/java/shim/cengine.py | 2 -
tests/python/proton_tests/codec.py | 55 --------
tests/python/proton_tests/common.py | 1 +
tests/python/proton_tests/engine.py | 102 --------------
tests/python/proton_tests/reactor.py | 141 -------------------
7 files changed, 2 insertions(+), 377 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/afab5fed/proton-j/src/main/java/org/apache/qpid/proton/codec/Data.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/codec/Data.java b/proton-j/src/main/java/org/apache/qpid/proton/codec/Data.java
index 9d9fd94..c3fc1e5 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/codec/Data.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/codec/Data.java
@@ -20,7 +20,6 @@
*/
package org.apache.qpid.proton.codec;
-import java.math.BigDecimal;
import java.nio.ByteBuffer;
import java.util.Date;
import java.util.List;
@@ -81,8 +80,6 @@ public interface Data
}
void free();
-// int errno();
-// String error();
void clear();
long size();
@@ -91,12 +88,9 @@ public interface Data
DataType prev();
boolean enter();
boolean exit();
- boolean lookup(String name);
DataType type();
-// int print();
-// int format(ByteBuffer buf);
Binary encode();
long encodedSize();
long encode(ByteBuffer buf);
@@ -131,7 +125,6 @@ public interface Data
void putObject(Object o);
void putJavaMap(Map<Object, Object> map);
void putJavaList(List<Object> list);
- void putJavaArray(Object[] array);
void putDescribedType(DescribedType dt);
long getList();
@@ -166,17 +159,6 @@ public interface Data
List<Object> getJavaList();
Object[] getJavaArray();
DescribedType getDescribedType();
- //pnAtomT getAtom();
-
- void copy(Data src);
- void append(Data src);
- void appendn(Data src, int limit);
- void narrow();
- void widen();
String format();
-
- // void dump();
-
-
}
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/afab5fed/proton-j/src/main/java/org/apache/qpid/proton/codec/impl/DataImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/codec/impl/DataImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/codec/impl/DataImpl.java
index 5f430ba..5c39729 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/codec/impl/DataImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/codec/impl/DataImpl.java
@@ -24,7 +24,6 @@ package org.apache.qpid.proton.codec.impl;
import java.nio.ByteBuffer;
import java.util.*;
-import org.apache.qpid.proton.ProtonUnsupportedOperationException;
import org.apache.qpid.proton.amqp.*;
import org.apache.qpid.proton.codec.Data;
@@ -119,14 +118,6 @@ public class DataImpl implements Data
}
@Override
- public boolean lookup(String name)
- {
- // TODO
- throw new ProtonUnsupportedOperationException();
-
- }
-
- @Override
public DataType type()
{
return _current == null ? null : _current.getDataType();
@@ -476,7 +467,7 @@ public class DataImpl implements Data
}
else if(o instanceof Object[])
{
- putJavaArray((Object[]) o);
+ throw new IllegalArgumentException("Unsupported array type");
}
else if(o instanceof List)
{
@@ -519,13 +510,6 @@ public class DataImpl implements Data
}
@Override
- public void putJavaArray(Object[] array)
- {
- // TODO
- throw new ProtonUnsupportedOperationException();
- }
-
- @Override
public void putDescribedType(DescribedType dt)
{
putElement(new DescribedTypeElement(_parent,_current));
@@ -845,47 +829,6 @@ public class DataImpl implements Data
}
@Override
- public void copy(Data src)
- {
- // TODO
-
- throw new ProtonUnsupportedOperationException();
- }
-
- @Override
- public void append(Data src)
- {
- // TODO
-
- throw new ProtonUnsupportedOperationException();
- }
-
- @Override
- public void appendn(Data src, int limit)
- {
- // TODO
-
- throw new ProtonUnsupportedOperationException();
- }
-
- @Override
- public void narrow()
- {
- // TODO
-
- throw new ProtonUnsupportedOperationException();
- }
-
- @Override
- public void widen()
- {
- // TODO
-
- throw new ProtonUnsupportedOperationException();
- }
-
-
- @Override
public String format()
{
StringBuilder sb = new StringBuilder();
@@ -924,5 +867,4 @@ public class DataImpl implements Data
System.identityHashCode(_parent),
sb);
}
-
}
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/afab5fed/tests/java/shim/cengine.py
----------------------------------------------------------------------
diff --git a/tests/java/shim/cengine.py b/tests/java/shim/cengine.py
index 141c482..7afee6b 100644
--- a/tests/java/shim/cengine.py
+++ b/tests/java/shim/cengine.py
@@ -748,8 +748,6 @@ class pn_disposition:
self.data.rewind()
def encode(self):
- if self.type not in DISPOSITIONS:
- raise Skipped()
impl = DISPOSITIONS[self.type]()
if impl is None:
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/afab5fed/tests/python/proton_tests/codec.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/codec.py b/tests/python/proton_tests/codec.py
index 4d3d906..0be9d54 100644
--- a/tests/python/proton_tests/codec.py
+++ b/tests/python/proton_tests/codec.py
@@ -305,41 +305,6 @@ class DataTest(Test):
def testDecimal128(self):
self._test("decimal128", decimal128(str2bin("fdsaasdf;lkjjkl;")), decimal128(str2bin("x"*16)))
- def testCopy(self):
- self.data.put_described()
- self.data.enter()
- self.data.put_ulong(123)
- self.data.put_map()
- self.data.enter()
- self.data.put_string("pi")
- self.data.put_double(3.14159265359)
-
- dst = Data()
- dst.copy(self.data)
-
- copy = dst.format()
- orig = self.data.format()
- assert copy == orig, (copy, orig)
-
- def testCopyNested(self):
- nested = [1, 2, 3, [4, 5, 6], 7, 8, 9]
- self.data.put_object(nested)
- dst = Data()
- dst.copy(self.data)
- assert dst.format() == self.data.format()
-
- def testCopyNestedArray(self):
- nested = [Array(UNDESCRIBED, Data.LIST,
- ["first", [Array(UNDESCRIBED, Data.INT, 1,2,3)]],
- ["second", [Array(UNDESCRIBED, Data.INT, 1,2,3)]],
- ["third", [Array(UNDESCRIBED, Data.INT, 1,2,3)]],
- ),
- "end"]
- self.data.put_object(nested)
- dst = Data()
- dst.copy(self.data)
- assert dst.format() == self.data.format()
-
def testRoundTrip(self):
obj = {symbol("key"): timestamp(1234),
ulong(123): "blah",
@@ -377,23 +342,3 @@ class DataTest(Test):
assert data.type() == Data.BINARY
assert data.get_object() == "foo"
- def testLookup(self):
- obj = {symbol("key"): str2unicode("value"),
- symbol("pi"): 3.14159,
- symbol("list"): [1, 2, 3, 4]}
- self.data.put_object(obj)
- self.data.rewind()
- self.data.next()
- self.data.enter()
- self.data.narrow()
- assert self.data.lookup("pi")
- assert self.data.get_object() == 3.14159
- self.data.rewind()
- assert self.data.lookup("key")
- assert self.data.get_object() == str2unicode("value")
- self.data.rewind()
- assert self.data.lookup("list")
- assert self.data.get_object() == [1, 2, 3, 4]
- self.data.widen()
- self.data.rewind()
- assert not self.data.lookup("pi")
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/afab5fed/tests/python/proton_tests/common.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/common.py b/tests/python/proton_tests/common.py
index 02de4ff..4c1adf1 100644
--- a/tests/python/proton_tests/common.py
+++ b/tests/python/proton_tests/common.py
@@ -162,6 +162,7 @@ mech_list: EXTERNAL DIGEST-MD5 SCRAM-SHA-1 CRAM-MD5 PLAIN ANONYMOUS
if SASL.extended():
_cyrusSetup('sasl_conf')
+# TODO: remove all tests that reference this
def ensureCanTestExtendedSASL():
if not SASL.extended():
raise Skipped('Extended SASL not supported')
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/afab5fed/tests/python/proton_tests/engine.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/engine.py b/tests/python/proton_tests/engine.py
index 497bb7d..dd38dc9 100644
--- a/tests/python/proton_tests/engine.py
+++ b/tests/python/proton_tests/engine.py
@@ -307,24 +307,6 @@ class ConnectionTest(Test):
pump(t1, t2)
assert c2.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED
- def test_user_config(self):
- if "java" in sys.platform:
- raise Skipped("Unsupported API")
-
- self.c1.user = "vindaloo"
- self.c1.password = "secret"
- self.c1.open()
- self.pump()
-
- self.c2.user = "leela"
- self.c2.password = "trustno1"
- self.c2.open()
- self.pump()
-
- assert self.c1.user == "vindaloo", self.c1.user
- assert self.c1.password == None, self.c1.password
- assert self.c2.user == "leela", self.c2.user
- assert self.c2.password == None, self.c2.password
class SessionTest(Test):
@@ -2265,8 +2247,6 @@ class DeliveryTest(Test):
value=ModifiedValue(failed=True, undeliverable=True,
annotations={"key": "value"}))
- def testCustom(self):
- self.testDisposition(type=0x12345, value=CustomValue([1, 2, 3]))
class CollectorTest(Test):
@@ -2648,85 +2628,3 @@ class DeliverySegFaultTest(Test):
t.bind(conn)
t.unbind()
dlv = snd.delivery("tag")
-
-class SaslEventTest(CollectorTest):
-
- def testAnonymousNoInitialResponse(self):
- if "java" in sys.platform:
- raise Skipped()
- conn = Connection()
- conn.collect(self.collector)
- transport = Transport(Transport.SERVER)
- transport.bind(conn)
- self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND)
-
- transport.push(str2bin('AMQP\x03\x01\x00\x00\x00\x00\x00 \x02\x01\x00\x00\x00SA'
- '\xd0\x00\x00\x00\x10\x00\x00\x00\x02\xa3\tANONYMOUS@'
- 'AMQP\x00\x01\x00\x00'))
- self.expect(Event.TRANSPORT)
- for i in range(1024):
- p = transport.pending()
- self.drain()
- p = transport.pending()
- self.expect()
-
- def testPipelinedServerReadFirst(self):
- if "java" in sys.platform:
- raise Skipped()
- conn = Connection()
- conn.collect(self.collector)
- transport = Transport(Transport.CLIENT)
- s = transport.sasl()
- s.allowed_mechs("ANONYMOUS PLAIN")
- transport.bind(conn)
- self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND)
- transport.push(str2bin(
- # SASL
- 'AMQP\x03\x01\x00\x00'
- # @sasl-mechanisms(64) [sasl-server-mechanisms=@PN_SYMBOL[:ANONYMOUS]]
- '\x00\x00\x00\x1c\x02\x01\x00\x00\x00S@\xc0\x0f\x01\xe0\x0c\x01\xa3\tANONYMOUS'
- # @sasl-outcome(68) [code=0]
- '\x00\x00\x00\x10\x02\x01\x00\x00\x00SD\xc0\x03\x01P\x00'
- # AMQP
- 'AMQP\x00\x01\x00\x00'
- ))
- self.expect(Event.TRANSPORT)
- p = transport.pending()
- bytes = transport.peek(p)
- transport.pop(p)
-
- server = Transport(Transport.SERVER)
- server.push(bytes)
- assert s.outcome == SASL.OK
- assert server.sasl().outcome == SASL.OK
-
- def testPipelinedServerWriteFirst(self):
- if "java" in sys.platform:
- raise Skipped()
- conn = Connection()
- conn.collect(self.collector)
- transport = Transport(Transport.CLIENT)
- s = transport.sasl()
- s.allowed_mechs("ANONYMOUS")
- transport.bind(conn)
- p = transport.pending()
- bytes = transport.peek(p)
- transport.pop(p)
- self.expect(Event.CONNECTION_INIT, Event.CONNECTION_BOUND)
- transport.push(str2bin(
- # SASL
- 'AMQP\x03\x01\x00\x00'
- # @sasl-mechanisms(64) [sasl-server-mechanisms=@PN_SYMBOL[:ANONYMOUS]]
- '\x00\x00\x00\x1c\x02\x01\x00\x00\x00S@\xc0\x0f\x01\xe0\x0c\x01\xa3\tANONYMOUS'
- # @sasl-outcome(68) [code=0]
- '\x00\x00\x00\x10\x02\x01\x00\x00\x00SD\xc0\x03\x01P\x00'
- # AMQP
- 'AMQP\x00\x01\x00\x00'
- ))
- self.expect(Event.TRANSPORT)
- p = transport.pending()
- bytes = transport.peek(p)
- transport.pop(p)
- assert s.outcome == SASL.OK
- # XXX: the bytes above appear to be correct, but we don't get any
- # sort of event indicating that the transport is authenticated
http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/afab5fed/tests/python/proton_tests/reactor.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/reactor.py b/tests/python/proton_tests/reactor.py
index a25dc2f..39935f7 100644
--- a/tests/python/proton_tests/reactor.py
+++ b/tests/python/proton_tests/reactor.py
@@ -484,144 +484,3 @@ class AuthenticationTestHandler(MessagingHandler):
def on_connection_error(self, event):
event.connection.close()
self.listener.close()
-
-class ContainerTest(Test):
- """Test container subclass of reactor."""
-
- def test_event_has_container_attribute(self):
- ensureCanTestExtendedSASL()
- class TestHandler(MessagingHandler):
- def __init__(self):
- super(TestHandler, self).__init__()
- port = free_tcp_port()
- self.url = "localhost:%i" % port
-
- def on_start(self, event):
- self.listener = event.container.listen(self.url)
-
- def on_connection_closing(self, event):
- event.connection.close()
- self.listener.close()
- test_handler = TestHandler()
- container = Container(test_handler)
- class ConnectionHandler(MessagingHandler):
- def __init__(self):
- super(ConnectionHandler, self).__init__()
-
- def on_connection_opened(self, event):
- event.connection.close()
- assert event.container == event.reactor
- assert event.container == container
- container.connect(test_handler.url, handler=ConnectionHandler())
- container.run()
-
- def test_authentication_via_url(self):
- ensureCanTestExtendedSASL()
- test_handler = AuthenticationTestHandler()
- container = Container(test_handler)
- container.connect("%s:password@%s" % ("user%40proton", test_handler.url), reconnect=False)
- container.run()
- assert test_handler.verified
-
- def test_authentication_via_container_attributes(self):
- ensureCanTestExtendedSASL()
- test_handler = AuthenticationTestHandler()
- container = Container(test_handler)
- container.user = "user@proton"
- container.password = "password"
- container.connect(test_handler.url, reconnect=False)
- container.run()
- assert test_handler.verified
-
- def test_authentication_via_kwargs(self):
- ensureCanTestExtendedSASL()
- test_handler = AuthenticationTestHandler()
- container = Container(test_handler)
- container.connect(test_handler.url, user="user@proton", password="password", reconnect=False)
- container.run()
- assert test_handler.verified
-
- class _ServerHandler(MessagingHandler):
- def __init__(self, host):
- super(ContainerTest._ServerHandler, self).__init__()
- self.host = host
- port = free_tcp_port()
- self.port = free_tcp_port()
- self.client_addr = None
- self.peer_hostname = None
-
- def on_start(self, event):
- self.listener = event.container.listen("%s:%s" % (self.host, self.port))
-
- def on_connection_opened(self, event):
- self.client_addr = event.reactor.get_connection_address(event.connection)
- self.peer_hostname = event.connection.remote_hostname
-
- def on_connection_closing(self, event):
- event.connection.close()
- self.listener.close()
-
- class _ClientHandler(MessagingHandler):
- def __init__(self):
- super(ContainerTest._ClientHandler, self).__init__()
- self.server_addr = None
-
- def on_connection_opened(self, event):
- self.server_addr = event.reactor.get_connection_address(event.connection)
- event.connection.close()
-
- def test_numeric_hostname(self):
- ensureCanTestExtendedSASL()
- server_handler = ContainerTest._ServerHandler("127.0.0.1")
- client_handler = ContainerTest._ClientHandler()
- container = Container(server_handler)
- container.connect(url=Url(host="127.0.0.1",
- port=server_handler.port),
- handler=client_handler)
- container.run()
- assert server_handler.client_addr
- assert client_handler.server_addr
- assert server_handler.peer_hostname == "127.0.0.1", server_handler.peer_hostname
- assert client_handler.server_addr.rsplit(':', 1)[1] == str(server_handler.port)
-
- def test_non_numeric_hostname(self):
- ensureCanTestExtendedSASL()
- server_handler = ContainerTest._ServerHandler("localhost")
- client_handler = ContainerTest._ClientHandler()
- container = Container(server_handler)
- container.connect(url=Url(host="localhost",
- port=server_handler.port),
- handler=client_handler)
- container.run()
- assert server_handler.client_addr
- assert client_handler.server_addr
- assert server_handler.peer_hostname == "localhost", server_handler.peer_hostname
- assert client_handler.server_addr.rsplit(':', 1)[1] == str(server_handler.port)
-
- def test_virtual_host(self):
- ensureCanTestExtendedSASL()
- server_handler = ContainerTest._ServerHandler("localhost")
- container = Container(server_handler)
- conn = container.connect(url=Url(host="localhost",
- port=server_handler.port),
- handler=ContainerTest._ClientHandler(),
- virtual_host="a.b.c.org")
- container.run()
- assert server_handler.peer_hostname == "a.b.c.org", server_handler.peer_hostname
-
- def test_no_virtual_host(self):
- # explicitly setting an empty virtual host should prevent the hostname
- # field from being sent in the Open performative
- if "java" in sys.platform:
- # This causes Python Container to *not* set the connection virtual
- # host, so when proton-j sets up the connection the virtual host
- # seems to be unset and the URL's host is used (as expected).
- raise SkipTest("Does not apply for proton-j");
- server_handler = ContainerTest._ServerHandler("localhost")
- container = Container(server_handler)
- conn = container.connect(url=Url(host="localhost",
- port=server_handler.port),
- handler=ContainerTest._ClientHandler(),
- virtual_host="")
- container.run()
- assert server_handler.peer_hostname is None, server_handler.peer_hostname
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org