Package com.calclab.emite.core.stanzas

Examples of com.calclab.emite.core.stanzas.Presence


    assertEquals(Show.unknown, presence.getShow());
  }

  @Test
  public void shouldGetStatus() {
    Presence presence = new Presence();
    assertNull(presence.getStatus());
    presence = new Presence(XMLBuilder.create("presence").childText("status", "the status").getXML());
    assertEquals("the status", presence.getStatus());
  }
View Full Code Here


    assertEquals("the status", presence.getStatus());
  }

  @Test
  public void shouldGetType() {
    Presence presence = new Presence();
    assertEquals(null, presence.getType());
    presence = new Presence(XMLBuilder.create("presence").attribute("type", Type.probe.toString()).getXML());
    assertEquals(Type.probe, presence.getType());
    presence = new Presence(XMLBuilder.create("presence").attribute("type", "not valid").getXML());
    assertEquals(Type.error, presence.getType());
  }
View Full Code Here

    assertEquals(Type.error, presence.getType());
  }

  @Test
  public void shouldHandleNotSpecifiedPresence() {
    final Presence presence = new Presence();
    presence.setShow(Show.away);
    presence.setShow(null);
    assertEquals(Presence.Show.notSpecified, presence.getShow());
    assertEquals("<presence />", presence.toString());
  }
View Full Code Here

    assertEquals("<presence />", presence.toString());
  }

  @Test
  public void shouldSetPriority() {
    final Presence presence = new Presence();
    presence.setPriority(1);
    assertEquals(1, presence.getPriority());
  }
View Full Code Here

    assertEquals(1, presence.getPriority());
  }

  @Test
  public void shouldSetShow() {
    final Presence presence = new Presence();
    for (final Show value : Show.values()) {
      presence.setShow(value);
      if (value == Show.unknown) {
        assertEquals(Show.notSpecified, presence.getShow());
      } else {
        assertEquals(value, presence.getShow());
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.calclab.emite.core.stanzas.Presence

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.