@Test public void l_backupPrenotazioneTest() throws Exception { int count = this.prenotazioneDAO.count().intValue(); List<Prenotazione> lista = this.prenotazioneDAO.find(new Page(0, count)).getResults(); IBackupStore<Prenotazione> conf = new IBackupStore.PrenotazioneBackupStore(); conf.setList(lista); mapper.enable(SerializationFeature.INDENT_OUTPUT); mapper.writeValue(new File("./backup/PrenotazioneBackup.json"), conf); Assert.assertTrue("############BACKUP_PRENOTAZIONE", conf.getList().size() == count); }
@Test public void m_backupVeicoloCnrTest() throws Exception { int count = this.veicoloCNRDAO.count().intValue(); List<VeicoloCNR> lista = this.veicoloCNRDAO.find(new Page(0, count)).getResults(); IBackupStore<VeicoloCNR> conf = new IBackupStore.VeicoloCnrBackupStore(); conf.setList(lista); mapper.enable(SerializationFeature.INDENT_OUTPUT); mapper.writeValue(new File("./backup/VeicoloCnrBackup.json"), conf); Assert.assertTrue("############BACKUP_VEICOLO_CNR", conf.getList().size() == count); }
@Test public void h_backupUserTest() throws Exception { int count = this.userDAO.count().intValue(); List<User> lista = this.userDAO.find(new Page(0, count)).getResults(); IBackupStore<User> conf = new IBackupStore.UserBackupStore(); conf.setList(lista); mapper.enable(SerializationFeature.INDENT_OUTPUT); mapper.writeValue(new File("./backup/UserBackup.json"), conf); Assert.assertTrue("############BACKUP_USER", conf.getList().size() == count); }
@Test public void g_backupRimborsoKmTest() throws Exception { int count = this.rimborsoKmDAO.count().intValue(); List<RimborsoKm> lista = this.rimborsoKmDAO.find(new Page(0, count)).getResults(); IBackupStore<RimborsoKm> conf = new RimborsoKmBackupStore(); conf.setList(lista); mapper.enable(SerializationFeature.INDENT_OUTPUT); mapper.writeValue(new File("./backup/RimborsoKmBackup.json"), conf); Assert.assertTrue("############BACKUP_RIMBORSO_KM", conf.getList().size() == count); }
@Test public void d_backupDirettoreTest() throws Exception { int count = this.direttoreDAO.count().intValue(); List<Direttore> lista = this.direttoreDAO.find(new Page(0, count)).getResults(); IBackupStore<Direttore> conf = new DirettoreBackupStore(); conf.setList(lista); mapper.enable(SerializationFeature.INDENT_OUTPUT); mapper.writeValue(new File("./backup/DirettoreBackup.json"), conf); Assert.assertTrue("############BACKUP_DIRETTORE", conf.getList().size() == count); }
@Test public void c_backupMassimaleTest() throws Exception { int count = this.massimaleDAO.count().intValue(); List<Massimale> lista = this.massimaleDAO.find(new Page(0, count)).getResults(); IBackupStore<Massimale> conf = new MassimaleBackupStore(); conf.setList(lista); mapper.enable(SerializationFeature.INDENT_OUTPUT); mapper.writeValue(new File("./backup/MassimaleBackup.json"), conf); Assert.assertTrue("############BACKUP_MASSIMALE", conf.getList().size() == count); }
@Test public void b_backupTipologiaSpesaTest() throws Exception { int count = this.tipologiaSpesaDAO.count().intValue(); List<TipologiaSpesa> lista = this.tipologiaSpesaDAO.find(new Page(0, count)).getResults(); IBackupStore<TipologiaSpesa> conf = new TipologiaSpesaBackupStore(); conf.setList(lista); mapper.enable(SerializationFeature.INDENT_OUTPUT); mapper.writeValue(new File("./backup/TipologiaSpesaBackup.json"), conf); Assert.assertTrue("############BACKUP_TIPOLOGIA_SPESA", conf.getList().size() == count); }