Package org.apache.wicket.util.tester

Examples of org.apache.wicket.util.tester.FormTester


        // print(new CRSPanelTestPage(crs), true, true);
       
        tester.assertComponent( "form", Form.class );
        tester.assertComponent( "form:crs", CRSPanel.class );
       
        FormTester ft = tester.newFormTester( "form");
        ft.submit();
       
        CRSPanel crsPanel = (CRSPanel) tester.getComponentFromLastRenderedPage( "form:crs");
        assertEquals( DefaultGeographicCRS.WGS84, crsPanel.getCRS() );
    }
View Full Code Here


        tester.startPage( new CRSPanelTestPage( crs ) );
       
        TextField srs = (TextField) tester.getComponentFromLastRenderedPage( "form:crs:srs");
        srs.setModelObject( "EPSG:3005");
       
        FormTester ft = tester.newFormTester( "form");
        ft.submit();
       
        CRSPanel crsPanel = (CRSPanel) tester.getComponentFromLastRenderedPage( "form:crs");
        assertEquals( CRS.decode("EPSG:3005"), crsPanel.getCRS() );
    }
View Full Code Here

    public void testRequired() throws Exception {
        tester.startPage( new CRSPanelTestPage( (CoordinateReferenceSystem) null ) );
        CRSPanel panel = (CRSPanel) tester.getComponentFromLastRenderedPage("form:crs");
        panel.setRequired(true);
       
        FormTester ft = tester.newFormTester( "form");
        ft.submit();
       
        assertEquals(1, Session.get().getFeedbackMessages().size());
        // System.out.println(Session.get().getFeedbackMessages().messageForComponent(panel));
    }
View Full Code Here

        tester.startPage( new CRSPanelTestPage( foo ));
       
        tester.assertComponent( "form", Form.class );
        tester.assertComponent( "form:crs", CRSPanel.class );
       
        FormTester ft = tester.newFormTester( "form");
        ft.submit();
       
        assertEquals( DefaultGeographicCRS.WGS84, foo.crs );
    }
View Full Code Here

        tester.startPage( new CRSPanelTestPage( foo ));
       
        TextField srs = (TextField) tester.getComponentFromLastRenderedPage( "form:crs:srs");
        srs.setModelObject( "EPSG:3005");
       
        FormTester ft = tester.newFormTester( "form");
        ft.submit();
      
        assertEquals( CRS.decode("EPSG:3005"), foo.crs );
    }
View Full Code Here

        tester.startPage( new CRSPanelTestPage( new PropertyModel( foo, "crs") ));
       
        tester.assertComponent( "form", Form.class );
        tester.assertComponent( "form:crs", CRSPanel.class );
       
        FormTester ft = tester.newFormTester( "form");
        ft.submit();
       
        assertEquals( DefaultGeographicCRS.WGS84, foo.crs );
    }
View Full Code Here

        tester.startPage( new CRSPanelTestPage( new PropertyModel( foo, "crs" ) ));
       
        TextField srs = (TextField) tester.getComponentFromLastRenderedPage( "form:crs:srs");
        srs.setModelObject( "EPSG:3005");
       
        FormTester ft = tester.newFormTester( "form");
        ft.submit();
      
        assertEquals( CRS.decode("EPSG:3005"), foo.crs );
    }
View Full Code Here

    }

    public void testSave() {
        login();
        tester.startPage(ContactPage.class);
        FormTester ft = tester.newFormTester("form");
        ft.setValue("address", "newAddress");
        ft.submit("submit");
        tester.assertRenderedPage(GeoServerHomePage.class);

        ContactInfo info = getGeoServerApplication().getGeoServer().getGlobal().getContact();
        assertEquals("newAddress", info.getAddress());
    }
View Full Code Here

    //       
    // tester.assertRenderedPage(StorePage.class);
    // }

    public void testNameRequired() {
        FormTester form = tester.newFormTester("dataStoreForm");
        form.setValue("dataStoreNamePanel:border:paramValue", null);
        form.submit();
        // missing click link , the validation triggers before it

        tester.assertRenderedPage(DataAccessEditPage.class);
        tester.assertErrorMessages(new String[] { "Store name is required" });
    }
View Full Code Here

     * well as the namespace of its previously configured resources
     *
     * @REVISIT: this test fails on maven but is ok on eclipse...
     */
    public void _testWorkspaceSyncsUpWithNamespace() {
        final FormTester formTester = tester.newFormTester("dataStoreForm");
        print(tester.getLastRenderedPage(), true, true);
        final String wsDropdownPath = "dataStoreForm:workspacePanel:border:paramValue";
        final String namespaceParamPath = "dataStoreForm:parametersPanel:parameters:1:parameterPanel:paramValue";
        final String directoryParamPath = "dataStoreForm:parametersPanel:parameters:0:parameterPanel:border:paramValue";

        final Catalog catalog = getCatalog();
        tester.assertModelValue(wsDropdownPath, catalog.getWorkspaceByName(MockData.CITE_PREFIX));
        // tester.assertModelValue(namespaceParamPath, getCatalog().getNamespaceByPrefix(
        // MockData.CITE_PREFIX));
        tester.assertModelValue(namespaceParamPath, catalog.getNamespaceByPrefix(
                MockData.CITE_PREFIX).getURI());

        Serializable directory = store.getConnectionParameters().get("directory");
        tester.assertModelValue(directoryParamPath, directory);

        WorkspaceInfo expectedWorkspace = catalog.getWorkspaceByName(MockData.CDF_PREFIX);
        NamespaceInfo expectedNamespace = catalog.getNamespaceByPrefix(MockData.CDF_PREFIX);

        // select the fifth item in the drop down, which is the cdf workspace
        formTester.select("workspacePanel:border:paramValue", 4);
        Component wsDropDown = tester.getComponentFromLastRenderedPage(wsDropdownPath);
        tester.executeAjaxEvent(wsDropDown, "onchange");

        // final String namespaceParamPath =
        // "dataStoreForm:parameters:1:parameterPanel:border:paramValue";
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.tester.FormTester

Copyright © 2018 www.massapicom. 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.