Search in sources :

Example 6 with UserTuneElement

use of org.jivesoftware.smackx.usertune.element.UserTuneElement in project Smack by igniterealtime.

the class UserTuneElementTest method toXmlTest.

@Test
public void toXmlTest() throws IOException, XmlPullParserException, SmackParsingException, URISyntaxException {
    URI uri = new URI("http://www.yesworld.com/lyrics/Fragile.html#9");
    UserTuneElement.Builder builder = UserTuneElement.getBuilder();
    UserTuneElement userTuneElement = builder.setArtist("Yes").setLength(686).setRating(8).setSource("Yessongs").setTitle("Heart of the Sunrise").setTrack("3").setUri(uri).build();
    assertXmlSimilar(xml, userTuneElement.toXML().toString());
}
Also used : UserTuneElement(org.jivesoftware.smackx.usertune.element.UserTuneElement) URI(java.net.URI) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 7 with UserTuneElement

use of org.jivesoftware.smackx.usertune.element.UserTuneElement in project Smack by igniterealtime.

the class UserTuneElementTest method userTuneElementProviderTest.

@ParameterizedTest
@EnumSource(value = SmackTestUtil.XmlPullParserKind.class)
public void userTuneElementProviderTest(XmlPullParserKind parserKind) throws XmlPullParserException, IOException, SmackParsingException {
    XmlPullParser parser = SmackTestUtil.getParserFor(xml, parserKind);
    UserTuneElement parsed = UserTuneProvider.INSTANCE.parse(parser);
    assertXmlSimilar(xml, parsed.toXML().toString());
}
Also used : UserTuneElement(org.jivesoftware.smackx.usertune.element.UserTuneElement) XmlPullParser(org.jivesoftware.smack.xml.XmlPullParser) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

UserTuneElement (org.jivesoftware.smackx.usertune.element.UserTuneElement)7 URI (java.net.URI)6 TimeoutException (java.util.concurrent.TimeoutException)4 AbstractSmackIntegrationTest (org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest)4 SmackIntegrationTestEnvironment (org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment)4 AfterClass (org.igniterealtime.smack.inttest.annotations.AfterClass)4 SmackIntegrationTest (org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest)4 IntegrationTestRosterUtil (org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil)4 SimpleResultSyncPoint (org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint)4 SmackException (org.jivesoftware.smack.SmackException)4 NotLoggedInException (org.jivesoftware.smack.SmackException.NotLoggedInException)4 XMPPException (org.jivesoftware.smack.XMPPException)4 EntityCapabilitiesChangedListener (org.jivesoftware.smackx.disco.EntityCapabilitiesChangedListener)4 ServiceDiscoveryManager (org.jivesoftware.smackx.disco.ServiceDiscoveryManager)4 PepEventListener (org.jivesoftware.smackx.pep.PepEventListener)4 Assertions (org.junit.jupiter.api.Assertions)4 Test (org.junit.jupiter.api.Test)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 Message (org.jivesoftware.smack.packet.Message)1 XmlPullParser (org.jivesoftware.smack.xml.XmlPullParser)1