1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 18:29:45 +02: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

@ -55,7 +55,7 @@ public class CompressionTest extends SmackTestCase {
// Request the version of the server
Version version = new Version();
version.setType(IQ.Type.GET);
version.setType(IQ.Type.get);
version.setTo(getServiceName());
// Create a packet collector to listen for a response.
@ -69,7 +69,7 @@ public class CompressionTest extends SmackTestCase {
collector.cancel();
assertNotNull("No reply was received from the server", result);
assertEquals("Incorrect IQ type from server", IQ.Type.RESULT, result.getType());
assertEquals("Incorrect IQ type from server", IQ.Type.result, result.getType());
// Close connection
connection.disconnect();

View file

@ -41,7 +41,7 @@ public class VersionTest extends SmackTestCase {
*/
public void testGetServerVersion() {
Version version = new Version();
version.setType(IQ.Type.GET);
version.setType(IQ.Type.get);
version.setTo(getServiceName());
// Create a packet collector to listen for a response.
@ -56,7 +56,7 @@ public class VersionTest extends SmackTestCase {
assertNotNull("No result from the server", result);
assertEquals("Incorrect result type", IQ.Type.RESULT, result.getType());
assertEquals("Incorrect result type", IQ.Type.result, result.getType());
assertNotNull("No name specified in the result", ((Version)result).getName());
assertNotNull("No version specified in the result", ((Version)result).getVersion());
}

View file

@ -90,7 +90,7 @@ public class EntityCapsTest extends SmackTestCase {
discoInfoSend = true;
}
}, new AndFilter(new PacketTypeFilter(DiscoverInfo.class), new IQTypeFilter(IQ.Type.GET)));
}, new AndFilter(new PacketTypeFilter(DiscoverInfo.class), new IQTypeFilter(IQ.Type.get)));
// add a bogus feature so that con1 ver won't match con0's
sdm1.addFeature(DISCOVER_TEST_FEATURE);

View file

@ -484,7 +484,7 @@ public class MultiUserChatTest extends SmackTestCase {
.discoverInfo(room + "/testbot", null);
assertNotNull("No info was discovered from room occupant", info);
assertEquals("Wrong IQ type", IQ.Type.RESULT, info.getType());
assertEquals("Wrong IQ type", IQ.Type.result, info.getType());
assertEquals("Wrong IQ sender", room + "/testbot", info.getFrom());
// User2 leaves the room

View file

@ -39,7 +39,7 @@ public class Close extends IQ {
throw new IllegalArgumentException("Session ID must not be null or empty");
}
this.sessionID = sessionID;
setType(Type.SET);
setType(Type.set);
}
/**

View file

@ -45,7 +45,7 @@ public class Data extends IQ {
* retrieved from IQ stanza and message stanza in the same way
*/
addExtension(data);
setType(IQ.Type.SET);
setType(IQ.Type.set);
}
/**

View file

@ -62,7 +62,7 @@ public class Open extends IQ {
this.sessionID = sessionID;
this.blockSize = blockSize;
this.stanza = stanza;
setType(Type.SET);
setType(Type.set);
}
/**

View file

@ -640,7 +640,7 @@ public final class Socks5BytestreamManager implements BytestreamManager {
*/
private Bytestream createStreamHostRequest(String proxy) {
Bytestream request = new Bytestream();
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(proxy);
return request;
}
@ -695,7 +695,7 @@ public final class Socks5BytestreamManager implements BytestreamManager {
initiation.addStreamHost(streamHost);
}
initiation.setType(IQ.Type.SET);
initiation.setType(IQ.Type.set);
initiation.setTo(targetJID);
return initiation;

View file

@ -294,7 +294,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
private Bytestream createUsedHostResponse(StreamHost selectedHost) {
Bytestream response = new Bytestream(this.bytestreamRequest.getSessionID());
response.setTo(this.bytestreamRequest.getFrom());
response.setType(IQ.Type.RESULT);
response.setType(IQ.Type.result);
response.setPacketID(this.bytestreamRequest.getPacketID());
response.setUsedHost(selectedHost.getJID());
return response;

View file

@ -120,7 +120,7 @@ class Socks5ClientForInitiator extends Socks5Client {
private Bytestream createStreamHostActivation() {
Bytestream activate = new Bytestream(this.sessionID);
activate.setMode(null);
activate.setType(IQ.Type.SET);
activate.setType(IQ.Type.set);
activate.setTo(this.streamHost.getJID());
activate.setToActivate(this.target);

View file

@ -217,7 +217,7 @@ public class Bytestream extends IQ {
StringBuilder buf = new StringBuilder();
buf.append("<query xmlns=\"http://jabber.org/protocol/bytestreams\"");
if (this.getType().equals(IQ.Type.SET)) {
if (this.getType().equals(IQ.Type.set)) {
if (getSessionID() != null) {
buf.append(" sid=\"").append(getSessionID()).append("\"");
}
@ -234,7 +234,7 @@ public class Bytestream extends IQ {
buf.append(getToActivate().toXML());
}
}
else if (this.getType().equals(IQ.Type.RESULT)) {
else if (this.getType().equals(IQ.Type.result)) {
buf.append(">");
if (getUsedHost() != null) {
buf.append(getUsedHost().toXML());
@ -246,7 +246,7 @@ public class Bytestream extends IQ {
}
}
}
else if (this.getType().equals(IQ.Type.GET)) {
else if (this.getType().equals(IQ.Type.get)) {
return buf.append("/>").toString();
}
else {

View file

@ -435,7 +435,7 @@ public class EntityCapsManager extends Manager {
XMPPConnection connection = connection();
DiscoverInfo discoverInfo = new DiscoverInfo();
discoverInfo.setType(IQ.Type.RESULT);
discoverInfo.setType(IQ.Type.result);
discoverInfo.setNode(getLocalNodeVer());
if (connection != null)
discoverInfo.setFrom(connection.getUser());

View file

@ -332,7 +332,7 @@ public class AdHocCommandManager extends Manager {
*/
private void processAdHocCommand(AdHocCommandData requestData) throws SmackException {
// Only process requests of type SET
if (requestData.getType() != IQ.Type.SET) {
if (requestData.getType() != IQ.Type.set) {
return;
}
@ -364,7 +364,7 @@ public class AdHocCommandManager extends Manager {
// corresponding sessioid
LocalCommand command = newInstanceOfCmd(commandNode, sessionId);
response.setType(IQ.Type.RESULT);
response.setType(IQ.Type.result);
command.setData(response);
// Check that the requester has enough permission.
@ -530,7 +530,7 @@ public class AdHocCommandManager extends Manager {
// Since all errors were passed, the response is now a
// result
response.setType(IQ.Type.RESULT);
response.setType(IQ.Type.result);
// Set the new data to the command.
command.setData(response);
@ -623,7 +623,7 @@ public class AdHocCommandManager extends Manager {
* @throws NotConnectedException
*/
private void respondError(AdHocCommandData response, XMPPError error) throws NotConnectedException {
response.setType(IQ.Type.ERROR);
response.setType(IQ.Type.error);
response.setError(error);
connection().sendPacket(response);
}

View file

@ -130,7 +130,7 @@ public class RemoteCommand extends AdHocCommand {
// TODO: not throw the corresponding exeption. This will make a faster response,
// TODO: since the request is stoped before it's sent.
AdHocCommandData data = new AdHocCommandData();
data.setType(IQ.Type.SET);
data.setType(IQ.Type.set);
data.setTo(getOwnerJID());
data.setNode(getNode());
data.setSessionID(sessionID);

View file

@ -90,7 +90,7 @@ public class AdHocCommandData extends IQ {
}
buf.append(">");
if (getType() == Type.RESULT) {
if (getType() == Type.result) {
buf.append("<actions");
if (executeAction != null) {

View file

@ -120,9 +120,9 @@ public class ServiceDiscoveryManager extends Manager {
if (connection == null) return;
DiscoverItems discoverItems = (DiscoverItems) packet;
// Send back the items defined in the client if the request is of type GET
if (discoverItems != null && discoverItems.getType() == IQ.Type.GET) {
if (discoverItems != null && discoverItems.getType() == IQ.Type.get) {
DiscoverItems response = new DiscoverItems();
response.setType(IQ.Type.RESULT);
response.setType(IQ.Type.result);
response.setTo(discoverItems.getFrom());
response.setPacketID(discoverItems.getPacketID());
response.setNode(discoverItems.getNode());
@ -139,7 +139,7 @@ public class ServiceDiscoveryManager extends Manager {
} else if(discoverItems.getNode() != null) {
// Return <item-not-found/> error since client doesn't contain
// the specified node
response.setType(IQ.Type.ERROR);
response.setType(IQ.Type.error);
response.setError(new XMPPError(XMPPError.Condition.item_not_found));
}
connection.sendPacket(response);
@ -157,9 +157,9 @@ public class ServiceDiscoveryManager extends Manager {
if (connection == null) return;
DiscoverInfo discoverInfo = (DiscoverInfo) packet;
// Answer the client's supported features if the request is of the GET type
if (discoverInfo != null && discoverInfo.getType() == IQ.Type.GET) {
if (discoverInfo != null && discoverInfo.getType() == IQ.Type.get) {
DiscoverInfo response = new DiscoverInfo();
response.setType(IQ.Type.RESULT);
response.setType(IQ.Type.result);
response.setTo(discoverInfo.getFrom());
response.setPacketID(discoverInfo.getPacketID());
response.setNode(discoverInfo.getNode());
@ -185,7 +185,7 @@ public class ServiceDiscoveryManager extends Manager {
}
else {
// Return <item-not-found/> error since specified node was not found
response.setType(IQ.Type.ERROR);
response.setType(IQ.Type.error);
response.setError(new XMPPError(XMPPError.Condition.item_not_found));
}
}
@ -552,7 +552,7 @@ public class ServiceDiscoveryManager extends Manager {
public DiscoverInfo discoverInfo(String entityID, String node) throws NoResponseException, XMPPErrorException, NotConnectedException {
// Discover the entity's info
DiscoverInfo disco = new DiscoverInfo();
disco.setType(IQ.Type.GET);
disco.setType(IQ.Type.get);
disco.setTo(entityID);
disco.setNode(node);
@ -589,7 +589,7 @@ public class ServiceDiscoveryManager extends Manager {
public DiscoverItems discoverItems(String entityID, String node) throws NoResponseException, XMPPErrorException, NotConnectedException {
// Discover the entity's items
DiscoverItems disco = new DiscoverItems();
disco.setType(IQ.Type.GET);
disco.setType(IQ.Type.get);
disco.setTo(entityID);
disco.setNode(node);
@ -658,7 +658,7 @@ public class ServiceDiscoveryManager extends Manager {
*/
public void publishItems(String entityID, String node, DiscoverItems discoverItems) throws NoResponseException, XMPPErrorException, NotConnectedException
{
discoverItems.setType(IQ.Type.SET);
discoverItems.setType(IQ.Type.set);
discoverItems.setTo(entityID);
discoverItems.setNode(node);

View file

@ -173,7 +173,7 @@ public class FileTransferManager {
IQ rejection = FileTransferNegotiator.createIQ(
initiation.getPacketID(), initiation.getFrom(), initiation
.getTo(), IQ.Type.ERROR);
.getTo(), IQ.Type.error);
rejection.setError(new XMPPError(XMPPError.Condition.no_acceptable));
connection.sendPacket(rejection);
}

View file

@ -253,7 +253,7 @@ public class FileTransferNegotiator {
String errorMessage = "No stream methods contained in packet.";
XMPPError error = new XMPPError(XMPPError.Condition.bad_request, errorMessage);
IQ iqPacket = createIQ(si.getPacketID(), si.getFrom(), si.getTo(),
IQ.Type.ERROR);
IQ.Type.error);
iqPacket.setError(error);
connection.sendPacket(iqPacket);
throw new XMPPErrorException(errorMessage, error);
@ -267,7 +267,7 @@ public class FileTransferNegotiator {
}
catch (XMPPErrorException e) {
IQ iqPacket = createIQ(si.getPacketID(), si.getFrom(), si.getTo(),
IQ.Type.ERROR);
IQ.Type.error);
iqPacket.setError(e.getXMPPError());
connection.sendPacket(iqPacket);
throw e;
@ -331,7 +331,7 @@ public class FileTransferNegotiator {
public void rejectStream(final StreamInitiation si) throws NotConnectedException {
XMPPError error = new XMPPError(XMPPError.Condition.forbidden, "Offer Declined");
IQ iqPacket = createIQ(si.getPacketID(), si.getFrom(), si.getTo(),
IQ.Type.ERROR);
IQ.Type.error);
iqPacket.setError(error);
connection.sendPacket(iqPacket);
}
@ -396,7 +396,7 @@ public class FileTransferNegotiator {
si.setFrom(connection.getUser());
si.setTo(userID);
si.setType(IQ.Type.SET);
si.setType(IQ.Type.set);
PacketCollector collector = connection.createPacketCollectorAndSend(si);
Packet siResponse = collector.nextResult(responseTimeout);
@ -404,7 +404,7 @@ public class FileTransferNegotiator {
if (siResponse instanceof IQ) {
IQ iqResponse = (IQ) siResponse;
if (iqResponse.getType().equals(IQ.Type.RESULT)) {
if (iqResponse.getType().equals(IQ.Type.result)) {
StreamInitiation response = (StreamInitiation) siResponse;
return getOutgoingNegotiator(getStreamMethodField(response
.getFeatureNegotiationForm()));

View file

@ -131,7 +131,7 @@ public class IBBTransferNegotiator extends StreamNegotiator {
// packet must by of type SET and contains the given session ID
return this.sessionID.equals(bytestream.getSessionID())
&& IQ.Type.SET.equals(bytestream.getType());
&& IQ.Type.set.equals(bytestream.getType());
}
return false;
}

View file

@ -149,7 +149,7 @@ public class Socks5TransferNegotiator extends StreamNegotiator {
// packet must by of type SET and contains the given session ID
return this.sessionID.equals(bytestream.getSessionID())
&& IQ.Type.SET.equals(bytestream.getType());
&& IQ.Type.set.equals(bytestream.getType());
}
return false;
}

View file

@ -59,7 +59,7 @@ public abstract class StreamNegotiator {
StreamInitiation response = new StreamInitiation();
response.setTo(streamInitiationOffer.getFrom());
response.setFrom(streamInitiationOffer.getTo());
response.setType(IQ.Type.RESULT);
response.setType(IQ.Type.result);
response.setPacketID(streamInitiationOffer.getPacketID());
DataForm form = new DataForm(Form.TYPE_SUBMIT);
@ -76,7 +76,7 @@ public abstract class StreamNegotiator {
public IQ createError(String from, String to, String packetID, XMPPError xmppError) {
IQ iq = FileTransferNegotiator.createIQ(packetID, to, from, IQ.Type.ERROR);
IQ iq = FileTransferNegotiator.createIQ(packetID, to, from, IQ.Type.error);
iq.setError(xmppError);
return iq;
}

View file

@ -165,7 +165,7 @@ public class LastActivityManager extends Manager {
public void processPacket(Packet packet) throws NotConnectedException {
if (!enabled) return;
LastActivity message = new LastActivity();
message.setType(IQ.Type.RESULT);
message.setType(IQ.Type.result);
message.setTo(packet.getFrom());
message.setFrom(packet.getTo());
message.setPacketID(packet.getPacketID());

View file

@ -43,7 +43,7 @@ public class LastActivity extends IQ {
public String message;
public LastActivity() {
setType(IQ.Type.GET);
setType(IQ.Type.get);
}
public LastActivity(String to) {

View file

@ -162,7 +162,7 @@ public class PrivateDataManager extends Manager {
return buf.toString();
}
};
privateDataGet.setType(IQ.Type.GET);
privateDataGet.setType(IQ.Type.get);
PrivateDataResult response = (PrivateDataResult) connection().createPacketCollectorAndSend(
privateDataGet).nextResultOrThrow();
@ -190,7 +190,7 @@ public class PrivateDataManager extends Manager {
return buf.toString();
}
};
privateDataSet.setType(IQ.Type.SET);
privateDataSet.setType(IQ.Type.set);
connection().createPacketCollectorAndSend(privateDataSet).nextResultOrThrow();
}

View file

@ -29,7 +29,7 @@ import org.jivesoftware.smack.util.StringUtils;
* <pre>
* // Request the version from the server.
* Version versionRequest = new Version();
* timeRequest.setType(IQ.Type.GET);
* timeRequest.setType(IQ.Type.get);
* timeRequest.setTo("example.com");
*
* // Create a packet collector to listen for a response.
@ -40,7 +40,7 @@ import org.jivesoftware.smack.util.StringUtils;
*
* // Wait up to 5 seconds for a result.
* IQ result = (IQ)collector.nextResult(5000);
* if (result != null && result.getType() == IQ.Type.RESULT) {
* if (result != null && result.getType() == IQ.Type.result) {
* Version versionResult = (Version)result;
* // Do something with result...
* }</pre><p>
@ -62,7 +62,7 @@ public class Version extends IQ {
* @param os The operating system of the queried entity. This element is OPTIONAL.
*/
public Version(String name, String version, String os) {
this.setType(IQ.Type.RESULT);
this.setType(IQ.Type.result);
this.name = name;
this.version = version;
this.os = os;

View file

@ -566,7 +566,7 @@ public class MultiUserChat {
public Form getConfigurationForm() throws NoResponseException, XMPPErrorException, NotConnectedException {
MUCOwner iq = new MUCOwner();
iq.setTo(room);
iq.setType(IQ.Type.GET);
iq.setType(IQ.Type.get);
IQ answer = (IQ) connection.createPacketCollectorAndSend(iq).nextResultOrThrow();
return Form.getFormFrom(answer);
@ -585,7 +585,7 @@ public class MultiUserChat {
public void sendConfigurationForm(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException {
MUCOwner iq = new MUCOwner();
iq.setTo(room);
iq.setType(IQ.Type.SET);
iq.setType(IQ.Type.set);
iq.addExtension(form.getDataFormToSend());
connection.createPacketCollectorAndSend(iq).nextResultOrThrow();
@ -609,7 +609,7 @@ public class MultiUserChat {
*/
public Form getRegistrationForm() throws NoResponseException, XMPPErrorException, NotConnectedException {
Registration reg = new Registration();
reg.setType(IQ.Type.GET);
reg.setType(IQ.Type.get);
reg.setTo(room);
IQ result = (IQ) connection.createPacketCollectorAndSend(reg).nextResultOrThrow();
@ -634,7 +634,7 @@ public class MultiUserChat {
*/
public void sendRegistrationForm(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException {
Registration reg = new Registration();
reg.setType(IQ.Type.SET);
reg.setType(IQ.Type.set);
reg.setTo(room);
reg.addExtension(form.getDataFormToSend());
@ -658,7 +658,7 @@ public class MultiUserChat {
public void destroy(String reason, String alternateJID) throws NoResponseException, XMPPErrorException, NotConnectedException {
MUCOwner iq = new MUCOwner();
iq.setTo(room);
iq.setType(IQ.Type.SET);
iq.setType(IQ.Type.set);
// Create the reason for the room destruction
MUCOwner.Destroy destroy = new MUCOwner.Destroy();
@ -1369,7 +1369,7 @@ public class MultiUserChat {
throws XMPPErrorException, NoResponseException, NotConnectedException {
MUCOwner iq = new MUCOwner();
iq.setTo(room);
iq.setType(IQ.Type.SET);
iq.setType(IQ.Type.set);
// Set the new affiliation.
MUCOwner.Item item = new MUCOwner.Item(affiliation);
item.setJid(jid);
@ -1382,7 +1382,7 @@ public class MultiUserChat {
throws NoResponseException, XMPPErrorException, NotConnectedException {
MUCOwner iq = new MUCOwner();
iq.setTo(room);
iq.setType(IQ.Type.SET);
iq.setType(IQ.Type.set);
for (String jid : jids) {
// Set the new affiliation.
MUCOwner.Item item = new MUCOwner.Item(affiliation);
@ -1407,7 +1407,7 @@ public class MultiUserChat {
{
MUCAdmin iq = new MUCAdmin();
iq.setTo(room);
iq.setType(IQ.Type.SET);
iq.setType(IQ.Type.set);
// Set the new affiliation.
MUCAdmin.Item item = new MUCAdmin.Item(affiliation, null);
item.setJid(jid);
@ -1421,7 +1421,7 @@ public class MultiUserChat {
throws NoResponseException, XMPPErrorException, NotConnectedException {
MUCAdmin iq = new MUCAdmin();
iq.setTo(room);
iq.setType(IQ.Type.SET);
iq.setType(IQ.Type.set);
for (String jid : jids) {
// Set the new affiliation.
MUCAdmin.Item item = new MUCAdmin.Item(affiliation, null);
@ -1435,7 +1435,7 @@ public class MultiUserChat {
private void changeRole(String nickname, String role, String reason) throws NoResponseException, XMPPErrorException, NotConnectedException {
MUCAdmin iq = new MUCAdmin();
iq.setTo(room);
iq.setType(IQ.Type.SET);
iq.setType(IQ.Type.set);
// Set the new role.
MUCAdmin.Item item = new MUCAdmin.Item(null, role);
item.setNick(nickname);
@ -1448,7 +1448,7 @@ public class MultiUserChat {
private void changeRole(Collection<String> nicknames, String role) throws NoResponseException, XMPPErrorException, NotConnectedException {
MUCAdmin iq = new MUCAdmin();
iq.setTo(room);
iq.setType(IQ.Type.SET);
iq.setType(IQ.Type.set);
for (String nickname : nicknames) {
// Set the new role.
MUCAdmin.Item item = new MUCAdmin.Item(null, role);
@ -1604,7 +1604,7 @@ public class MultiUserChat {
private Collection<Affiliate> getAffiliatesByAdmin(String affiliation) throws NoResponseException, XMPPErrorException, NotConnectedException {
MUCAdmin iq = new MUCAdmin();
iq.setTo(room);
iq.setType(IQ.Type.GET);
iq.setType(IQ.Type.get);
// Set the specified affiliation. This may request the list of owners/admins/members/outcasts.
MUCAdmin.Item item = new MUCAdmin.Item(affiliation, null);
iq.addItem(item);
@ -1656,7 +1656,7 @@ public class MultiUserChat {
private Collection<Occupant> getOccupants(String role) throws NoResponseException, XMPPErrorException, NotConnectedException {
MUCAdmin iq = new MUCAdmin();
iq.setTo(room);
iq.setType(IQ.Type.GET);
iq.setType(IQ.Type.get);
// Set the specified role. This may request the list of moderators/participants.
MUCAdmin.Item item = new MUCAdmin.Item(null, role);
iq.addItem(item);

View file

@ -111,7 +111,7 @@ public class PEPManager {
public void publish(PEPItem item) throws NotConnectedException {
// Create a new message to publish the event.
PEPPubSub pubSub = new PEPPubSub(item);
pubSub.setType(Type.SET);
pubSub.setType(Type.set);
//pubSub.setFrom(connection.getUser());
// Send the message that contains the roster

View file

@ -28,7 +28,7 @@ public class Ping extends IQ {
public Ping(String to) {
setTo(to);
setType(IQ.Type.GET);
setType(IQ.Type.get);
}
@Override

View file

@ -28,7 +28,7 @@ public class Pong extends IQ {
* @param ping
*/
public Pong(Packet ping) {
setType(IQ.Type.RESULT);
setType(IQ.Type.result);
setFrom(ping.getTo());
setTo(ping.getFrom());
setPacketID(ping.getPacketID());

View file

@ -148,7 +148,7 @@ public class PrivacyListManager extends Manager {
*/
private Privacy getRequest(Privacy requestPrivacy) throws NoResponseException, XMPPErrorException, NotConnectedException {
// The request is a get iq type
requestPrivacy.setType(Privacy.Type.GET);
requestPrivacy.setType(Privacy.Type.get);
requestPrivacy.setFrom(this.getUser());
Privacy privacyAnswer = (Privacy) connection().createPacketCollectorAndSend(requestPrivacy).nextResultOrThrow();
@ -168,7 +168,7 @@ public class PrivacyListManager extends Manager {
*/
private Packet setRequest(Privacy requestPrivacy) throws NoResponseException, XMPPErrorException, NotConnectedException {
// The request is a get iq type
requestPrivacy.setType(Privacy.Type.SET);
requestPrivacy.setType(Privacy.Type.set);
requestPrivacy.setFrom(this.getUser());
return connection().createPacketCollectorAndSend(requestPrivacy).nextResultOrThrow();

View file

@ -71,7 +71,7 @@ public class LeafNode extends Node
@SuppressWarnings("unchecked")
public <T extends Item> List<T> getItems() throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId()));
PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId()));
PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow();
ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
@ -93,7 +93,7 @@ public class LeafNode extends Node
@SuppressWarnings("unchecked")
public <T extends Item> List<T> getItems(String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId(), subscriptionId));
PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId(), subscriptionId));
PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow();
ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
@ -123,7 +123,7 @@ public class LeafNode extends Node
{
itemList.add(new Item(id));
}
PubSub request = createPubsubPacket(Type.GET, new ItemsExtension(ItemsExtension.ItemsElementType.items, getId(), itemList));
PubSub request = createPubsubPacket(Type.get, new ItemsExtension(ItemsExtension.ItemsElementType.items, getId(), itemList));
PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow();
ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
@ -143,7 +143,7 @@ public class LeafNode extends Node
@SuppressWarnings("unchecked")
public <T extends Item> List<T> getItems(int maxItems) throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId(), maxItems));
PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId(), maxItems));
PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow();
ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
@ -166,7 +166,7 @@ public class LeafNode extends Node
@SuppressWarnings("unchecked")
public <T extends Item> List<T> getItems(int maxItems, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId(), subscriptionId, maxItems));
PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId(), subscriptionId, maxItems));
PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow();
ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
@ -188,7 +188,7 @@ public class LeafNode extends Node
*/
public void publish() throws NotConnectedException
{
PubSub packet = createPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.PUBLISH, getId()));
PubSub packet = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PUBLISH, getId()));
con.sendPacket(packet);
}
@ -233,7 +233,7 @@ public class LeafNode extends Node
*/
public <T extends Item> void publish(Collection<T> items) throws NotConnectedException
{
PubSub packet = createPubsubPacket(Type.SET, new PublishItem<T>(getId(), items));
PubSub packet = createPubsubPacket(Type.set, new PublishItem<T>(getId(), items));
con.sendPacket(packet);
}
@ -256,7 +256,7 @@ public class LeafNode extends Node
*/
public void send() throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub packet = createPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.PUBLISH, getId()));
PubSub packet = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PUBLISH, getId()));
con.createPacketCollectorAndSend(packet).nextResultOrThrow();
}
@ -311,7 +311,7 @@ public class LeafNode extends Node
*/
public <T extends Item> void send(Collection<T> items) throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub packet = createPubsubPacket(Type.SET, new PublishItem<T>(getId(), items));
PubSub packet = createPubsubPacket(Type.set, new PublishItem<T>(getId(), items));
con.createPacketCollectorAndSend(packet).nextResultOrThrow();
}
@ -327,7 +327,7 @@ public class LeafNode extends Node
*/
public void deleteAllItems() throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub request = createPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.PURGE_OWNER, getId()), PubSubElementType.PURGE_OWNER.getNamespace());
PubSub request = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PURGE_OWNER, getId()), PubSubElementType.PURGE_OWNER.getNamespace());
con.createPacketCollectorAndSend(request).nextResultOrThrow();
}
@ -363,7 +363,7 @@ public class LeafNode extends Node
{
items.add(new Item(id));
}
PubSub request = createPubsubPacket(Type.SET, new ItemsExtension(ItemsExtension.ItemsElementType.retract, getId(), items));
PubSub request = createPubsubPacket(Type.set, new ItemsExtension(ItemsExtension.ItemsElementType.retract, getId(), items));
con.createPacketCollectorAndSend(request).nextResultOrThrow();
}
}

View file

@ -98,7 +98,7 @@ abstract public class Node
*/
public ConfigureForm getNodeConfiguration() throws NoResponseException, XMPPErrorException, NotConnectedException
{
Packet reply = sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.CONFIGURE_OWNER, getId()), PubSubNamespace.OWNER);
Packet reply = sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.CONFIGURE_OWNER, getId()), PubSubNamespace.OWNER);
return NodeUtils.getFormFromPacket(reply, PubSubElementType.CONFIGURE_OWNER);
}
@ -112,7 +112,7 @@ abstract public class Node
*/
public void sendConfigurationForm(Form submitForm) throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub packet = createPubsubPacket(Type.SET, new FormNode(FormNodeType.CONFIGURE_OWNER, getId(), submitForm), PubSubNamespace.OWNER);
PubSub packet = createPubsubPacket(Type.set, new FormNode(FormNodeType.CONFIGURE_OWNER, getId(), submitForm), PubSubNamespace.OWNER);
con.createPacketCollectorAndSend(packet).nextResultOrThrow();
}
@ -143,7 +143,7 @@ abstract public class Node
*/
public List<Subscription> getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub reply = (PubSub)sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.SUBSCRIPTIONS, getId()));
PubSub reply = (PubSub)sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.SUBSCRIPTIONS, getId()));
SubscriptionsExtension subElem = (SubscriptionsExtension)reply.getExtension(PubSubElementType.SUBSCRIPTIONS);
return subElem.getSubscriptions();
}
@ -167,7 +167,7 @@ abstract public class Node
*/
public Subscription subscribe(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub reply = (PubSub)sendPubsubPacket(Type.SET, new SubscribeExtension(jid, getId()));
PubSub reply = (PubSub)sendPubsubPacket(Type.set, new SubscribeExtension(jid, getId()));
return (Subscription)reply.getExtension(PubSubElementType.SUBSCRIPTION);
}
@ -191,9 +191,9 @@ abstract public class Node
*/
public Subscription subscribe(String jid, SubscribeForm subForm) throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub request = createPubsubPacket(Type.SET, new SubscribeExtension(jid, getId()));
PubSub request = createPubsubPacket(Type.set, new SubscribeExtension(jid, getId()));
request.addExtension(new FormNode(FormNodeType.OPTIONS, subForm));
PubSub reply = (PubSub)PubSubManager.sendPubsubPacket(con, jid, Type.SET, request);
PubSub reply = (PubSub)PubSubManager.sendPubsubPacket(con, jid, Type.set, request);
return (Subscription)reply.getExtension(PubSubElementType.SUBSCRIPTION);
}
@ -224,7 +224,7 @@ abstract public class Node
*/
public void unsubscribe(String jid, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException
{
sendPubsubPacket(Type.SET, new UnsubscribeExtension(jid, getId(), subscriptionId));
sendPubsubPacket(Type.set, new UnsubscribeExtension(jid, getId(), subscriptionId));
}
/**
@ -256,7 +256,7 @@ abstract public class Node
*/
public SubscribeForm getSubscriptionOptions(String jid, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub packet = (PubSub)sendPubsubPacket(Type.GET, new OptionsExtension(jid, getId(), subscriptionId));
PubSub packet = (PubSub)sendPubsubPacket(Type.get, new OptionsExtension(jid, getId(), subscriptionId));
FormNode ext = (FormNode)packet.getExtension(PubSubElementType.OPTIONS);
return new SubscribeForm(ext.getForm());
}

View file

@ -86,7 +86,7 @@ final public class PubSubManager
*/
public LeafNode createNode() throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub reply = (PubSub)sendPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.CREATE));
PubSub reply = (PubSub)sendPubsubPacket(Type.set, new NodeExtension(PubSubElementType.CREATE));
NodeExtension elem = (NodeExtension)reply.getExtension("create", PubSubNamespace.BASIC.getXmlns());
LeafNode newNode = new LeafNode(con, elem.getNode());
@ -126,7 +126,7 @@ final public class PubSubManager
*/
public Node createNode(String name, Form config) throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub request = createPubsubPacket(to, Type.SET, new NodeExtension(PubSubElementType.CREATE, name));
PubSub request = createPubsubPacket(to, Type.set, new NodeExtension(PubSubElementType.CREATE, name));
boolean isLeafNode = true;
if (config != null)
@ -140,7 +140,7 @@ final public class PubSubManager
// Errors will cause exceptions in getReply, so it only returns
// on success.
sendPubsubPacket(con, to, Type.SET, request);
sendPubsubPacket(con, to, Type.set, request);
Node newNode = isLeafNode ? new LeafNode(con, name) : new CollectionNode(con, name);
newNode.setTo(to);
nodeMap.put(newNode.getId(), newNode);
@ -217,7 +217,7 @@ final public class PubSubManager
*/
public List<Subscription> getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException
{
Packet reply = sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.SUBSCRIPTIONS));
Packet reply = sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.SUBSCRIPTIONS));
SubscriptionsExtension subElem = (SubscriptionsExtension)reply.getExtension(PubSubElementType.SUBSCRIPTIONS.getElementName(), PubSubElementType.SUBSCRIPTIONS.getNamespace().getXmlns());
return subElem.getSubscriptions();
}
@ -233,7 +233,7 @@ final public class PubSubManager
*/
public List<Affiliation> getAffiliations() throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub reply = (PubSub)sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.AFFILIATIONS));
PubSub reply = (PubSub)sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.AFFILIATIONS));
AffiliationsExtension listElem = (AffiliationsExtension)reply.getExtension(PubSubElementType.AFFILIATIONS);
return listElem.getAffiliations();
}
@ -248,7 +248,7 @@ final public class PubSubManager
*/
public void deleteNode(String nodeId) throws NoResponseException, XMPPErrorException, NotConnectedException
{
sendPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.DELETE, nodeId), PubSubElementType.DELETE.getNamespace());
sendPubsubPacket(Type.set, new NodeExtension(PubSubElementType.DELETE, nodeId), PubSubElementType.DELETE.getNamespace());
nodeMap.remove(nodeId);
}
@ -264,7 +264,7 @@ final public class PubSubManager
{
// Errors will cause exceptions in getReply, so it only returns
// on success.
PubSub reply = (PubSub)sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.DEFAULT), PubSubElementType.DEFAULT.getNamespace());
PubSub reply = (PubSub)sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.DEFAULT), PubSubElementType.DEFAULT.getNamespace());
return NodeUtils.getFormFromPacket(reply, PubSubElementType.DEFAULT);
}

View file

@ -66,7 +66,7 @@ public class UserSearch extends IQ {
*/
public Form getSearchForm(XMPPConnection con, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException {
UserSearch search = new UserSearch();
search.setType(IQ.Type.GET);
search.setType(IQ.Type.get);
search.setTo(searchService);
IQ response = (IQ) con.createPacketCollectorAndSend(search).nextResultOrThrow();
@ -86,7 +86,7 @@ public class UserSearch extends IQ {
*/
public ReportedData sendSearchForm(XMPPConnection con, Form searchForm, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException {
UserSearch search = new UserSearch();
search.setType(IQ.Type.SET);
search.setType(IQ.Type.set);
search.setTo(searchService);
search.addExtension(searchForm.getDataFormToSend());
@ -108,7 +108,7 @@ public class UserSearch extends IQ {
public ReportedData sendSimpleSearchForm(XMPPConnection con, Form searchForm, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException {
SimpleUserSearch search = new SimpleUserSearch();
search.setForm(searchForm);
search.setType(IQ.Type.SET);
search.setType(IQ.Type.set);
search.setTo(searchService);
SimpleUserSearch response = (SimpleUserSearch) con.createPacketCollectorAndSend(search).nextResultOrThrow();

View file

@ -48,7 +48,7 @@ public class SharedGroupManager {
public static List<String> getSharedGroups(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException {
// Discover the shared groups of the logged user
SharedGroupsInfo info = new SharedGroupsInfo();
info.setType(IQ.Type.GET);
info.setType(IQ.Type.get);
SharedGroupsInfo result = (SharedGroupsInfo) connection.createPacketCollectorAndSend(info).nextResultOrThrow();
return result.getGroups();

View file

@ -134,7 +134,7 @@ public class StreamInitiation extends IQ {
*/
public String getChildElementXML() {
StringBuilder buf = new StringBuilder();
if (this.getType().equals(IQ.Type.SET)) {
if (this.getType().equals(IQ.Type.set)) {
buf.append("<si xmlns=\"http://jabber.org/protocol/si\" ");
if (getSessionID() != null) {
buf.append("id=\"").append(getSessionID()).append("\" ");
@ -151,7 +151,7 @@ public class StreamInitiation extends IQ {
buf.append(fileXML);
}
}
else if (this.getType().equals(IQ.Type.RESULT)) {
else if (this.getType().equals(IQ.Type.result)) {
buf.append("<si xmlns=\"http://jabber.org/protocol/si\">");
}
else {

View file

@ -43,7 +43,7 @@ public class Time extends IQ {
private String tzo;
public Time() {
setType(Type.GET);
setType(Type.get);
}
/**
@ -123,7 +123,7 @@ public class Time extends IQ {
public static Time createResponse(Packet request) {
Time time = new Time(Calendar.getInstance());
time.setType(Type.RESULT);
time.setType(Type.result);
time.setTo(request.getFrom());
return time;
}

View file

@ -523,7 +523,7 @@ public class VCard extends IQ {
public void save(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException {
checkAuthenticated(connection, true);
setType(IQ.Type.SET);
setType(IQ.Type.set);
setFrom(connection.getUser());
connection.createPacketCollectorAndSend(this).nextResultOrThrow();
}
@ -556,7 +556,7 @@ public class VCard extends IQ {
}
private void doLoad(XMPPConnection connection, String user) throws NoResponseException, XMPPErrorException, NotConnectedException {
setType(Type.GET);
setType(Type.get);
VCard result = (VCard) connection.createPacketCollectorAndSend(this).nextResultOrThrow();
copyFieldsFrom(result);
}

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;
}

View file

@ -107,7 +107,7 @@ public class EntityCapsManagerTest extends InitExtensions {
di.setFrom("benvolio@capulet.lit/230193");
di.setPacketID("disco1");
di.setTo("juliet@capulet.lit/chamber");
di.setType(IQ.Type.RESULT);
di.setType(IQ.Type.result);
Collection<DiscoverInfo.Identity> identities = new LinkedList<DiscoverInfo.Identity>();
DiscoverInfo.Identity i = new DiscoverInfo.Identity("client", "Psi 0.11", "pc");
@ -160,7 +160,7 @@ public class EntityCapsManagerTest extends InitExtensions {
di.setFrom("benvolio@capulet.lit/230193");
di.setPacketID("disco1");
di.setTo(")juliet@capulet.lit/chamber");
di.setType(IQ.Type.RESULT);
di.setType(IQ.Type.result);
Collection<DiscoverInfo.Identity> identities = new LinkedList<DiscoverInfo.Identity>();
DiscoverInfo.Identity i = new DiscoverInfo.Identity("client", "Psi 0.11", "pc");

View file

@ -50,6 +50,6 @@ public class LastActivityTest extends InitExtensions {
assertTrue(reply instanceof LastActivity);
LastActivity l = (LastActivity) reply;
assertEquals("last2", l.getPacketID());
assertEquals(IQ.Type.RESULT, l.getType());
assertEquals(IQ.Type.result, l.getType());
}
}

View file

@ -52,7 +52,7 @@ public class VersionTest {
//assertEquals("juliet@capulet.lit/balcony", reply.getFrom());
assertEquals("capulet.lit", reply.getTo());
assertEquals("s2c1", reply.getPacketID());
assertEquals(IQ.Type.RESULT, reply.getType());
assertEquals(IQ.Type.result, reply.getType());
assertEquals("Test", reply.getName());
assertEquals("0.23", reply.getVersion());
assertEquals("DummyOS", reply.getOs());

View file

@ -104,7 +104,7 @@
// public void processPacket(Packet packet) {
// latch.countDown();
// }
// }, new IQTypeFilter(IQ.Type.RESULT));
// }, new IQTypeFilter(IQ.Type.result));
//
// // Time based testing kind of sucks, but this should be reliable on a DummyConnection since there
// // is no actual server involved. This will provide enough time to ping and wait for the lack of response.

View file

@ -68,7 +68,7 @@ public class PingTest extends InitExtensions {
IQ pong = (IQ) pongPacket;
assertEquals("capulet.lit", pong.getTo());
assertEquals("s2c1", pong.getPacketID());
assertEquals(IQ.Type.RESULT, pong.getType());
assertEquals(IQ.Type.result, pong.getType());
}
@Test

View file

@ -51,7 +51,7 @@ public interface Verification<T extends Packet, S extends Packet> {
public static Verification<IQ, Packet> requestTypeGET = new Verification<IQ, Packet>() {
public void verify(IQ request, Packet response) {
assertEquals(IQ.Type.GET, request.getType());
assertEquals(IQ.Type.get, request.getType());
}
};
@ -62,7 +62,7 @@ public interface Verification<T extends Packet, S extends Packet> {
public static Verification<IQ, Packet> requestTypeSET = new Verification<IQ, Packet>() {
public void verify(IQ request, Packet response) {
assertEquals(IQ.Type.SET, request.getType());
assertEquals(IQ.Type.set, request.getType());
}
};
@ -73,7 +73,7 @@ public interface Verification<T extends Packet, S extends Packet> {
public static Verification<IQ, Packet> requestTypeRESULT = new Verification<IQ, Packet>() {
public void verify(IQ request, Packet response) {
assertEquals(IQ.Type.RESULT, request.getType());
assertEquals(IQ.Type.result, request.getType());
}
};
@ -84,7 +84,7 @@ public interface Verification<T extends Packet, S extends Packet> {
public static Verification<IQ, Packet> requestTypeERROR = new Verification<IQ, Packet>() {
public void verify(IQ request, Packet response) {
assertEquals(IQ.Type.ERROR, request.getType());
assertEquals(IQ.Type.error, request.getType());
}
};