Examples of PageImpl


Examples of org.hornetq.core.paging.impl.PageImpl

   protected void testAdd(final SequentialFileFactory factory, final int numberOfElements) throws Exception
   {

      SequentialFile file = factory.createSequentialFile("00010.page", 1);

      PageImpl impl = new PageImpl(new SimpleString("something"), new NullStorageManager(), factory, file, 10);

      Assert.assertEquals(10, impl.getPageId());

      impl.open();

      Assert.assertEquals(1, factory.listFiles("page").size());

      SimpleString simpleDestination = new SimpleString("Test");

      ArrayList<HornetQBuffer> buffers = addPageElements(simpleDestination, impl, numberOfElements);

      impl.sync();
      impl.close();

      file = factory.createSequentialFile("00010.page", 1);
      file.open();
      impl = new PageImpl(new SimpleString("something"), new NullStorageManager(), factory, file, 10);

      List<PagedMessage> msgs = impl.read();

      Assert.assertEquals(numberOfElements, msgs.size());

      Assert.assertEquals(numberOfElements, impl.getNumberOfMessages());

      for (int i = 0; i < msgs.size(); i++)
      {
         Assert.assertEquals(simpleDestination, msgs.get(i).getMessage(null).getAddress());

         UnitTestCase.assertEqualsByteArrays(buffers.get(i).toByteBuffer().array(), msgs.get(i)
                                                                                        .getMessage(null)
                                                                                        .getBodyBuffer()
                                                                                        .toByteBuffer()
                                                                                        .array());
      }

      impl.delete();

      Assert.assertEquals(0, factory.listFiles(".page").size());

   }
View Full Code Here

Examples of org.locationtech.udig.printing.model.impl.PageImpl

    }

    @SuppressWarnings("unchecked")
    public void init( BoxPart owner ) {
        EditPart parentPart = owner.getParent();
        PageImpl pageImpl = (PageImpl) parentPart.getModel();
        EList<Box> boxes = (EList<Box>) pageImpl.getBoxes();
        Box box = owner.getBoxPrinter().getBox();
        int i = boxes.indexOf(box);
        int size = boxes.size();
        if (i >= size - 1)
            return;
View Full Code Here

Examples of org.magicbox.domain.PageImpl

    assertEquals(0,page.getOrdine());
  }
 
  public void testCostruttorePieno() {
    PageLight pageLight = new PageLightImpl(new Long(13),"titolo");
    Page page = new PageImpl("contenuto",false,2,46,pageLight);
    assertEquals("titolo",page.getTitolo());
    assertTrue(page.getId() == 13);
    assertEquals("contenuto",page.getContent());
    assertEquals(46,page.getIdCentro());
    assertEquals(2,page.getOrdine());
  }
View Full Code Here

Examples of org.opoo.press.impl.PageImpl

      }
      List<Post> pagePosts = posts.subList(fromIndex, toIndex);
     
      Pager pager = new Pager(pageNumber, totalPages, totalPosts, pageSize, pagePosts);
      if(pageNumber > 1){
        PageImpl impl = new PageImpl(site, page.getSource(), pager);
//        site.getPages().add(impl);
        pages[i] = impl;
        newPages.add(impl);
      }else{
        page.setPager(pager);
View Full Code Here

Examples of org.springframework.data.domain.PageImpl

    Pageable page = new PageRequest(0, 10);

    // search
    userController.getAll(model, null, page, "NewUserName");
    PageImpl userList = (PageImpl<User>) model.get("users");
    assertThat(userList.getContent().size(), is(3));

    // test to delete one
    model.clear();
    userController.delete(testUser, "NewUserId1", model);
    model.clear();
    userController.getAll(model, Role.USER, page, "NewUserName");
    userList = (PageImpl<User>) model.get("users");
    assertThat(userList.getContent().size(), is(2));

    // test to delete more
    model.clear();
    userController.delete(testUser, "NewUserId2,NewUserId3", model);
    model.clear();
    userController.getAll(model, Role.USER, page, "NewUserName");
    userList = (PageImpl<User>) model.get("users");
    assertThat(userList.getContent().size(), is(0));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.