Search in sources :

Example 1 with ConfigurationsChangeExtension

use of org.jivesoftware.smackx.muclight.element.MUCLightElements.ConfigurationsChangeExtension in project Smack by igniterealtime.

the class MUCLightConfigurationsChangeExtensionTest method checkRoomNameChangeExtension.

@Test
public void checkRoomNameChangeExtension() throws Exception {
    Message configurationsMessage = (Message) PacketParserUtils.parseStanza(messageWithRoomNameChangeExample);
    ConfigurationsChangeExtension configurationsChangeExtension = ConfigurationsChangeExtension.from(configurationsMessage);
    Assert.assertEquals("zaqwsx", configurationsChangeExtension.getPrevVersion());
    Assert.assertEquals("zxcvbnm", configurationsChangeExtension.getVersion());
    Assert.assertEquals("A Darker Cave", configurationsChangeExtension.getRoomName());
    Assert.assertNull(configurationsChangeExtension.getSubject());
    Assert.assertNull(configurationsChangeExtension.getCustomConfigs());
    Assert.assertEquals(messageWithRoomNameChangeExample, configurationsMessage.toXML().toString());
}
Also used : Message(org.jivesoftware.smack.packet.Message) ConfigurationsChangeExtension(org.jivesoftware.smackx.muclight.element.MUCLightElements.ConfigurationsChangeExtension) Test(org.junit.Test)

Example 2 with ConfigurationsChangeExtension

use of org.jivesoftware.smackx.muclight.element.MUCLightElements.ConfigurationsChangeExtension in project Smack by igniterealtime.

the class MUCLightConfigurationsChangeExtensionTest method checkSubjectChangeExtension.

@Test
public void checkSubjectChangeExtension() throws Exception {
    Message configurationsMessage = (Message) PacketParserUtils.parseStanza(messageWithSubjectChangeExample);
    ConfigurationsChangeExtension configurationsChangeExtension = ConfigurationsChangeExtension.from(configurationsMessage);
    Assert.assertEquals("asdfghj000", configurationsChangeExtension.getPrevVersion());
    Assert.assertEquals("asdfghj", configurationsChangeExtension.getVersion());
    Assert.assertEquals("To be or not to be?", configurationsChangeExtension.getSubject());
    Assert.assertNull(configurationsChangeExtension.getRoomName());
    Assert.assertNull(configurationsChangeExtension.getCustomConfigs());
    Assert.assertEquals(messageWithSubjectChangeExample, configurationsMessage.toXML().toString());
}
Also used : Message(org.jivesoftware.smack.packet.Message) ConfigurationsChangeExtension(org.jivesoftware.smackx.muclight.element.MUCLightElements.ConfigurationsChangeExtension) Test(org.junit.Test)

Example 3 with ConfigurationsChangeExtension

use of org.jivesoftware.smackx.muclight.element.MUCLightElements.ConfigurationsChangeExtension in project Smack by igniterealtime.

the class MUCLightConfigurationsChangeExtensionTest method checkConfigsChangeExtension.

@Test
public void checkConfigsChangeExtension() throws Exception {
    Message configurationsMessage = (Message) PacketParserUtils.parseStanza(messageWithConfigsChangeExample);
    ConfigurationsChangeExtension configurationsChangeExtension = ConfigurationsChangeExtension.from(configurationsMessage);
    Assert.assertEquals("zaqwsx", configurationsChangeExtension.getPrevVersion());
    Assert.assertEquals("zxcvbnm", configurationsChangeExtension.getVersion());
    Assert.assertEquals("A Darker Cave", configurationsChangeExtension.getRoomName());
    Assert.assertNull(configurationsChangeExtension.getSubject());
    Assert.assertEquals("blue", configurationsChangeExtension.getCustomConfigs().get("color"));
    Assert.assertEquals(messageWithConfigsChangeExample, configurationsMessage.toXML().toString());
}
Also used : Message(org.jivesoftware.smack.packet.Message) ConfigurationsChangeExtension(org.jivesoftware.smackx.muclight.element.MUCLightElements.ConfigurationsChangeExtension) Test(org.junit.Test)

Aggregations

Message (org.jivesoftware.smack.packet.Message)3 ConfigurationsChangeExtension (org.jivesoftware.smackx.muclight.element.MUCLightElements.ConfigurationsChangeExtension)3 Test (org.junit.Test)3