Smack/smack-core/src/test/java/org/jivesoftware/smack
Florian Schmaus bfc14227ca Propagate stream errors on connect/login to the caller
Before this, if there was a stream error response by the server to our
stream open, that error response would only be handled in the reader
thread, and the user would get a message like:

"org.jivesoftware.smack.SmackException$NoResponseException: No
response received within reply timeout. Timeout was
5000ms (~5s). While waiting for SASL mechanisms stream feature from
server"

while the server may actually sent something like

<stream:stream
  xmlns='jabber:client'
  xmlns:stream='http://etherx.jabber.org/streams'
  id='6785787028201586334'
  from='jabbim.com'
  version='1.0'
  xml:lang='en'>
  <stream:error>
    <policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
	</policy-violation>
	<text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
	  Too many (2) failed authentications from this IP
      address (1xx.66.xx.xxx). The address will be unblocked at 04:24:00
      06.01.2017 UTC
    </text>
  </stream:error>
</stream:stream>

It was necessary to change saslFeatureReceived from SmackException to
XMPPException in order to return the StreamErrorException at this sync
point. But this change in return required the introduction of a
tlsHandled sync point for SmackException (which just acts as a wrapper
for the various exception types that could occurn when establishing
TLS). The tlsHandled sync point is marked successful even if no TLS
was established in case none was required and/or if not supported by
the server.
2017-01-07 10:38:41 +01:00
..
filter Use Message in FromMatchesFilterTest 2016-05-25 22:58:34 +02:00
packet Add Message.toString() providing a short description 2016-05-25 22:58:34 +02:00
parsing Add StandardExtensionElement 2015-10-19 08:21:42 +02:00
provider Remove package-info.java from test packages 2015-04-05 10:48:00 +02:00
sasl Ads support for SCRAM-SHA-1-PLUS 2016-11-20 19:34:17 +01:00
test/util s/processPacket/processStanza/ s/PacketCollector/StanzaCollector/ 2017-01-03 11:35:04 +01:00
util Throw exception if stanza child contains text 2016-11-15 22:41:24 +01:00
DummyConnection.java Propagate stream errors on connect/login to the caller 2017-01-07 10:38:41 +01:00
SmackConfigurationTest.java Add checkstyle check for trailing whitespace 2015-03-18 21:01:49 +01:00
SmackExceptionTest.java Add support for DNSSEC/DANE 2016-10-31 10:45:38 +01:00
StanzaCollectorTest.java s/processPacket/processStanza/ s/PacketCollector/StanzaCollector/ 2017-01-03 11:35:04 +01:00
StanzaIdTest.java Rename 'Packet' class to 'Stanza' 2015-02-06 09:34:51 +01:00
ThreadedDummyConnection.java Rename processPacket to processStanza 2015-06-05 14:04:17 +02:00