Package org.eclipse.orion.server.core.resources

Examples of org.eclipse.orion.server.core.resources.ResourceShape.addProperty()


  public void testSerializeSingleProperty() throws Exception {
    // given
    TestResource testResource = new TestResource();
    Serializer<JSONObject> jsonSerializer = new JSONSerializer();
    ResourceShape resourceShape = new ResourceShape();
    resourceShape.addProperty(TestResource.STRING_PROPERTY);

    // when
    JSONObject jsonObject = jsonSerializer.serialize(testResource, resourceShape);
    String jsonString = jsonObject.toString();
    jsonObject = new JSONObject(jsonString);
View Full Code Here


  public void testSerializeInvalidProperty() throws Exception {
    // given
    TestResource testResource = new TestResource();
    Serializer<JSONObject> jsonSerializer = new JSONSerializer();
    ResourceShape resourceShape = new ResourceShape();
    resourceShape.addProperty(new Property("invalid"));

    // when
    jsonSerializer.serialize(testResource, resourceShape);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.