Java 类org.jivesoftware.smack.packet.XMPPError.Type 实例源码

项目:Smack    文件:TestEvents.java   
public void testCreateAndGetNode() throws Exception
{
    String nodeId = "MyTestNode";
    PubSubManager creatorMgr = new PubSubManager(getConnection(0), getService());

    LeafNode creatorNode = null;
    try
    {
        creatorNode = (LeafNode)creatorMgr.getNode(nodeId);
    }
    catch (XMPPException e)
    {
        if (e.getXMPPError().getType() == Type.CANCEL && e.getXMPPError().getCondition().equals("item-not-found"))
            creatorNode = creatorMgr.createNode(nodeId);
        else
            throw e;
    }

    PubSubManager subMgr = new PubSubManager(getConnection(1), getService());
    LeafNode subNode = (LeafNode)subMgr.getNode(nodeId);

    assertNotNull(subNode);
}
项目:java-bells    文件:TestEvents.java   
public void testCreateAndGetNode() throws Exception
{
    String nodeId = "MyTestNode";
    PubSubManager creatorMgr = new PubSubManager(getConnection(0), getService());

    LeafNode creatorNode = null;
    try
    {
        creatorNode = (LeafNode)creatorMgr.getNode(nodeId);
    }
    catch (XMPPException e)
    {
        if (e.getXMPPError().getType() == Type.CANCEL && e.getXMPPError().getCondition().equals("item-not-found"))
            creatorNode = creatorMgr.createNode(nodeId);
        else
            throw e;
    }

    PubSubManager subMgr = new PubSubManager(getConnection(1), getService());
    LeafNode subNode = (LeafNode)subMgr.getNode(nodeId);

    assertNotNull(subNode);
}