Package test.org.magicbox.dbunit

Examples of test.org.magicbox.dbunit.DBPages


  }

  public void testInserisciPage() {
    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBPages db = new DBPages();
   
    PageLight pageLight = new PageLightImpl(0,"prova");
    Page pagina = new PageImpl("blah blah",false,1,46,pageLight);
   
    assertTrue(_service.getPages().size() == 0);
      _service.savePage(pagina);
      assertTrue(_service.getPages().size() == 1);
   
    db.pulisciDb();
    dbCentro.preparaDb();
    db = null;
    dbCentro = null;
  }
View Full Code Here


  }

  public void testCancellaPage() {
    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBPages db = new DBPages();
   
    PageLight pageLight = new PageLightImpl(0,"prova");
    Page pagina = new PageImpl("blah blah",false,1,46,pageLight);
   
    assertTrue(_service.getPages().size() == 0);
      Long id = _service.savePage(pagina);
      assertTrue(_service.getPages().size() == 1);
    assertEquals(_service.cancellaPage(id),true);
    assertTrue(_service.getPages().size() == 0);
   
    db.pulisciDb();
    dbCentro.preparaDb();
    db = null;
    dbCentro = null;
  }
View Full Code Here

  }

  public void testAggiornaPage() {
    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBPages db = new DBPages();
   
    PageLight pageLight = new PageLightImpl(0,"prova");
    Page pagina = new PageImpl("blah blah",false,1,46,pageLight);
   
    assertTrue(_service.getPages().size() == 0);
      Long id = _service.savePage(pagina);
      assertTrue(_service.getPages().size() == 1);
   
      PageLight pageLightUpdate = new PageLightImpl(id,"test");
    Page paginaUpdate = new PageImpl("mumble mumble",false,2,46,pageLightUpdate);
   
    assertTrue(_service.savePage(paginaUpdate)== 1);
   
    Page recuperata = _service.getPage(id);
   
    assertEquals(recuperata.getId(), paginaUpdate.getId());
    assertEquals(recuperata.getContent(), paginaUpdate.getContent());
    assertEquals(recuperata.getIdCentro(), paginaUpdate.getIdCentro());
    assertEquals(recuperata.isAdmin(), paginaUpdate.isAdmin());
    assertEquals(recuperata.getTitolo(), paginaUpdate.getTitolo());
    assertEquals(recuperata.getOrdine(), paginaUpdate.getOrdine());
   
    db.pulisciDb();
    dbCentro.preparaDb();
    db = null;
    dbCentro = null;
  }
View Full Code Here

  }
 
  public void testInserisciPage() {
    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBPages db = new DBPages();
   
    PageLight pageLight = new PageLightImpl(0,"prova");
    Page pagina = new PageImpl("blah blah",false,1,46,pageLight);
   
    assertTrue(_dao.getPages().size() == 0);
      _dao.inserisciPage(pagina);
      assertTrue(_dao.getPages().size() == 1);
   
    db.pulisciDb();
    dbCentro.preparaDb();
    db = null;
    dbCentro = null;
  }
View Full Code Here

  }
 
  public void testGetPage() {
    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBPages db = new DBPages();
   
    PageLight pageLight = new PageLightImpl(0,"prova");
    Page pagina = new PageImpl("blah blah",false,1,46,pageLight);
    assertTrue(_dao.getPages().size() == 0);
   
      Long id =_dao.inserisciPage(pagina);
      assertNotNull(_dao.getPage(id));
   
    db.pulisciDb();
    dbCentro.pulisciDb();
    db = null;
    dbCentro = null;
  }
View Full Code Here

 
  public void testGetPagesAdmin() {
   
    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBPages db = new DBPages();
    db.preparaDb();
   
    assertTrue(_dao.getPages().size() == 10);
    assertEquals(_dao.getPagesAdmin().size(),3);
   
    db.pulisciDb();
    dbCentro.pulisciDb();
    db = null;
    dbCentro = null;
  }
View Full Code Here

  }
 
  public void testGetPagesCentro() {
    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBPages db = new DBPages();
    db.preparaDb();
   
    assertTrue(_dao.getPagesCentro(46).size() == 7);
   
    db.pulisciDb();
    dbCentro.pulisciDb();
    db = null;
    dbCentro = null;
  }
View Full Code Here

 
  public void testGetPages() {
   
    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBPages db = new DBPages();
    db.preparaDb();
   
    assertTrue(_dao.getPages().size() == 10);
   
    db.pulisciDb();
    dbCentro.pulisciDb();
    db = null;
    dbCentro = null;
  }
View Full Code Here

 
  public void testAggiornaPage() {
   
    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBPages db = new DBPages();
   
    PageLight pageLight = new PageLightImpl(0,"prova");
    Page pagina = new PageImpl("blah blah",false,1,46,pageLight);
   
    assertTrue(_dao.getPages().size() == 0);
      Long id = _dao.inserisciPage(pagina);
      assertTrue(_dao.getPages().size() == 1);
   
      PageLight pageLightUpdate = new PageLightImpl(id,"test");
    Page paginaUpdate = new PageImpl("mumble mumble",false,2,46,pageLightUpdate);
   
    assertTrue(_dao.aggiornaPage(paginaUpdate) == 1);
   
    Page recuperata = _dao.getPage(id);
   
    assertEquals(recuperata.getId(), paginaUpdate.getId());
    assertEquals(recuperata.getContent(), paginaUpdate.getContent());
    assertEquals(recuperata.getIdCentro(), paginaUpdate.getIdCentro());
    assertEquals(recuperata.isAdmin(), paginaUpdate.isAdmin());
    assertEquals(recuperata.getTitolo(), paginaUpdate.getTitolo());
    assertEquals(recuperata.getOrdine(), paginaUpdate.getOrdine());
   
    db.pulisciDb();
    dbCentro.preparaDb();
    db = null;
    dbCentro = null;
  }
View Full Code Here

  }
 
  public void testCancellaPage() {
    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBPages db = new DBPages();
   
    PageLight pageLight = new PageLightImpl(0,"prova");
    Page pagina = new PageImpl("blah blah",false,1,46,pageLight);
   
    assertTrue(_dao.getPages().size() == 0);
      Long id = _dao.inserisciPage(pagina);
      assertTrue(_dao.getPages().size() == 1);
    assertEquals(_dao.cancellaPage(id),true);
    assertTrue(_dao.getPages().size() == 0);
   
    db.pulisciDb();
    dbCentro.preparaDb();
    db = null;
    dbCentro = null;
  }
View Full Code Here

TOP

Related Classes of test.org.magicbox.dbunit.DBPages

Copyright © 2018 www.massapicom. 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.