List of usage examples for org.apache.wicket.markup.html WebMarkupContainer size
public int size()
From source file:com.aplombee.RepeaterUtilTest.java
License:Apache License
/** * parent children size=2,reuse= not paging *//* w w w. ja v a 2 s . c om*/ @Test(groups = { "utilTests" }, expectedExceptions = RepeaterUtil.ParentNotUnaryException.class) public void parentNotSuitable_5() { IQuickReuseStrategy strategy = Mockito.mock(IQuickReuseStrategy.class); Mockito.when(strategy.isAddItemsSupported()).thenReturn(true); WebMarkupContainer parent = Mockito.mock(WebMarkupContainer.class); Mockito.when(parent.size()).thenReturn(2); IQuickView quickView = Mockito.mock(IQuickView.class); Mockito.when(quickView.getParent()).thenReturn(parent); Mockito.when(quickView.getReuseStrategy()).thenReturn(strategy); RepeaterUtil.get().parentNotSuitable(quickView); }
From source file:com.aplombee.RepeaterUtilTest.java
License:Apache License
/** * parent children size=1,reuse= not paging *//*www. j av a 2s . c o m*/ @Test(groups = { "utilTests" }) public void parentNotSuitable_6() { IQuickReuseStrategy strategy = Mockito.mock(IQuickReuseStrategy.class); Mockito.when(strategy.isAddItemsSupported()).thenReturn(true); WebMarkupContainer parent = Mockito.mock(WebMarkupContainer.class); Mockito.when(parent.size()).thenReturn(1); IQuickView quickView = Mockito.mock(IQuickView.class); Mockito.when(quickView.getParent()).thenReturn(parent); Mockito.when(quickView.getReuseStrategy()).thenReturn(strategy); RepeaterUtil.get().parentNotSuitable(quickView); }
From source file:org.cast.cwm.admin.TestUserContentLogPage.java
License:Open Source License
@Test public void pageRendersSuccessfully() { //start and render the test page tester.startPage(MockUserContentLogPage.class, new PageParameters()); //assert rendered page class tester.assertRenderedPage(UserContentLogPage.class); tester.assertContains("User Content Log"); // Should have data from our mock object tester.assertContains("mock-subject-id"); tester.assertContains("type"); tester.assertContains("title"); tester.assertContains("sample usercontent text"); // Should have a table with one line of data tester.assertComponent("table", DataTable.class); tester.assertComponent("table:body:rows:1:cells:1:cell", Label.class); WebMarkupContainer w = ((WebMarkupContainer) tester.getComponentFromLastRenderedPage("table:body:rows")); assertEquals("Table should only have one row", 1, w.size()); }