Package test.org.magicbox.dbunit

Examples of test.org.magicbox.dbunit.DBAnnunci


    annuncio.setContenuto("Saludos a todos");
   
        ModelAndView mav = _controller.onSubmit(_reqMock, _resMock,annuncio,new BindException(annuncio, Constant.FEED));
    assertEquals(Constant.REDIRECT_WELCOME_USER, mav.getViewName());
   
    DBAnnunci dbAnnunci= new DBAnnunci();
    dbAnnunci.pulisciDb();
    dbCentro.pulisciDb();
    dbAnnunci = null;
    dbCentro = null;
  }
View Full Code Here


    _ctx = SpringFactory.getXmlWebApplicationContext();
    _service = (FeedService) _ctx.getBean("magicbox.feedService");
  }

  public void testGetFeed() {
    DBAnnunci dbannunci = new DBAnnunci();
    dbannunci.preparaDb();
    try {
      SyndFeed synF = _service.getFeed(Constant.FEED_TEXT);
      assertNotNull(synF);
      assertEquals(synF.getEntries().size(), 9);
      assertEquals(((SyndEntryImpl) synF.getEntries().get(0)).getTitle(),
          "Saluto");
      assertEquals(((SyndEntryImpl) synF.getEntries().get(1)).getTitle(),
          "fgdjg");
      assertEquals(((SyndEntryImpl) synF.getEntries().get(2)).getTitle(),
          "Saluti");
      assertEquals(((SyndEntryImpl) synF.getEntries().get(3)).getTitle(),
          "saludos");
      assertEquals(((SyndEntryImpl) synF.getEntries().get(4)).getTitle(),
          "dew");
      assertEquals(((SyndEntryImpl) synF.getEntries().get(5)).getTitle(),
          "Alta definizione");
      assertEquals(((SyndEntryImpl) synF.getEntries().get(6)).getTitle(),
          "Espana");
      assertEquals(((SyndEntryImpl) synF.getEntries().get(7)).getTitle(),
          "Ei fu siccome immobile");
      assertEquals(((SyndEntryImpl) synF.getEntries().get(8)).getTitle(),
          "pix");

    } catch (ParseException e) {
      e.printStackTrace();
    }
    dbannunci.pulisciDb();
  }
View Full Code Here

  }
 
 
  public void testGetAnnunciPaginato(){
   
    DBAnnunci dbAnnunci= new DBAnnunci();
    dbAnnunci.preparaDb();

    List<Annuncio> mail = _service.getAnnunci(Constant.TYPE_MAIL,0,2);
    assertEquals(mail.size(), 1);
   
    List<Annuncio> sms = _service.getAnnunci(Constant.TYPE_SMS,0,2);
    assertEquals(sms.size(), 0);
   
    List<Annuncio> feed = _service.getAnnunci(Constant.TYPE_FEED,0,2);
    assertEquals(feed.size(), 9);
   
    dbAnnunci.pulisciDb();
    dbAnnunci = null;
  }
View Full Code Here

    _ctx = SpringFactory.getXmlWebApplicationContext();
    _dao = (AnnunciDao) _ctx.getBean("magicbox.annunciDao");
  }
 
  public void testGetAnnunciTipo() {
    DBAnnunci dbAnnunci= new DBAnnunci();
    dbAnnunci.preparaDb();
   
    List<Annuncio> mails =_dao.getAnnunci(Constant.TYPE_MAIL);//1
    List<Annuncio> sms = _dao.getAnnunci(Constant.TYPE_SMS);//2
    List<Annuncio> feed = _dao.getAnnunci(Constant.TYPE_FEED);//3
    assertEquals(mails.size(), 1);
    assertEquals(sms.size(), 0);
    assertEquals(feed.size(), 9);
   
    dbAnnunci.pulisciDb();
    dbAnnunci = null;
  }
View Full Code Here

    dbAnnunci.pulisciDb();
    dbAnnunci = null;
  }
 
  public void testGetAnnunciTipoCentro() {
    DBAnnunci dbAnnunci= new DBAnnunci();
    dbAnnunci.preparaDb();

    List<Annuncio> mail = _dao.getAnnunci(Constant.TYPE_MAIL,0,2);
    assertEquals(mail.size(), 1);
   
    List<Annuncio> sms = _dao.getAnnunci(Constant.TYPE_SMS,0,2);
    assertEquals(sms.size(), 0);
   
    List<Annuncio> feed = _dao.getAnnunci(Constant.TYPE_FEED,0,2);
    assertEquals(feed.size(), 9);
   
    dbAnnunci.pulisciDb();
    dbAnnunci = null;
  }
View Full Code Here

   
    lista = _dao.getAnnunci(Constant.TYPE_FEED);
    assertEquals(lista.size(), 1);
    Annuncio retrieve = (Annuncio)lista.get(0);
    assertNotNull(retrieve);
    DBAnnunci db = new DBAnnunci();
    db.pulisciDb();
    db = null;

  }
View Full Code Here

TOP

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

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.