mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-11 21:41:08 +01:00
Fix minor codestyle issues
This commit is contained in:
parent
200f90ffdc
commit
cb18056613
422 changed files with 1404 additions and 1444 deletions
|
|
@ -30,19 +30,19 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
public class MUCLightAffiliationsChangeExtensionTest {
|
||||
|
||||
String exampleMessageStanza = "<message " + "to='coven@muclight.shakespeare.lit' id='member1' type='groupchat'>"
|
||||
private static final String exampleMessageStanza = "<message " + "to='coven@muclight.shakespeare.lit' id='member1' type='groupchat'>"
|
||||
+ "<x xmlns='urn:xmpp:muclight:0#affiliations'>"
|
||||
+ "<user affiliation='owner'>sarasa2@shakespeare.lit</user>"
|
||||
+ "<user affiliation='member'>sarasa1@shakespeare.lit</user>"
|
||||
+ "<user affiliation='none'>sarasa3@shakespeare.lit</user>" + "</x>" + "</message>";
|
||||
|
||||
String exampleMessageStanzaWithVersion = "<message "
|
||||
private static final String exampleMessageStanzaWithVersion = "<message "
|
||||
+ "to='coven@muclight.shakespeare.lit' id='member1' type='groupchat'>"
|
||||
+ "<x xmlns='urn:xmpp:muclight:0#affiliations'>" + "<version>qwerty</version>"
|
||||
+ "<user affiliation='member'>sarasa1@shakespeare.lit</user>"
|
||||
+ "<user affiliation='none'>sarasa3@shakespeare.lit</user>" + "</x>" + "<body></body>" + "</message>";
|
||||
|
||||
String exampleMessageStanzaWithPrevVersion = "<message "
|
||||
private static final String exampleMessageStanzaWithPrevVersion = "<message "
|
||||
+ "to='coven@muclight.shakespeare.lit' id='member1' type='groupchat'>"
|
||||
+ "<x xmlns='urn:xmpp:muclight:0#affiliations'>" + "<prev-version>njiokm</prev-version>"
|
||||
+ "<version>qwerty</version>" + "<user affiliation='owner'>sarasa2@shakespeare.lit</user>"
|
||||
|
|
@ -50,7 +50,7 @@ public class MUCLightAffiliationsChangeExtensionTest {
|
|||
|
||||
@Test
|
||||
public void checkAffiliationsChangeExtension() throws Exception {
|
||||
Message changeAffiliationsMessage = (Message) PacketParserUtils.parseStanza(exampleMessageStanza);
|
||||
Message changeAffiliationsMessage = PacketParserUtils.parseStanza(exampleMessageStanza);
|
||||
AffiliationsChangeExtension affiliationsChangeExtension = AffiliationsChangeExtension
|
||||
.from(changeAffiliationsMessage);
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ public class MUCLightAffiliationsChangeExtensionTest {
|
|||
|
||||
@Test
|
||||
public void checkAffiliationsChangeExtensionWithVersion() throws Exception {
|
||||
Message changeAffiliationsMessage = (Message) PacketParserUtils.parseStanza(exampleMessageStanzaWithVersion);
|
||||
Message changeAffiliationsMessage = PacketParserUtils.parseStanza(exampleMessageStanzaWithVersion);
|
||||
AffiliationsChangeExtension affiliationsChangeExtension = AffiliationsChangeExtension
|
||||
.from(changeAffiliationsMessage);
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ public class MUCLightAffiliationsChangeExtensionTest {
|
|||
|
||||
@Test
|
||||
public void checkAffiliationsChangeExtensionWithPrevVersion() throws Exception {
|
||||
Message changeAffiliationsMessage = (Message) PacketParserUtils
|
||||
Message changeAffiliationsMessage = PacketParserUtils
|
||||
.parseStanza(exampleMessageStanzaWithPrevVersion);
|
||||
AffiliationsChangeExtension affiliationsChangeExtension = AffiliationsChangeExtension
|
||||
.from(changeAffiliationsMessage);
|
||||
|
|
|
|||
|
|
@ -31,25 +31,25 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
public class MUCLightBlockingTest {
|
||||
|
||||
String getBlockingListIQExample = "<iq to='muclight.shakespeare.lit' id='getblock1' type='get'>"
|
||||
private static final String getBlockingListIQExample = "<iq to='muclight.shakespeare.lit' id='getblock1' type='get'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#blocking'>" + "</query>" + "</iq>";
|
||||
|
||||
String getBlockingListIQResponse = "<iq type='result' id='getblock1' to='crone1@shakespeare.lit/desktop' from='muclight.shakespeare.lit'>"
|
||||
private static final String getBlockingListIQResponse = "<iq type='result' id='getblock1' to='crone1@shakespeare.lit/desktop' from='muclight.shakespeare.lit'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#blocking'>"
|
||||
+ "<room action='deny'>coven@muclight.shakespeare.lit</room>"
|
||||
+ "<room action='deny'>sarasa@muclight.shakespeare.lit</room>"
|
||||
+ "<user action='deny'>hag77@shakespeare.lit</user>" + "</query>" + "</iq>";
|
||||
|
||||
String blockingRoomsIQExample = "<iq to='muclight.shakespeare.lit' id='block1' type='set'>"
|
||||
private static final String blockingRoomsIQExample = "<iq to='muclight.shakespeare.lit' id='block1' type='set'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#blocking'>"
|
||||
+ "<room action='deny'>coven@muclight.shakespeare.lit</room>"
|
||||
+ "<room action='deny'>chapel@shakespeare.lit</room>" + "</query>" + "</iq>";
|
||||
|
||||
String blockingUsersIQExample = "<iq to='muclight.shakespeare.lit' id='block2' type='set'>"
|
||||
private static final String blockingUsersIQExample = "<iq to='muclight.shakespeare.lit' id='block2' type='set'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#blocking'>" + "<user action='deny'>hag77@shakespeare.lit</user>"
|
||||
+ "<user action='deny'>hag66@shakespeare.lit</user>" + "</query>" + "</iq>";
|
||||
|
||||
String unblockingUsersAndRoomsExample = "<iq to='muclight.shakespeare.lit' id='unblock1' type='set'>"
|
||||
private static final String unblockingUsersAndRoomsExample = "<iq to='muclight.shakespeare.lit' id='unblock1' type='set'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#blocking'>"
|
||||
+ "<room action='allow'>coven@muclight.shakespeare.lit</room>"
|
||||
+ "<user action='allow'>hag66@shakespeare.lit</user>" + "</query>" + "</iq>";
|
||||
|
|
@ -66,7 +66,7 @@ public class MUCLightBlockingTest {
|
|||
|
||||
@Test
|
||||
public void checkGetBlockingListResponse() throws Exception {
|
||||
IQ iqInfoResult = (IQ) PacketParserUtils.parseStanza(getBlockingListIQResponse);
|
||||
IQ iqInfoResult = PacketParserUtils.parseStanza(getBlockingListIQResponse);
|
||||
MUCLightBlockingIQ mucLightBlockingIQ = (MUCLightBlockingIQ) iqInfoResult;
|
||||
|
||||
Assert.assertEquals(2, mucLightBlockingIQ.getRooms().size());
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
public class MUCLightChangeAffiliationsIQTest {
|
||||
|
||||
String stanza = "<iq " + "to='coven@muclight.shakespeare.lit' id='member1' type='set'>"
|
||||
private static final String stanza = "<iq " + "to='coven@muclight.shakespeare.lit' id='member1' type='set'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#affiliations'>"
|
||||
+ "<user affiliation='owner'>sarasa2@shakespeare.lit</user>"
|
||||
+ "<user affiliation='member'>sarasa1@shakespeare.lit</user>"
|
||||
|
|
|
|||
|
|
@ -26,23 +26,23 @@ import org.junit.Test;
|
|||
|
||||
public class MUCLightConfigurationsChangeExtensionTest {
|
||||
|
||||
String messageWithSubjectChangeExample = "<message to='crone1@shakespeare.lit' from='coven@muclight.shakespeare.lit' id='newsubject' type='groupchat'>"
|
||||
private static final String messageWithSubjectChangeExample = "<message to='crone1@shakespeare.lit' from='coven@muclight.shakespeare.lit' id='newsubject' type='groupchat'>"
|
||||
+ "<body></body>" + "<x xmlns='urn:xmpp:muclight:0#configuration'>"
|
||||
+ "<prev-version>asdfghj000</prev-version>" + "<version>asdfghj</version>"
|
||||
+ "<subject>To be or not to be?</subject>" + "</x>" + "</message>";
|
||||
|
||||
String messageWithRoomNameChangeExample = "<message to='crone1@shakespeare.lit' from='coven@muclight.shakespeare.lit' id='newsubject' type='groupchat'>"
|
||||
private static final String messageWithRoomNameChangeExample = "<message to='crone1@shakespeare.lit' from='coven@muclight.shakespeare.lit' id='newsubject' type='groupchat'>"
|
||||
+ "<body></body>" + "<x xmlns='urn:xmpp:muclight:0#configuration'>" + "<prev-version>zaqwsx</prev-version>"
|
||||
+ "<version>zxcvbnm</version>" + "<roomname>A Darker Cave</roomname>" + "</x>" + "</message>";
|
||||
|
||||
String messageWithConfigsChangeExample = "<message to='crone1@shakespeare.lit' from='coven@muclight.shakespeare.lit' id='newsubject' type='groupchat'>"
|
||||
private static final String messageWithConfigsChangeExample = "<message to='crone1@shakespeare.lit' from='coven@muclight.shakespeare.lit' id='newsubject' type='groupchat'>"
|
||||
+ "<body></body>" + "<x xmlns='urn:xmpp:muclight:0#configuration'>" + "<prev-version>zaqwsx</prev-version>"
|
||||
+ "<version>zxcvbnm</version>" + "<roomname>A Darker Cave</roomname>" + "<color>blue</color>" + "</x>"
|
||||
+ "</message>";
|
||||
|
||||
@Test
|
||||
public void checkSubjectChangeExtension() throws Exception {
|
||||
Message configurationsMessage = (Message) PacketParserUtils.parseStanza(messageWithSubjectChangeExample);
|
||||
Message configurationsMessage = PacketParserUtils.parseStanza(messageWithSubjectChangeExample);
|
||||
ConfigurationsChangeExtension configurationsChangeExtension = ConfigurationsChangeExtension
|
||||
.from(configurationsMessage);
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ public class MUCLightConfigurationsChangeExtensionTest {
|
|||
|
||||
@Test
|
||||
public void checkRoomNameChangeExtension() throws Exception {
|
||||
Message configurationsMessage = (Message) PacketParserUtils.parseStanza(messageWithRoomNameChangeExample);
|
||||
Message configurationsMessage = PacketParserUtils.parseStanza(messageWithRoomNameChangeExample);
|
||||
ConfigurationsChangeExtension configurationsChangeExtension = ConfigurationsChangeExtension
|
||||
.from(configurationsMessage);
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ public class MUCLightConfigurationsChangeExtensionTest {
|
|||
|
||||
@Test
|
||||
public void checkConfigsChangeExtension() throws Exception {
|
||||
Message configurationsMessage = (Message) PacketParserUtils.parseStanza(messageWithConfigsChangeExample);
|
||||
Message configurationsMessage = PacketParserUtils.parseStanza(messageWithConfigsChangeExample);
|
||||
ConfigurationsChangeExtension configurationsChangeExtension = ConfigurationsChangeExtension
|
||||
.from(configurationsMessage);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
public class MUCLightCreateIQTest {
|
||||
|
||||
String stanza = "<iq to='ef498f55-5f79-4238-a5ae-4efe19cbe617@muclight.test.com' id='1c72W-50' type='set'>"
|
||||
private static final String stanza = "<iq to='ef498f55-5f79-4238-a5ae-4efe19cbe617@muclight.test.com' id='1c72W-50' type='set'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#create'>" + "<configuration>" + "<roomname>test</roomname>"
|
||||
+ "</configuration>" + "<occupants>" + "<user affiliation='member'>charlie@test.com</user>"
|
||||
+ "<user affiliation='member'>pep@test.com</user>" + "</occupants>" + "</query>" + "</iq>";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
public class MUCLightDestroyTest {
|
||||
|
||||
String stanza = "<iq to='coven@muclight.shakespeare.lit' id='destroy1' type='set'>"
|
||||
private static final String stanza = "<iq to='coven@muclight.shakespeare.lit' id='destroy1' type='set'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#destroy'/>" + "</iq>";
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
public class MUCLightGetAffiliationsTest {
|
||||
|
||||
String getAffiliationsIQExample = "<iq to='coven@muclight.shakespeare.lit' id='getmembers' type='get'>"
|
||||
private static final String getAffiliationsIQExample = "<iq to='coven@muclight.shakespeare.lit' id='getmembers' type='get'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#affiliations'>" + "<version>abcdefg</version>" + "</query>" + "</iq>";
|
||||
|
||||
String getAffiliationsResponseExample = "<iq from='coven@muclight.shakespeare.lit' id='getmembers' to='crone1@shakespeare.lit/desktop' type='result'>"
|
||||
private static final String getAffiliationsResponseExample = "<iq from='coven@muclight.shakespeare.lit' id='getmembers' to='crone1@shakespeare.lit/desktop' type='result'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#affiliations'>" + "<version>123456</version>"
|
||||
+ "<user affiliation='owner'>user1@shakespeare.lit</user>"
|
||||
+ "<user affiliation='member'>user2@shakespeare.lit</user>"
|
||||
|
|
@ -50,7 +50,7 @@ public class MUCLightGetAffiliationsTest {
|
|||
|
||||
@Test
|
||||
public void checkGetAffiliationsResponse() throws Exception {
|
||||
IQ iqInfoResult = (IQ) PacketParserUtils.parseStanza(getAffiliationsResponseExample);
|
||||
IQ iqInfoResult = PacketParserUtils.parseStanza(getAffiliationsResponseExample);
|
||||
MUCLightAffiliationsIQ mucLightAffiliationsIQ = (MUCLightAffiliationsIQ) iqInfoResult;
|
||||
|
||||
Assert.assertEquals("123456", mucLightAffiliationsIQ.getVersion());
|
||||
|
|
|
|||
|
|
@ -30,15 +30,15 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
public class MUCLightGetConfigsTest {
|
||||
|
||||
String getConfigsIQExample = "<iq to='coven@muclight.shakespeare.lit' id='config0' type='get'>"
|
||||
private static final String getConfigsIQExample = "<iq to='coven@muclight.shakespeare.lit' id='config0' type='get'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#configuration'>" + "<version>abcdefg</version>" + "</query>" + "</iq>";
|
||||
|
||||
String getConfigsResponseExample = "<iq from='coven@muclight.shakespeare.lit' id='getconfig1' "
|
||||
private static final String getConfigsResponseExample = "<iq from='coven@muclight.shakespeare.lit' id='getconfig1' "
|
||||
+ "to='crone1@shakespeare.lit/desktop' type='result'>" + "<query xmlns='urn:xmpp:muclight:0#configuration'>"
|
||||
+ "<version>123456</version>" + "<roomname>A Dark Cave</roomname>" + "<subject>A subject</subject>"
|
||||
+ "</query>" + "</iq>";
|
||||
|
||||
String getConfigsResponseExampleWithCustomConfigs = "<iq from='coven@muclight.shakespeare.lit' id='getconfig2' "
|
||||
private static final String getConfigsResponseExampleWithCustomConfigs = "<iq from='coven@muclight.shakespeare.lit' id='getconfig2' "
|
||||
+ "to='crone1@shakespeare.lit/desktop' type='result'>" + "<query xmlns='urn:xmpp:muclight:0#configuration'>"
|
||||
+ "<version>123456</version>" + "<roomname>A Dark Cave</roomname>" + "<color>blue</color>"
|
||||
+ "<size>20</size>" + "</query>" + "</iq>";
|
||||
|
|
@ -53,7 +53,7 @@ public class MUCLightGetConfigsTest {
|
|||
|
||||
@Test
|
||||
public void checkGetConfigsResponse() throws Exception {
|
||||
IQ iqInfoResult = (IQ) PacketParserUtils.parseStanza(getConfigsResponseExample);
|
||||
IQ iqInfoResult = PacketParserUtils.parseStanza(getConfigsResponseExample);
|
||||
MUCLightConfigurationIQ mucLightConfigurationIQ = (MUCLightConfigurationIQ) iqInfoResult;
|
||||
|
||||
Assert.assertEquals("123456", mucLightConfigurationIQ.getVersion());
|
||||
|
|
@ -64,7 +64,7 @@ public class MUCLightGetConfigsTest {
|
|||
|
||||
@Test
|
||||
public void checkGetConfigsResponseWithCustomConfigs() throws Exception {
|
||||
IQ iqInfoResult = (IQ) PacketParserUtils.parseStanza(getConfigsResponseExampleWithCustomConfigs);
|
||||
IQ iqInfoResult = PacketParserUtils.parseStanza(getConfigsResponseExampleWithCustomConfigs);
|
||||
MUCLightConfigurationIQ mucLightConfigurationIQ = (MUCLightConfigurationIQ) iqInfoResult;
|
||||
|
||||
Assert.assertEquals("123456", mucLightConfigurationIQ.getVersion());
|
||||
|
|
|
|||
|
|
@ -28,13 +28,13 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
public class MUCLightInfoTest {
|
||||
|
||||
String exampleWithVersion = "<iq to='coven@muclight.shakespeare.lit' id='getinfo1' type='get'>"
|
||||
private static final String exampleWithVersion = "<iq to='coven@muclight.shakespeare.lit' id='getinfo1' type='get'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#info'>" + "<version>abcdefg</version>" + "</query>" + "</iq>";
|
||||
|
||||
String exampleWithoutVersion = "<iq to='coven@muclight.shakespeare.lit' id='getinfo1' type='get'>"
|
||||
private static final String exampleWithoutVersion = "<iq to='coven@muclight.shakespeare.lit' id='getinfo1' type='get'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#info'>" + "</query>" + "</iq>";
|
||||
|
||||
String exampleInfoResult = "<iq from='coven@muclight.shakespeare.lit' to='cronel@shakespeare.lit/desktop' id='getinfo1' type='result'>"
|
||||
private static final String exampleInfoResult = "<iq from='coven@muclight.shakespeare.lit' to='cronel@shakespeare.lit/desktop' id='getinfo1' type='result'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#info'>" + "<version>123456</version>" + "<configuration>"
|
||||
+ "<roomname>test</roomname>" + "</configuration>" + "<occupants>"
|
||||
+ "<user affiliation='owner'>john@test.com</user>" + "<user affiliation='member'>charlie@test.com</user>"
|
||||
|
|
@ -58,7 +58,7 @@ public class MUCLightInfoTest {
|
|||
|
||||
@Test
|
||||
public void checkMUCLightInfoResult() throws Exception {
|
||||
IQ iqInfoResult = (IQ) PacketParserUtils.parseStanza(exampleInfoResult);
|
||||
IQ iqInfoResult = PacketParserUtils.parseStanza(exampleInfoResult);
|
||||
MUCLightInfoIQ mucLightInfoResponseIQ = (MUCLightInfoIQ) iqInfoResult;
|
||||
Assert.assertEquals(mucLightInfoResponseIQ.getVersion(), "123456");
|
||||
Assert.assertEquals(mucLightInfoResponseIQ.getConfiguration().getRoomName(), "test");
|
||||
|
|
|
|||
|
|
@ -26,15 +26,15 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
public class MUCLightSetConfigsIQTest {
|
||||
|
||||
String setConfigsIQExample = "<iq to='coven@muclight.shakespeare.lit' id='conf1' type='set'>"
|
||||
private static final String setConfigsIQExample = "<iq to='coven@muclight.shakespeare.lit' id='conf1' type='set'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#configuration'>" + "<roomname>A Darker Cave</roomname>"
|
||||
+ "<color>blue</color>" + "</query>" + "</iq>";
|
||||
|
||||
String changeRoomNameIQExample = "<iq to='coven@muclight.shakespeare.lit' id='roomName1' type='set'>"
|
||||
private static final String changeRoomNameIQExample = "<iq to='coven@muclight.shakespeare.lit' id='roomName1' type='set'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#configuration'>" + "<roomname>A Darker Cave</roomname>" + "</query>"
|
||||
+ "</iq>";
|
||||
|
||||
String changeSubjectIQExample = "<iq to='coven@muclight.shakespeare.lit' id='subject1' type='set'>"
|
||||
private static final String changeSubjectIQExample = "<iq to='coven@muclight.shakespeare.lit' id='subject1' type='set'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#configuration'>" + "<subject>To be or not to be?</subject>"
|
||||
+ "</query>" + "</iq>";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue