-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GEOS-8891] Make it possible to configure coordinates measures encodi…
…ng per layer
- Loading branch information
Showing
10 changed files
with
171 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/web/wfs/src/test/java/org/geoserver/wfs/web/WFSLayerConfigTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved | ||
* (c) 2001 - 2013 OpenPlans | ||
* This code is licensed under the GPL 2.0 license, available at the root | ||
* application directory. | ||
*/ | ||
package org.geoserver.wfs.web; | ||
|
||
import org.apache.wicket.markup.html.form.CheckBox; | ||
import org.apache.wicket.markup.html.form.Form; | ||
import org.apache.wicket.model.Model; | ||
import org.apache.wicket.util.tester.FormTester; | ||
import org.geoserver.catalog.LayerInfo; | ||
import org.geoserver.data.test.MockData; | ||
import org.geoserver.web.ComponentBuilder; | ||
import org.geoserver.web.FormTestPage; | ||
import org.geoserver.web.GeoServerWicketTestSupport; | ||
import org.geoserver.wfs.web.publish.WFSLayerConfig; | ||
import org.junit.Test; | ||
|
||
/** Contains tests related with WFS specific publishing configuration options * */ | ||
public final class WFSLayerConfigTest extends GeoServerWicketTestSupport { | ||
|
||
@Test | ||
public void testEncodeMeasuresCheckbox() { | ||
// get a test layer and instantiate the model | ||
final LayerInfo layer = getCatalog().getLayerByName(MockData.PONDS.getLocalPart()); | ||
Model<LayerInfo> model = new Model<>(layer); | ||
FormTestPage page = | ||
new FormTestPage((ComponentBuilder) id -> new WFSLayerConfig(id, model)); | ||
// let's start the page and check that the components are correctly instantiated | ||
tester.startPage(page); | ||
tester.assertRenderedPage(FormTestPage.class); | ||
tester.assertComponent("form", Form.class); | ||
// check that the checkbox is available | ||
tester.assertComponent("form:panel:encodeMeasures", CheckBox.class); | ||
// unselect the checkbox, no measures should be selected | ||
FormTester ft = tester.newFormTester("form"); | ||
ft.setValue("panel:encodeMeasures", false); | ||
ft.submit(); | ||
tester.assertModelValue("form:panel:encodeMeasures", false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters