r3254 - trunk/lima-business/src/test/java/org/chorem/lima/business
Author: vsalaun Date: 2011-08-08 16:15:02 +0200 (Mon, 08 Aug 2011) New Revision: 3254 Url: http://chorem.org/repositories/revision/lima/3254 Log: #424 update all EntryBooks tests Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java 2011-08-08 13:57:43 UTC (rev 3253) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java 2011-08-08 14:15:02 UTC (rev 3254) @@ -92,24 +92,33 @@ @Test public void searchJournalWithLabelTest() throws LimaException { List<EntryBook> result = instance.getAllEntryByProperty(EntryBook.LABEL, "Journal des ventes"); - Assert.assertEquals("Journal des ventes", result.get(0).getLabel()); - /*result = instance.searchJournalWithLabel("Journal des achats"); - Assert.assertEquals("Journal des achats", result.getLabel());*/ + if ((result != null) && (result.size() != 0)) { + Assert.assertEquals("Journal des ventes", result.get(0).getLabel()); + } + result = instance.getAllEntryByProperty(EntryBook.LABEL, "Journal des achats"); + if ((result != null) && (result.size() != 0)) { + Assert.assertEquals("Journal des achats", result.get(0).getLabel()); + } } /** * Permet de tester la modification d'un journal suivant son préfixe. + * @throws LimaException */ @Test - public void modifyJournalTest() { - /*Journal journal = instance.searchJournalWithLabel("Journal des ventes"); - Assert.assertEquals("Journal des ventes", journal.getLabel()); - String result = instance.modifyJournal(journal.getTopiaId(), - "Journal des ventes", "new_prefix", "new_description"); + public void modifyJournalTest() throws LimaException { + List<EntryBook> entryBooksList = instance.getAllEntryByProperty(EntryBook.LABEL, "Journal des ventes"); + if (entryBooksList != null) { + Assert.assertEquals("Journal des ventes", entryBooksList.get(0).getLabel()); + entryBooksList.get(0).setCode("New Code"); + instance.updateEntryBook(entryBooksList.get(0)); + } + // Recherche du journal dans la bdd - JournalDTO journalDTO = instance - .searchJournalDTOWithLabel("Journal des ventes"); - Assert.assertEquals("new_prefix", journalDTO.getPrefix());*/ + entryBooksList = instance.getAllEntryByProperty(EntryBook.LABEL, "Journal des ventes"); + if (entryBooksList != null) { + Assert.assertEquals("New Code", entryBooksList.get(0).getCode()); + } } } \ No newline at end of file
participants (1)
-
vsalaun@users.chorem.org