Package com.ngt.jopenmetaverse.shared.structureddata

Examples of com.ngt.jopenmetaverse.shared.structureddata.OSDUri


  @Test
  public void DeserializeURI() throws URISyntaxException
  {
    OSD theSD = null;
    OSDArray array = null;
    OSDUri tempURI = null;

    String testSD = "<?xml version='1.0' encoding='UTF-8'?> \n" +
        "<llsd> \n" +
        "<array> \n" +
        "  <uri>http://sim956.agni.lindenlab.com:12035/runtime/agents</uri> \n" +
        "   <uri/> \n" +
        "</array> \n" +
        "</llsd>";
    //Deserialize the string
    byte[] bytes = Utils.stringToBytes(testSD);
    theSD =XmlLLSDOSDParser.DeserializeLLSDXml(bytes);

    Assert.assertTrue(theSD instanceof OSDArray);
    array = (OSDArray)theSD;

    Assert.assertEquals(OSDType.URI, array.get(0).getType());
    tempURI = (OSDUri)array.get(0);
    URI testURI = new URI("http://sim956.agni.lindenlab.com:12035/runtime/agents");
    Assert.assertEquals(testURI, tempURI.asUri());

    Assert.assertEquals(OSDType.URI, array.get(1).getType());
    tempURI = (OSDUri)array.get(1);
    Assert.assertEquals("", tempURI.asUri().toString());
  }
View Full Code Here


  @Test
  public void DeserializeURI() throws URISyntaxException
  {
    OSD theSD = null;
    OSDArray array = null;
    OSDUri tempURI = null;

    String testSD = "[ \n" +
        "[ \n" +
        "\"http://sim956.agni.lindenlab.com:12035/runtime/agents\" \n" +
//        "\"\" \n" +
        "] \n" +
        "]";
    //Deserialize the string
    byte[] bytes = Utils.stringToBytes(testSD);
    theSD =JsonLLSDOSDParser.DeserializeLLSDJson(bytes);

    Assert.assertTrue(theSD instanceof OSDArray);
    array = (OSDArray)theSD;

    Assert.assertEquals(OSDType.URI, array.get(0).getType());
    tempURI = (OSDUri)array.get(0);
    URI testURI = new URI("http://sim956.agni.lindenlab.com:12035/runtime/agents");
    Assert.assertEquals(testURI, tempURI.asUri());

//    Assert.assertEquals(OSDType.URI, array.get(1).getType());
//    tempURI = (OSDUri)array.get(1);
//    Assert.assertEquals("", tempURI.asUri().toString());
  }
View Full Code Here

TOP

Related Classes of com.ngt.jopenmetaverse.shared.structureddata.OSDUri

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.