Package org.cipango.kaleo.presence.pidf

Examples of org.cipango.kaleo.presence.pidf.Tuple


  public State getNeutralState()
  {
    PresenceDocument document = PresenceDocument.Factory.newInstance();
    Presence presence = document.addNewPresence();
    presence.setEntity(getUri());
    Tuple tuple = document.getPresence().addNewTuple();
    tuple.setId("123");
    tuple.addNewStatus().setBasic(Basic.CLOSED);
    return new State(PresenceEventPackage.PIDF, document);
  }
View Full Code Here


    PresenceDocument doc = (PresenceDocument) presentity.getState().getContent();
    assertEquals(presentity.getNeutralState().getContent().toString(),
        doc.toString());
   
    PresenceDocument doc1 = PresenceDocument.Factory.newInstance();
    Tuple tuple1 = doc1.addNewPresence().addNewTuple();
    tuple1.setId("tuple1");
    tuple1.addNewStatus().setBasic(Basic.OPEN);
    SoftState state1 = presentity.addState(PresenceEventPackage.PIDF, doc1, 60);
   
    doc = (PresenceDocument) presentity.getState().getContent();
    assertEquals(1, doc.getPresence().getTupleArray().length);
    assertEquals("tuple1",
        doc.getPresence().getTupleArray(0).getId());
    assertEquals(Basic.OPEN,
        doc.getPresence().getTupleArray(0).getStatus().getBasic());
   
    PresenceDocument doc2 = PresenceDocument.Factory.newInstance();
    Tuple tuple2 = doc2.addNewPresence().addNewTuple();
    tuple2.setId("tuple2");
    tuple2.addNewStatus().setBasic(Basic.CLOSED);
    SoftState state2 = presentity.addState(PresenceEventPackage.PIDF, doc2, 60);
   
    doc = (PresenceDocument) presentity.getState().getContent();
    assertEquals(2, doc.getPresence().getTupleArray().length);
    assertEquals("tuple1",
View Full Code Here

TOP

Related Classes of org.cipango.kaleo.presence.pidf.Tuple

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.