Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package de.agilecoders.wicket.core.markup.html.bootstrap.navigation;
 
Tests the BootstrapPagingNavigator component

Author(s):
miha
    @Test
    public void correctClassNameIsSet() {
        BootstrapPagingNavigator navigator = createDefault();
        tester().startComponentInPage(navigator);
        Attributes.assertClassNamesPresent(tester().getTagByWicketId("pagination"), "pagination");
    }
    @Test
    public void correctClassName() {
        BootstrapPagingNavigator navigator = createDefault();
        tester().startComponentInPage(navigator);
        Attributes.assertSingleClassNamePresent(tester().getTagByWicketId("pagination"), "pagination");
    }
    @Test(expected = MarkupException.class)
    public void correctTagNameIsAsserted() {
        BootstrapPagingNavigator navigator = createWithTagName("a");
        tester().startComponentInPage(navigator);
    }

    

Returns:
a new BootstrapPagingNavigator with given tag
    private BootstrapPagingNavigator createWithTagName(final String tagName) {
        return new BootstrapPagingNavigator("pagination"createPageable()) {
            @Override
            protected void onComponentTag(ComponentTag tag) {
                tag.setName(tagName);
                super.onComponentTag(tag);
            }
        };
    }

    

Returns:
a new default BootstrapPagingNavigator with a "div" tag
        return createWithTagName("ul");
    }

    
creates a pageable list view

    private IPageable createPageable() {
        return new PageableListView<String>("pageable", Generics2.newArrayList("item1""item2""item3""item2"), 1) {
            @Override
            protected void populateItem(ListItem<Stringitem) {
                item.add(new Label("item"item.getModelObject()));
            }
        };
    }
New to GrepCode? Check out our FAQ X