Example usage for org.apache.wicket.markup.html.basic Label getBehaviors

List of usage examples for org.apache.wicket.markup.html.basic Label getBehaviors

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.basic Label getBehaviors.

Prototype

public final List<? extends Behavior> getBehaviors() 

Source Link

Document

Gets the currently coupled Behavior s as a unmodifiable list.

Usage

From source file:org.geoserver.web.demo.MapPreviewPageTest.java

License:Open Source License

@Test
public void testWfsOutputFormatValueUrlEncoding() {
    tester.startPage(MapPreviewPage.class);
    tester.assertRenderedPage(MapPreviewPage.class);

    Label optionLabel = (Label) tester.getComponentFromLastRenderedPage(
            "table:listContainer:items:4:itemProperties:4:component:menu:wfs:wfsFormats:3");
    assertTrue(optionLabel.getDefaultModelObjectAsString().equals("GML3.2"));
    for (Iterator<IBehavior> itBehaviors = optionLabel.getBehaviors().iterator(); itBehaviors.hasNext();) {
        IBehavior b = (IBehavior) (itBehaviors.next());
        if (b instanceof AttributeModifier) {
            AttributeModifier am = (AttributeModifier) b;
            String url = am.toString();
            assertTrue(!url.contains("gml+xml"));
            assertTrue(url.contains("gml%2Bxml"));
            break;
        }//w w  w.  ja va2s  . c o  m
    }
}