Package com.boundlessgeo.geoserver.json

Examples of com.boundlessgeo.geoserver.json.JSONObj.str()


            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.APPLICATION_JSON))
            .andReturn();

        JSONObj obj = JSONWrapper.read(result.getResponse().getContentAsString()).toObject();
        assertEquals("foo", obj.str("name"));
        assertEquals("http://scratch.org", obj.str("uri"));
        assertTrue(obj.bool("default"));

        assertEquals(0, obj.integer("maps").intValue());
        assertEquals(1, obj.integer("layers").intValue());
View Full Code Here


            .andExpect(content().contentType(MediaType.APPLICATION_JSON))
            .andReturn();

        JSONObj obj = JSONWrapper.read(result.getResponse().getContentAsString()).toObject();
        assertEquals("foo", obj.str("name"));
        assertEquals("http://scratch.org", obj.str("uri"));
        assertTrue(obj.bool("default"));

        assertEquals(0, obj.integer("maps").intValue());
        assertEquals(1, obj.integer("layers").intValue());
        assertEquals(0, obj.integer("stores").intValue());
View Full Code Here

                .andExpect(status().isOk())
                .andExpect(content().contentType(MediaType.APPLICATION_JSON))
                .andReturn();

        obj = JSONWrapper.read(result.getResponse().getContentAsString()).toObject();
        assertEquals("bar", obj.str("name"));
        assertEquals("http://bar.org", obj.str("uri"));
        assertFalse(obj.bool("default"));
    }

    @Test
View Full Code Here

                .andExpect(content().contentType(MediaType.APPLICATION_JSON))
                .andReturn();

        obj = JSONWrapper.read(result.getResponse().getContentAsString()).toObject();
        assertEquals("bar", obj.str("name"));
        assertEquals("http://bar.org", obj.str("uri"));
        assertFalse(obj.bool("default"));
    }

    @Test
    public void testPost() throws Exception {
View Full Code Here

                .andExpect(status().isOk())
                .andExpect(content().contentType(MediaType.APPLICATION_JSON))
                .andReturn();

        JSONObj proj = JSONWrapper.read(result.getResponse().getContentAsString()).toObject();
        assertEquals("EPSG:3005", proj.str("srs"));
        assertNotNull(proj.str("wkt"));
    }

    @Test
    public void testRecent() throws Exception {
View Full Code Here

                .andExpect(content().contentType(MediaType.APPLICATION_JSON))
                .andReturn();

        JSONObj proj = JSONWrapper.read(result.getResponse().getContentAsString()).toObject();
        assertEquals("EPSG:3005", proj.str("srs"));
        assertNotNull(proj.str("wkt"));
    }

    @Test
    public void testRecent() throws Exception {
        MvcResult result = mvc.perform(get("/api/projections/recent"))
View Full Code Here

      assertEquals( 2, arr.size() );
      for( Iterator<Object> i = arr.iterator(); i.hasNext();){
          Object item = i.next();
          if( item instanceof JSONObj){
              JSONObj obj = (JSONObj) item;
              if(obj.str("name").equals("icon.png")){
                  assertEquals( "png", obj.get("format"));
                  assertEquals( "image/png", obj.get("mime"));
                  assertTrue( obj.str("url").endsWith("icon.png"));           
              }
          }
View Full Code Here

          if( item instanceof JSONObj){
              JSONObj obj = (JSONObj) item;
              if(obj.str("name").equals("icon.png")){
                  assertEquals( "png", obj.get("format"));
                  assertEquals( "image/png", obj.get("mime"));
                  assertTrue( obj.str("url").endsWith("icon.png"));           
              }
          }
      }
    }
View Full Code Here

                .andExpect(status().isOk())
                .andExpect(content().contentType(MediaType.APPLICATION_JSON))
                .andReturn();

        JSONObj obj = JSONWrapper.read(result.getResponse().getContentAsString()).toObject();
        assertEquals("map", obj.str("name"));
        assertEquals("foo", obj.str("workspace"));
        assertEquals("The map", obj.str("title"));
        assertEquals("This map is cool!", obj.str("description"));
       
        assertEquals(-180d, obj.object("bbox").doub("west"), 0.1);
View Full Code Here

                .andExpect(content().contentType(MediaType.APPLICATION_JSON))
                .andReturn();

        JSONObj obj = JSONWrapper.read(result.getResponse().getContentAsString()).toObject();
        assertEquals("map", obj.str("name"));
        assertEquals("foo", obj.str("workspace"));
        assertEquals("The map", obj.str("title"));
        assertEquals("This map is cool!", obj.str("description"));
       
        assertEquals(-180d, obj.object("bbox").doub("west"), 0.1);
        assertEquals(-90d, obj.object("bbox").doub("south"), 0.1);
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.