Package rocks.xmpp.extensions.activity.model

Examples of rocks.xmpp.extensions.activity.model.Activity


                "    <partying/>\n" +
                "  </relaxing>\n" +
                "  <text xml:lang='en'>My nurse&apos;s birthday!</text>\n" +
                "</activity>";

        Activity activity = unmarshal(xml, Activity.class);
        Assert.assertNotNull(activity);
        Assert.assertEquals(activity.getText(), "My nurse's birthday!");
        Assert.assertEquals(activity.getCategory(), Category.RELAXING);
        Assert.assertTrue(activity.getSpecificActivity() instanceof SpecificActivity.Partying);
    }
View Full Code Here


                "    <sleeping>\n" +
                "      <hibernating xmlns='http://www.ursus.info/states'/>\n" +
                "    </sleeping>\n" +
                "  </inactive>\n" +
                "</activity>";
        Activity activity = unmarshal(xml, Activity.class);
        Assert.assertNotNull(activity);
        Assert.assertEquals(activity.getCategory(), Category.INACTIVE);
        Assert.assertTrue(activity.getSpecificActivity() instanceof SpecificActivity.Sleeping);
        Assert.assertNull(activity.getSpecificActivity().getSpecificActivity());
    }
View Full Code Here

    }


    @Test
    public void marshalDoingChores() throws JAXBException, XMLStreamException {
        String xml = marshal(new Activity(Category.DOING_CHORES));
        Assert.assertEquals(xml, "<activity xmlns=\"http://jabber.org/protocol/activity\"><doing_chores></doing_chores></activity>");
    }
View Full Code Here

        Assert.assertEquals(xml, "<activity xmlns=\"http://jabber.org/protocol/activity\"><doing_chores></doing_chores></activity>");
    }

    @Test
    public void marshalActivityWithText() throws JAXBException, XMLStreamException {
        String xml = marshal(new Activity(Category.DOING_CHORES, "test"));
        Assert.assertEquals(xml, "<activity xmlns=\"http://jabber.org/protocol/activity\"><doing_chores></doing_chores><text>test</text></activity>");
    }
View Full Code Here

        String xml = "<activity xmlns='http://jabber.org/protocol/activity'>\n" +
                "  <drinking>\n" +
                "    <partying/>\n" +
                "  </drinking>\n" +
                "</activity>";
        Activity activity = unmarshal(xml, Activity.class);
        Assert.assertNotNull(activity);
        Assert.assertEquals(activity.getCategory(), Category.DRINKING);
    }
View Full Code Here

        String xml = "<activity xmlns='http://jabber.org/protocol/activity'>\n" +
                "  <eating>\n" +
                "    <partying/>\n" +
                "  </eating>\n" +
                "</activity>";
        Activity activity = unmarshal(xml, Activity.class);
        Assert.assertNotNull(activity);
        Assert.assertEquals(activity.getCategory(), Category.EATING);
    }
View Full Code Here

        String xml = "<activity xmlns='http://jabber.org/protocol/activity'>\n" +
                "  <grooming>\n" +
                "    <partying/>\n" +
                "  </grooming>\n" +
                "</activity>";
        Activity activity = unmarshal(xml, Activity.class);
        Assert.assertNotNull(activity);
        Assert.assertEquals(activity.getCategory(), Category.GROOMING);
    }
View Full Code Here

        String xml = "<activity xmlns='http://jabber.org/protocol/activity'>\n" +
                "  <having_appointment>\n" +
                "    <partying/>\n" +
                "  </having_appointment>\n" +
                "</activity>";
        Activity activity = unmarshal(xml, Activity.class);
        Assert.assertNotNull(activity);
        Assert.assertEquals(activity.getCategory(), Category.HAVING_APPOINTMENT);
    }
View Full Code Here

        String xml = "<activity xmlns='http://jabber.org/protocol/activity'>\n" +
                "  <inactive>\n" +
                "    <partying/>\n" +
                "  </inactive>\n" +
                "</activity>";
        Activity activity = unmarshal(xml, Activity.class);
        Assert.assertNotNull(activity);
        Assert.assertEquals(activity.getCategory(), Category.INACTIVE);
    }
View Full Code Here

        String xml = "<activity xmlns='http://jabber.org/protocol/activity'>\n" +
                "  <relaxing>\n" +
                "    <partying/>\n" +
                "  </relaxing>\n" +
                "</activity>";
        Activity activity = unmarshal(xml, Activity.class);
        Assert.assertNotNull(activity);
        Assert.assertEquals(activity.getCategory(), Category.RELAXING);
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.activity.model.Activity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.