List of usage examples for org.apache.wicket.markup.html.form FormComponentLabel getDefaultModelObjectAsString
public final String getDefaultModelObjectAsString()
From source file:org.openengsb.ui.admin.editorPage.EditorPageTest.java
License:Apache License
@Test public void testIfValuesOfAttributesAreShown() throws Exception { ConnectorId connectorId = ConnectorId.generate("testdomain", "testconnector"); Map<String, String> attributes = new HashMap<String, String>(); attributes.put("a", "testValue"); serviceManager.create(connectorId, new ConnectorDescription(attributes, null)); PageParameters pageParams = new PageParameters( "domainType=testdomain,connectorType=testconnector,id=" + connectorId.getInstanceId()); tester.startPage(ConnectorEditorPage.class, pageParams); FormComponentLabel nameLabel = (FormComponentLabel) tester .getComponentFromLastRenderedPage("editor:form:attributesPanel:fields:a:row:name"); assertThat(nameLabel.getDefaultModelObjectAsString(), is("a_name")); @SuppressWarnings("unchecked") TextField<String> value = (TextField<String>) tester .getComponentFromLastRenderedPage("editor:form:attributesPanel:fields:a:row:field"); assertThat(value.getValue(), is("testValue")); }