Example usage for org.apache.wicket.markup.html.form FormComponentLabel getDefaultModelObjectAsString

List of usage examples for org.apache.wicket.markup.html.form FormComponentLabel getDefaultModelObjectAsString

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.form FormComponentLabel getDefaultModelObjectAsString.

Prototype

public final String getDefaultModelObjectAsString() 

Source Link

Document

Gets a model object as a string.

Usage

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"));
}