Package org.geoserver.catalog

Examples of org.geoserver.catalog.Catalog.save()


    @Test
    public void testNamedLayerGroupInCapabilities() throws Exception {   
        Catalog cat = getCatalog();
        LayerGroupInfo layerGroup = cat.getLayerGroupByName("base");
        layerGroup.setMode(LayerGroupInfo.Mode.NAMED);
        cat.save(layerGroup);
        Document dom = getAsDOM("wms?request=getcapabilities&version=1.1.1");

        // check layer group is present
        assertXpathExists("/WMT_MS_Capabilities/Capability/Layer/Layer/Name[text() = 'base']", dom);
View Full Code Here


    @Test
    public void testContainerLayerGroupInCapabilities() throws Exception {   
        Catalog cat = getCatalog();
        LayerGroupInfo layerGroup = cat.getLayerGroupByName("base");
        layerGroup.setMode(LayerGroupInfo.Mode.CONTAINER);
        cat.save(layerGroup);
        Document dom = getAsDOM("wms?request=getcapabilities&version=1.1.1");
       
        // check layer group doesn't have a name but eventually a title
        assertXpathNotExists("/WMT_MS_Capabilities/Capability/Layer/Layer/Name[text() = 'base']", dom);
        assertXpathExists("/WMT_MS_Capabilities/Capability/Layer/Layer/Title[text() = 'title for layer group base default']", dom);
View Full Code Here

        Catalog cat = getCatalog();
        LayerGroupInfo layerGroup = cat.getLayerGroupByName("base");
        layerGroup.setMode(LayerGroupInfo.Mode.EO);
        layerGroup.setRootLayer(layer(cat, MockData.BUILDINGS));
        layerGroup.setRootLayerStyle(cat.getStyleByName("Buildings"));
        cat.save(layerGroup);
        Document dom = getAsDOM("wms?request=getcapabilities&version=1.1.1");
       
        // check layer group exists
        assertXpathExists("/WMT_MS_Capabilities/Capability/Layer/Layer/Name[text() = 'base']", dom);
View Full Code Here

    @Test
    public void testSharedLayersInCapabilities() throws Exception {
        Catalog cat = getCatalog();
        LayerGroupInfo global = cat.getLayerGroupByName("base");
        global.setMode(Mode.NAMED);
        cat.save(global);
        LayerGroupInfo global2 = cat.getLayerGroupByName("base2");
        global2.setMode(Mode.NAMED);
        cat.save(global2);

        Document dom = getAsDOM("wms?request=getcapabilities&version=1.1.1");
View Full Code Here

        LayerGroupInfo global = cat.getLayerGroupByName("base");
        global.setMode(Mode.NAMED);
        cat.save(global);
        LayerGroupInfo global2 = cat.getLayerGroupByName("base2");
        global2.setMode(Mode.NAMED);
        cat.save(global2);

        Document dom = getAsDOM("wms?request=getcapabilities&version=1.1.1");
        // print(dom);
       
        // check top level layer group exists
View Full Code Here

        nested = createLayerGroup(cat, "nested", "nested", layer(cat, MockData.BRIDGES), global);
        nested.setMode(Mode.NAMED);
        cat.add(nested);
        LayerGroupInfo global = cat.getLayerGroupByName("base");
        global.setMode(Mode.NAMED);
        cat.save(global);

        Document dom = getAsDOM("wms?request=getcapabilities&version=1.1.1");
        // print(dom);
       
        // check top level layer group exists
View Full Code Here

        nested = createLayerGroup(cat, "nested", "nested", layer(cat, MockData.BRIDGES), global);
        nested.setMode(Mode.NAMED);
        cat.add(nested);
        LayerGroupInfo global = cat.getLayerGroupByName("base");
        global.setMode(Mode.NAMED);
        cat.save(global);
       
        Document dom = getAsDOM("wms?request=reflect&layers=nested&format=rss");
        // print(dom);
       
        assertXpathExists("rss/channel/title[text() = 'cite:Bridges,cite:Lakes,cite:Forests']", dom);
View Full Code Here

    @Test
    public void testCascadeLayer() {
        Catalog catalog = createMock(Catalog.class);
        LayerGroupInfo lg = setUpMockLayerGroup(catalog);
        catalog.save(lg);
        expectLastCall();

        catalog.remove((LayerInfo) lg.getLayers().get(0));
        expectLastCall();
View Full Code Here

        expect(lakes.getResource()).andReturn(lakesFt).anyTimes();
       
        lakes.setDefaultStyle((StyleInfo)anyObject());
        expectLastCall();

        catalog.save(lakes);
        expectLastCall();

        LayerInfo buildings = createMock(LayerInfo.class);
        expect(buildings.getDefaultStyle()).andReturn(null).anyTimes();
        expect(buildings.getStyles()).andReturn(new HashSet<StyleInfo>(Arrays.asList(style))).anyTimes();
View Full Code Here

        LayerInfo buildings = createMock(LayerInfo.class);
        expect(buildings.getDefaultStyle()).andReturn(null).anyTimes();
        expect(buildings.getStyles()).andReturn(new HashSet<StyleInfo>(Arrays.asList(style))).anyTimes();

        catalog.save(buildings);
        expectLastCall();

        expect(catalog.getLayers()).andReturn(Arrays.asList(lakes, buildings)).anyTimes();
        expect(catalog.getLayerGroups()).andReturn(new ArrayList());
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.