1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-12 05:51:08 +01:00

Change IQ.Type to enum

This commit is contained in:
Júlio Cesar Bueno Cotta 2014-06-05 21:20:45 -03:00
parent 944ac37fc3
commit 9be0c480e3
90 changed files with 284 additions and 299 deletions

View file

@ -73,7 +73,7 @@ public class CloseListenerTest {
// assert that reply is the correct error packet
assertEquals(initiatorJID, argument.getValue().getTo());
assertEquals(IQ.Type.ERROR, argument.getValue().getType());
assertEquals(IQ.Type.error, argument.getValue().getType());
assertEquals(XMPPError.Condition.item_not_found.toString(),
argument.getValue().getError().getCondition());

View file

@ -75,7 +75,7 @@ public class DataListenerTest {
// assert that reply is the correct error packet
assertEquals(initiatorJID, argument.getValue().getTo());
assertEquals(IQ.Type.ERROR, argument.getValue().getType());
assertEquals(IQ.Type.error, argument.getValue().getType());
assertEquals(XMPPError.Condition.item_not_found.toString(),
argument.getValue().getError().getCondition());

View file

@ -42,7 +42,7 @@ public class IBBPacketUtils {
}
};
errorIQ.setType(IQ.Type.ERROR);
errorIQ.setType(IQ.Type.error);
errorIQ.setFrom(from);
errorIQ.setTo(to);
errorIQ.setError(xmppError);
@ -64,7 +64,7 @@ public class IBBPacketUtils {
}
};
result.setType(IQ.Type.RESULT);
result.setType(IQ.Type.result);
result.setFrom(from);
result.setTo(to);
return result;

View file

@ -83,7 +83,7 @@ public class InBandBytestreamRequestTest {
// assert that reply is the correct error packet
assertEquals(initiatorJID, argument.getValue().getTo());
assertEquals(IQ.Type.ERROR, argument.getValue().getType());
assertEquals(IQ.Type.error, argument.getValue().getType());
assertEquals(XMPPError.Condition.no_acceptable.toString(),
argument.getValue().getError().getCondition());
@ -108,7 +108,7 @@ public class InBandBytestreamRequestTest {
// assert that reply is the correct acknowledgment packet
assertEquals(initiatorJID, argument.getValue().getTo());
assertEquals(IQ.Type.RESULT, argument.getValue().getType());
assertEquals(IQ.Type.result, argument.getValue().getType());
assertNotNull(session);
assertNotNull(session.getInputStream());

View file

@ -91,7 +91,7 @@ public class InitiationListenerTest {
// assert that reply is the correct error packet
assertEquals(initiatorJID, argument.getValue().getTo());
assertEquals(IQ.Type.ERROR, argument.getValue().getType());
assertEquals(IQ.Type.error, argument.getValue().getType());
assertEquals(XMPPError.Condition.no_acceptable.toString(),
argument.getValue().getError().getCondition());
@ -119,7 +119,7 @@ public class InitiationListenerTest {
// assert that reply is the correct error packet
assertEquals(initiatorJID, argument.getValue().getTo());
assertEquals(IQ.Type.ERROR, argument.getValue().getType());
assertEquals(IQ.Type.error, argument.getValue().getType());
assertEquals(XMPPError.Condition.resource_constraint.toString(),
argument.getValue().getError().getCondition());
@ -209,7 +209,7 @@ public class InitiationListenerTest {
// assert that reply is the correct error packet
assertEquals(initiatorJID, argument.getValue().getTo());
assertEquals(IQ.Type.ERROR, argument.getValue().getType());
assertEquals(IQ.Type.error, argument.getValue().getType());
assertEquals(XMPPError.Condition.no_acceptable.toString(),
argument.getValue().getError().getCondition());
}

View file

@ -48,7 +48,7 @@ public class CloseTest {
@Test
public void shouldBeOfIQTypeSET() {
Close close = new Close("sessionID");
assertEquals(IQ.Type.SET, close.getType());
assertEquals(IQ.Type.set, close.getType());
}
@Test

View file

@ -47,7 +47,7 @@ public class DataTest {
public void shouldBeOfIQTypeSET() {
DataPacketExtension dpe = mock(DataPacketExtension.class);
Data data = new Data(dpe);
assertEquals(IQ.Type.SET, data.getType());
assertEquals(IQ.Type.set, data.getType());
}
private static Properties outputProperties = new Properties();

View file

@ -65,7 +65,7 @@ public class OpenTest {
@Test
public void shouldBeOfIQTypeSET() {
Open open = new Open("sessionID", 4096);
assertEquals(IQ.Type.SET, open.getType());
assertEquals(IQ.Type.set, open.getType());
}
@Test

View file

@ -98,7 +98,7 @@ public class InitiationListenerTest {
// assert that reply is the correct error packet
assertEquals(initiatorJID, argument.getValue().getTo());
assertEquals(IQ.Type.ERROR, argument.getValue().getType());
assertEquals(IQ.Type.error, argument.getValue().getType());
assertEquals(XMPPError.Condition.no_acceptable.toString(),
argument.getValue().getError().getCondition());
@ -188,7 +188,7 @@ public class InitiationListenerTest {
// assert that reply is the correct error packet
assertEquals(initiatorJID, argument.getValue().getTo());
assertEquals(IQ.Type.ERROR, argument.getValue().getType());
assertEquals(IQ.Type.error, argument.getValue().getType());
assertEquals(XMPPError.Condition.no_acceptable.toString(),
argument.getValue().getError().getCondition());
}

View file

@ -432,7 +432,7 @@ public class Socks5ByteStreamManagerTest {
}
};
rejectPacket.setType(Type.ERROR);
rejectPacket.setType(Type.error);
rejectPacket.setFrom(targetJID);
rejectPacket.setTo(initiatorJID);
rejectPacket.setError(xmppError);

View file

@ -111,7 +111,7 @@ public class Socks5ByteStreamRequestTest {
Packet targetResponse = protocol.getRequests().remove(0);
assertTrue(IQ.class.isInstance(targetResponse));
assertEquals(initiatorJID, targetResponse.getTo());
assertEquals(IQ.Type.ERROR, ((IQ) targetResponse).getType());
assertEquals(IQ.Type.error, ((IQ) targetResponse).getType());
assertEquals(XMPPError.Condition.item_not_found.toString(),
((IQ) targetResponse).getError().getCondition());
@ -155,7 +155,7 @@ public class Socks5ByteStreamRequestTest {
Packet targetResponse = protocol.getRequests().remove(0);
assertTrue(IQ.class.isInstance(targetResponse));
assertEquals(initiatorJID, targetResponse.getTo());
assertEquals(IQ.Type.ERROR, ((IQ) targetResponse).getType());
assertEquals(IQ.Type.error, ((IQ) targetResponse).getType());
assertEquals(XMPPError.Condition.item_not_found.toString(),
((IQ) targetResponse).getError().getCondition());
@ -203,7 +203,7 @@ public class Socks5ByteStreamRequestTest {
Packet targetResponse = protocol.getRequests().remove(0);
assertTrue(IQ.class.isInstance(targetResponse));
assertEquals(initiatorJID, targetResponse.getTo());
assertEquals(IQ.Type.ERROR, ((IQ) targetResponse).getType());
assertEquals(IQ.Type.error, ((IQ) targetResponse).getType());
assertEquals(XMPPError.Condition.item_not_found.toString(),
((IQ) targetResponse).getError().getCondition());
}
@ -245,7 +245,7 @@ public class Socks5ByteStreamRequestTest {
Packet targetResponse = protocol.getRequests().remove(0);
assertEquals(Bytestream.class, targetResponse.getClass());
assertEquals(initiatorJID, targetResponse.getTo());
assertEquals(IQ.Type.RESULT, ((Bytestream) targetResponse).getType());
assertEquals(IQ.Type.result, ((Bytestream) targetResponse).getType());
assertEquals(proxyJID, ((Bytestream) targetResponse).getUsedHost().getJID());
}
@ -295,7 +295,7 @@ public class Socks5ByteStreamRequestTest {
Packet targetResponse = protocol.getRequests().remove(0);
assertTrue(IQ.class.isInstance(targetResponse));
assertEquals(initiatorJID, targetResponse.getTo());
assertEquals(IQ.Type.ERROR, ((IQ) targetResponse).getType());
assertEquals(IQ.Type.error, ((IQ) targetResponse).getType());
assertEquals(XMPPError.Condition.item_not_found.toString(),
((IQ) targetResponse).getError().getCondition());
}
@ -365,7 +365,7 @@ public class Socks5ByteStreamRequestTest {
Packet targetResponse = protocol.getRequests().remove(0);
assertEquals(Bytestream.class, targetResponse.getClass());
assertEquals(initiatorJID, targetResponse.getTo());
assertEquals(IQ.Type.RESULT, ((Bytestream) targetResponse).getType());
assertEquals(IQ.Type.result, ((Bytestream) targetResponse).getType());
assertEquals(proxyJID, ((Bytestream) targetResponse).getUsedHost().getJID());
serverSocket.close();
@ -418,7 +418,7 @@ public class Socks5ByteStreamRequestTest {
Packet targetResponse = protocol.getRequests().remove(0);
assertEquals(Bytestream.class, targetResponse.getClass());
assertEquals(initiatorJID, targetResponse.getTo());
assertEquals(IQ.Type.RESULT, ((Bytestream) targetResponse).getType());
assertEquals(IQ.Type.result, ((Bytestream) targetResponse).getType());
assertEquals(proxyJID, ((Bytestream) targetResponse).getUsedHost().getJID());
}

View file

@ -204,7 +204,7 @@ public class Socks5ClientForInitiatorTest {
}
};
error.setType(Type.ERROR);
error.setType(Type.error);
error.setFrom(proxyJID);
error.setTo(initiatorJID);
error.setError(xmppError);
@ -259,7 +259,7 @@ public class Socks5ClientForInitiatorTest {
};
activationResponse.setFrom(proxyJID);
activationResponse.setTo(initiatorJID);
activationResponse.setType(IQ.Type.RESULT);
activationResponse.setType(IQ.Type.result);
protocol.addResponse(activationResponse, Verification.correspondingSenderReceiver,
Verification.requestTypeSET, new Verification<Bytestream, IQ>() {

View file

@ -43,7 +43,7 @@ public class Socks5PacketUtils {
bytestream.setFrom(from);
bytestream.setTo(to);
bytestream.setSessionID(sessionID);
bytestream.setType(IQ.Type.SET);
bytestream.setType(IQ.Type.set);
return bytestream;
}
@ -60,7 +60,7 @@ public class Socks5PacketUtils {
streamHostInfo.getPacketID();
streamHostInfo.setFrom(from);
streamHostInfo.setTo(to);
streamHostInfo.setType(IQ.Type.RESULT);
streamHostInfo.setType(IQ.Type.result);
return streamHostInfo;
}
@ -76,7 +76,7 @@ public class Socks5PacketUtils {
discoverItems.getPacketID();
discoverItems.setFrom(from);
discoverItems.setTo(to);
discoverItems.setType(IQ.Type.RESULT);
discoverItems.setType(IQ.Type.result);
return discoverItems;
}
@ -92,7 +92,7 @@ public class Socks5PacketUtils {
discoverInfo.getPacketID();
discoverInfo.setFrom(from);
discoverInfo.setTo(to);
discoverInfo.setType(IQ.Type.RESULT);
discoverInfo.setType(IQ.Type.result);
return discoverInfo;
}
@ -115,7 +115,7 @@ public class Socks5PacketUtils {
response.getPacketID();
response.setFrom(from);
response.setTo(to);
response.setType(IQ.Type.RESULT);
response.setType(IQ.Type.result);
return response;
}