Examples of GWC


Examples of org.geoserver.gwc.GWC

                enabled);
        assertEquals(!enabled, gwc.getConfig().isWMSCEnabled());
    }

    @Test public void testEditEnableWMTS() {
        GWC gwc = GWC.get();
        boolean enabled = gwc.getConfig().isWMTSEnabled();
        testEditCheckboxOption("form:gwcServicesPanel:enableWMTS", "gwcServicesPanel:enableWMTS",
                enabled);
        assertEquals(!enabled, gwc.getConfig().isWMTSEnabled());
    }
View Full Code Here

Examples of org.geoserver.gwc.GWC

        assertEquals(!enabled, gwc.getConfig().isWMTSEnabled());
    }

    @Test
    public void testEditEnableTMS() {
        GWC gwc = GWC.get();
        boolean enabled = gwc.getConfig().isTMSEnabled();
        testEditCheckboxOption("form:gwcServicesPanel:enableTMS", "gwcServicesPanel:enableTMS",
                enabled);
        assertEquals(!enabled, gwc.getConfig().isTMSEnabled());
    }
View Full Code Here

Examples of org.geoserver.gwc.GWC

        assertEquals(!enabled, gwc.getConfig().isTMSEnabled());
    }

    @Test
    public void testEnableCacheLayersByDefault() throws Exception {
        GWC gwc = GWC.get();
        GWCConfig config = gwc.getConfig();
        config.setCacheLayersByDefault(false);
        gwc.saveConfig(config);
        assertFalse(gwc.getConfig().isCacheLayersByDefault());

        testEditCheckboxOption("form:cachingOptionsPanel:cacheLayersByDefault",
                "cachingOptionsPanel:cacheLayersByDefault", false);

        assertTrue(gwc.getConfig().isCacheLayersByDefault());
    }
View Full Code Here

Examples of org.geoserver.gwc.GWC

        assertTrue(gwc.getConfig().isCacheLayersByDefault());
    }

    @Test
    public void testDisableCacheLayersByDefault() throws Exception {
        GWC gwc = GWC.get();
        GWCConfig config = gwc.getConfig();
        config.setCacheLayersByDefault(true);
        gwc.saveConfig(config);
        assertTrue(gwc.getConfig().isCacheLayersByDefault());

        testEditCheckboxOption("form:cachingOptionsPanel:cacheLayersByDefault",
                "cachingOptionsPanel:cacheLayersByDefault", true);

        assertFalse(gwc.getConfig().isCacheLayersByDefault());
    }
View Full Code Here

Examples of org.geoserver.gwc.GWC

        assertFalse(gwc.getConfig().isCacheLayersByDefault());
    }

    @Test
    public void testEnableAutoCacheStyles() throws Exception {
        GWC gwc = GWC.get();
        GWCConfig config = gwc.getConfig();
        config.setCacheLayersByDefault(true);
        config.setCacheNonDefaultStyles(false);
        gwc.saveConfig(config);
        assertFalse(gwc.getConfig().isCacheNonDefaultStyles());

        testEditCheckboxOption("form:cachingOptionsPanel:container:configs:cacheNonDefaultStyles",
                "cachingOptionsPanel:container:configs:cacheNonDefaultStyles", false);

        assertTrue(gwc.getConfig().isCacheNonDefaultStyles());
    }
View Full Code Here

Examples of org.geoserver.gwc.GWC

        assertTrue(gwc.getConfig().isCacheNonDefaultStyles());
    }

    @Test
    public void testDisableAutoCacheStyles() throws Exception {
        GWC gwc = GWC.get();
        GWCConfig config = gwc.getConfig();
        config.setCacheLayersByDefault(true);
        config.setCacheNonDefaultStyles(true);
        gwc.saveConfig(config);
        assertTrue(gwc.getConfig().isCacheNonDefaultStyles());

        testEditCheckboxOption("form:cachingOptionsPanel:container:configs:cacheNonDefaultStyles",
                "cachingOptionsPanel:container:configs:cacheNonDefaultStyles", true);

        assertFalse(gwc.getConfig().isCacheNonDefaultStyles());
    }
View Full Code Here

Examples of org.geoserver.gwc.GWC

        assertFalse(gwc.getConfig().isCacheNonDefaultStyles());
    }

    @Test
    public void testSetDefaultCacheFormats() throws Exception {
        GWC gwc = GWC.get();
        GWCConfig config = gwc.getConfig();
        config.setCacheLayersByDefault(true);
        gwc.saveConfig(config);

        GWCSettingsPage page = new GWCSettingsPage();
        tester.startPage(page);
        // print(page, true, true);
        tester.assertRenderedPage(GWCSettingsPage.class);

        final List<String> formats = newArrayList("image/png", "image/png8", "image/jpeg",
                "image/gif");

        tester.assertListView(
                "form:cachingOptionsPanel:container:configs:vectorFormatsGroup:vectorFromats",
                formats);
        tester.assertListView(
                "form:cachingOptionsPanel:container:configs:rasterFormatsGroup:rasterFromats",
                formats);
        tester.assertListView(
                "form:cachingOptionsPanel:container:configs:otherFormatsGroup:otherFromats",
                formats);

        FormTester form = tester.newFormTester("form");
        final boolean replace = true;// tell selectMultiple to first set all options to false
        form.selectMultiple("cachingOptionsPanel:container:configs:vectorFormatsGroup", new int[] {
                1, 3 }, replace);
        form.selectMultiple("cachingOptionsPanel:container:configs:rasterFormatsGroup", new int[] {
                1, 3 }, replace);
        form.selectMultiple("cachingOptionsPanel:container:configs:otherFormatsGroup", new int[] {
                1, 3 }, replace);
        // print(page, true, true);
        form.submit("submit");

        tester.assertRenderedPage(GeoServerHomePage.class);

        Set<String> expected = newHashSet(formats.get(1), formats.get(3));
        assertEquals(expected, gwc.getConfig().getDefaultVectorCacheFormats());
        assertEquals(expected, gwc.getConfig().getDefaultCoverageCacheFormats());
        assertEquals(expected, gwc.getConfig().getDefaultOtherCacheFormats());
    }
View Full Code Here

Examples of org.geoserver.gwc.GWC

        tester.assertRenderedPage(GeoServerHomePage.class);
    }
   
    @Test
    public void testEditLockProvider() {
        GWC gwc = GWC.get();
        ConfigurableLockProvider lockProvider = (ConfigurableLockProvider) gwc.getLockProvider();
        assertTrue(lockProvider.getDelegate() instanceof MemoryLockProvider);
       
        GWCSettingsPage page = new GWCSettingsPage();
        tester.startPage(page);
        tester.assertRenderedPage(GWCSettingsPage.class);
       
        // determine in a future proof way which item contains nioLock
        DropDownChoice lockDropDown = (DropDownChoice) tester.getComponentFromLastRenderedPage("form:cachingOptionsPanel:container:configs:lockProvider");
        List choices = lockDropDown.getChoices();
        int nioLockIndex = -1;
        for (int i = 0; i < choices.size(); i++) {
            if("nioLock".equals(choices.get(i))) {
                nioLockIndex = i;
                break;
            }
        }
        assertTrue(nioLockIndex >= 0);
       
        FormTester form = tester.newFormTester("form");
        form.select("cachingOptionsPanel:container:configs:lockProvider", nioLockIndex);
        form.submit("submit");
       
        tester.assertNoErrorMessage();
       
        // check the lock provider has been changed
        lockProvider = (ConfigurableLockProvider) gwc.getLockProvider();
        assertTrue(lockProvider.getDelegate() instanceof NIOLockProvider);
    }
View Full Code Here

Examples of org.geoserver.gwc.GWC

        assertTrue(lockProvider.getDelegate() instanceof NIOLockProvider);
    }

    @Test
    public void testNewDefaultGridSet() throws IOException {
        GWC gwc = GWC.get();
        GWCConfig config = gwc.getConfig();
        config.setCacheLayersByDefault(true);
        gwc.saveConfig(config);
        // Creation of a new page to test
        GWCSettingsPage page = new GWCSettingsPage();
        // Start the page
        tester.startPage(page);
        // Ensure the page is correctly rendered
View Full Code Here

Examples of org.geoserver.gwc.GWC

        assertEquals(info.isEnabled(), actual.isEnabled());
    }

    @Test
    public void testSaveNew() {
        GWC mediator = GWC.get();
        mediator.removeTileLayers(Arrays.asList(tileLayerModel.getObject().getName()));

        assertNull(mediator.getTileLayer(layerModel.getObject()));

        GeoServerTileLayerInfo newInfo = TileLayerInfoUtil.loadOrCreate(layerModel.getObject(),
                mediator.getConfig());

        tileLayerModel = new GeoServerTileLayerInfoModel(newInfo, true);

        tester.startPage(new FormTestPage(new ComponentBuilder() {
            private static final long serialVersionUID = -6705646666953650890L;

            public Component buildComponent(final String id) {
                return new LayerCacheOptionsTabPanel(id, layerModel, tileLayerModel);
            }
        }));

        tester.assertComponent("form:panel", LayerCacheOptionsTabPanel.class);

        LayerCacheOptionsTabPanel panel = (LayerCacheOptionsTabPanel) tester
                .getComponentFromLastRenderedPage("form:panel");

        panel.save();

        assertNotNull(mediator.getTileLayer(layerModel.getObject()));
    }
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.