	@Test
	public void readSpaceSinglePartitionTest(){

		space.getTypeManager().registerTypeDescriptor(new SpaceTypeDescriptorBuilder("test-type")
				.idProperty("id",false).addFixedProperty("val",String.class).create());
		space.clear(new Object());
		SpaceDocument d=new SpaceDocument("test-type");
		d.setProperty("id",0);
		d.setProperty("val","val0");
		space.write(d);
		d.setProperty("id",1);
		d.setProperty("val","val1");
		space.write(d);
		
		SpaceTaskAPIController controller=new SpaceTaskAPIController();
		SpaceTaskRequest body=new SpaceTaskRequest();
		
		body.language="groovy";
		body.target=0;
		body.code="import com.gigaspaces.document.*;"+
				"def newdoc=gigaSpace.read(new SpaceDocument(\"test-type\"));"+
				"return newdoc.getProperty(\"val\");";
		ModelAndView result=controller.executeTask("space","localhost",body);
		assertEquals(1,result.getModel().size());
		assertEquals(1,((List)result.getModel().get("results")).size());
		
		ObjectMapper om=new ObjectMapper();
		try{
		 System.out.println(om.writeValueAsString(result.getModel().get("results")));
		}catch(Exception e){
			e.printStackTrace();
		}
	}