1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Expose InterruptedException

SMACK-632
This commit is contained in:
Florian Schmaus 2015-02-14 09:43:44 +01:00
parent 43b99a2a85
commit bc61527bd2
124 changed files with 977 additions and 597 deletions

View file

@ -198,7 +198,7 @@ public class DummyConnection extends AbstractXMPPConnection {
dummyConnection.connect();
dummyConnection.login();
}
catch (SmackException | IOException | XMPPException e) {
catch (InterruptedException | SmackException | IOException | XMPPException e) {
throw new IllegalStateException(e);
}
return dummyConnection;

View file

@ -27,7 +27,7 @@ public class PacketCollectorTest
{
@Test
public void verifyRollover()
public void verifyRollover() throws InterruptedException
{
TestPacketCollector collector = new TestPacketCollector(null, new OKEverything(), 5);
@ -92,13 +92,9 @@ public class PacketCollectorTest
// System.out.println(Thread.currentThread().getName() + " packet: " + packet);
}
}
catch (RuntimeException re)
{
if (re.getCause() instanceof InterruptedException)
{
// System.out.println(Thread.currentThread().getName() + " has been interupted");
}
}
catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
});
consumer1.setName("consumer 1");
@ -119,7 +115,12 @@ public class PacketCollectorTest
catch (InterruptedException e)
{
}
p = collector.nextResult(1);
try {
p = collector.nextResult(1);
}
catch (InterruptedException e) {
throw new RuntimeException(e);
}
// System.out.println(Thread.currentThread().getName() + " packet: " + p);
}
while (p != null);

View file

@ -38,7 +38,7 @@ public class ThreadedDummyConnection extends DummyConnection {
private volatile boolean timeout = false;
@Override
public void sendPacket(Stanza packet) throws NotConnectedException {
public void sendPacket(Stanza packet) throws NotConnectedException, InterruptedException {
super.sendPacket(packet);
if (packet instanceof IQ && !timeout) {
@ -102,7 +102,7 @@ public class ThreadedDummyConnection extends DummyConnection {
}
}
public static ThreadedDummyConnection newInstance() throws SmackException, IOException, XMPPException {
public static ThreadedDummyConnection newInstance() throws SmackException, IOException, XMPPException, InterruptedException {
ThreadedDummyConnection threadedDummyConnection = new ThreadedDummyConnection();
threadedDummyConnection.connect();
return threadedDummyConnection;

View file

@ -35,7 +35,7 @@ public class DigestMd5SaslTest extends AbstractSaslTest {
super(saslMechanism);
}
protected void runTest() throws NotConnectedException, SmackException {
protected void runTest() throws NotConnectedException, SmackException, InterruptedException {
saslMechanism.authenticate("florian", "irrelevant", "xmpp.org", "secret");
byte[] response = saslMechanism.evaluateChallenge(challengeBytes);