Refine search
/** * A convenience method for submitting the <code>Form</code> with an alternate button. * <p> * Note that if the button is associated with a model, it's better to use the * <code>setValue</code> method instead: * * <pre> * formTester.setValue("to:my:button", "value on the button"); * formTester.submit(); * </pre> * * @param buttonComponentId * relative path (from <code>Form</code>) to the button */ public void submit(String buttonComponentId) { setValue(buttonComponentId, "marked"); submit(); }
@Test public void testCreatingNewBlobStore() throws ConfigurationException { formTester.setValue("name", storeId); formTester.setValue("enabled", false); formTester.setValue( "blobSpecificPanel:rootDirectory:border:border_body:paramValue", "/tmp/gwc"); formTester.setValue( "blobSpecificPanel:templatePath", "{grid}/{layer}/{params}/tiles-{z}.sqlite"); formTester.setValue("blobSpecificPanel:rowRangeCount", "1500"); formTester.setValue("blobSpecificPanel:columnRangeCount", "500"); formTester.setValue("blobSpecificPanel:poolSize", "2000"); formTester.setValue("blobSpecificPanel:poolReaperIntervalMs", "1000"); formTester.setValue("blobSpecificPanel:eagerDelete", "true"); formTester.setValue("blobSpecificPanel:useCreateTime", "true"); formTester.setValue( "blobSpecificPanel:mbtilesMetadataDirectory:border:border_body:paramValue", "/tmp/gwc/mbtilesMetadata");
@Test public void testAuthenticationDisabled() throws Exception { Assume.assumeTrue(LDAPTestUtils.initLdapServer(true, ldapServerUrl, basePath)); setupPanel(false, true); tester.assertInvisible("form:panel:authenticationPanelContainer:authenticationPanel"); tester.newFormTester("form").setValue("panel:bindBeforeGroupSearch", "on"); tester.executeAjaxEvent("form:panel:bindBeforeGroupSearch","onclick"); tester.assertVisible("form:panel:authenticationPanelContainer:authenticationPanel"); }
/** * A convenience method for submitting the <code>Form</code> with an alternate button. * <p> * Note that if the button is associated with a model, it's better to use the * <code>setValue</code> method instead: * * <pre> * formTester.setValue("to:my:button", "value on the button"); * formTester.submit(); * </pre> * * @param buttonComponentId * relative path (from <code>Form</code>) to the button */ public void submit(String buttonComponentId) { setValue(buttonComponentId, "marked"); submit(); }
@Test public void testAuthenticationDisabled() throws Exception { Assume.assumeTrue(LDAPTestUtils.initLdapServer(true, ldapServerUrl, basePath)); setupPanel(false, true); tester.assertInvisible("form:panel:authenticationPanelContainer:authenticationPanel"); tester.newFormTester("form").setValue("panel:bindBeforeGroupSearch", "on"); tester.executeAjaxEvent("form:panel:bindBeforeGroupSearch", "click"); tester.assertVisible("form:panel:authenticationPanelContainer:authenticationPanel"); }
@Test public void testAuthenticationDisabled() throws Exception { Assume.assumeTrue(LDAPTestUtils.initLdapServer(true, ldapServerUrl, basePath)); setupPanel(false, true); tester.assertInvisible("form:panel:authenticationPanel"); tester.newFormTester("form").setValue("panel:bindBeforeGroupSearch", "on"); tester.executeAjaxEvent("form:panel:bindBeforeGroupSearch", "click"); tester.assertVisible("form:panel:authenticationPanel"); }
public void testImportShapefileCorruptedDirectory() { // Go to the page for importing a directory containing corrupted shapefiles tester.clickLink(WicketPath.IMPORT_LINK.path); tester.clickLink(WicketPath.IMPORT_SHAPEFILELINK.path); // Fills the form with a directory containing no Shapefiles FormTester form = tester.newFormTester(WicketPath.IMPORT_FORM.path); form.setValue(WicketPath.IMPORT_NAME.path, "testshp"); form.setValue(WicketPath.IMPORT_DESCRIPTION.path, "Shapefile test"); form.setValue(WicketPath.IMPORT_DIRECTORY.path, this.dataRoot.getAbsolutePath() + "/../../src/test/data/corruptedshp"); form.submit(WicketPath.IMPORT_NEXT.path); this.assertNoException(); }
@Test public void testModifyingAnExistingStore() throws Exception { FormTester formTester = tester.newFormTester("blobConfigContainer:blobStoreForm"); String updatedStoreId = UUID.randomUUID().toString(); formTester.setValue("name", updatedStoreId); formTester.setValue( "blobSpecificPanel:templatePath", "{grid}/{layer}/{params}/{style}/tiles-{z}.sqlite");
public void testImportShapefileNoDataDirectory() { // Go to the page for importing a directory containing shapefiles tester.clickLink(WicketPath.IMPORT_LINK.path); tester.clickLink(WicketPath.IMPORT_SHAPEFILELINK.path); // Fills the form with a directory containing no Shapefiles FormTester form = tester.newFormTester(WicketPath.IMPORT_FORM.path); form.setValue(WicketPath.IMPORT_NAME.path, "testshp"); form.setValue(WicketPath.IMPORT_DESCRIPTION.path, "Shapefile test"); form.setValue(WicketPath.IMPORT_DIRECTORY.path, this.dataRoot.getAbsolutePath() + "/../../src/test/data/geotiff"); form.submit(WicketPath.IMPORT_NEXT.path); this.assertNoException(); this.assertMessage("ImporterSecuredPage.noData"); }
public void testImportShapefileInvalidDirectory() { // Go to the page for importing a directory containing shapefiles tester.clickLink(WicketPath.IMPORT_LINK.path); tester.clickLink(WicketPath.IMPORT_SHAPEFILELINK.path); // Fills the form with an invalid directory FormTester form = tester.newFormTester(WicketPath.IMPORT_FORM.path); form.setValue(WicketPath.IMPORT_NAME.path, "testshp"); form.setValue(WicketPath.IMPORT_DESCRIPTION.path, "Shapefile test"); form.setValue(WicketPath.IMPORT_DIRECTORY.path, "/xxx"); form.submit(WicketPath.IMPORT_NEXT.path); this.assertNoException(); this.assertMessage("ImporterSecuredPage.invalidPath"); }
@Test public void testMissingOrDuplicateName() { ConfigurationPage page = new ConfigurationPage(new ConfigurationImpl()); tester.startPage(page); tester.assertRenderedPage(ConfigurationPage.class); // save without name tester.clickLink("configurationForm:save"); tester.assertRenderedPage(ConfigurationPage.class); config = dao.reload(config); assertFeedback("topFeedback", "'Name' is required"); assertFeedback("bottomFeedback", "'Name' is required"); FormTester formTester = tester.newFormTester("configurationForm"); formTester.setValue("name", "my_configuration"); tester.clickLink("configurationForm:save"); assertFeedback("topFeedback", "unique"); assertFeedback("bottomFeedback", "unique"); }