r3391 - trunk/lima-business/src/test/java/org/chorem/lima/business
Author: echatellier Date: 2012-04-25 10:28:20 +0200 (Wed, 25 Apr 2012) New Revision: 3391 Url: http://chorem.org/repositories/revision/lima/3391 Log: Fix import, exceptions Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2012-04-25 08:23:08 UTC (rev 3390) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2012-04-25 08:28:20 UTC (rev 3391) @@ -31,7 +31,6 @@ import org.junit.Before; import org.junit.Test; -import java.text.ParseException; import java.util.List; /** @@ -47,7 +46,7 @@ public class AccountServiceImplTest extends AbstractLimaTest { @Before - public void initTest() throws LimaException, ParseException { + public void initTest() throws Exception { initTestDatabase(); } 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 2012-04-25 08:23:08 UTC (rev 3390) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java 2012-04-25 08:28:20 UTC (rev 3391) @@ -25,18 +25,12 @@ package org.chorem.lima.business; -import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookImpl; -import org.chorem.lima.entity.LimaCallaoDAOHelper; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import java.text.ParseException; - -import javax.ejb.TransactionAttribute; - /** * Tests pour la gestion des journaux. * <p/> @@ -50,7 +44,7 @@ protected static final String JOURNAL_DES_VENTES = "Journal des ventes"; @Before - public void initTest() throws LimaException, ParseException { + public void initTest() throws Exception { initTestDatabase(); } Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java 2012-04-25 08:23:08 UTC (rev 3390) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialPeriodServiceImplTest.java 2012-04-25 08:28:20 UTC (rev 3391) @@ -25,17 +25,13 @@ package org.chorem.lima.business; -import java.text.ParseException; - -import junit.framework.Assert; - import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO; import org.chorem.lima.entity.LimaCallaoDAOHelper; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.nuiton.topia.TopiaContext; -import org.nuiton.topia.TopiaException; /** * Tests pour la gestion des timespans @@ -52,7 +48,7 @@ public class FinancialPeriodServiceImplTest extends AbstractLimaTest { @Before - public void initTest() throws LimaException, ParseException { + public void initTest() throws Exception { initTestDatabase(); } Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java 2012-04-25 08:23:08 UTC (rev 3390) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/FiscalPeriodServiceImplTest.java 2012-04-25 08:28:20 UTC (rev 3391) @@ -27,18 +27,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.ejb.FiscalPeriodServiceImpl; import org.junit.AfterClass; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; -import org.nuiton.topia.TopiaContext; -import org.nuiton.topia.TopiaContextFactory; -import org.nuiton.topia.TopiaException; -import org.nuiton.topia.TopiaNotFoundException; -import java.text.ParseException; - /** * Tests pour la gestion des périodes * <p/> @@ -56,31 +48,11 @@ private static final Log log = LogFactory .getLog(FiscalPeriodServiceImplTest.class); - private static FiscalPeriodServiceImpl instance; - - private TopiaContext rootContext; - @Before - public void initTest() throws LimaException, ParseException { + public void initTest() throws Exception { initTestDatabase(); } - public FiscalPeriodServiceImplTest() { - LimaConfig config = LimaConfig.getInstance(); - try { - rootContext = TopiaContextFactory.getContext(config.getOptions()); - } catch (TopiaNotFoundException ex) { - if (log.isErrorEnabled()) { - log.error("Can't init topia context", ex); - } - } - } - - @BeforeClass - public static void setUpClass() throws Exception { - //LimaConfigTest.getInstance(); - } - /** * On nettoie la base de données * @@ -303,14 +275,4 @@ // Nombre 12 timeSpans mensuels Assert.assertEquals(12, listTimeSpanDTO.size());*/ } - - protected TopiaContext beginTransaction() throws TopiaException { - // basic check done, make check in database - // TODO move it into JTA - TopiaContext topiaTransaction; - topiaTransaction = rootContext.beginTransaction(); - log.trace("beginTransaction" + topiaTransaction); - return topiaTransaction; - } - } \ No newline at end of file Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2012-04-25 08:23:08 UTC (rev 3390) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportServiceImplTest.java 2012-04-25 08:28:20 UTC (rev 3391) @@ -25,10 +25,11 @@ package org.chorem.lima.business; -import org.apache.commons.io.FileUtils; +import java.io.IOException; +import java.io.InputStream; +import java.text.ParseException; + import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.pdfbox.util.StringUtil; import org.chorem.lima.business.utils.ImportExportEntityEnum; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.FiscalPeriod; @@ -36,10 +37,6 @@ import org.junit.Assert; import org.junit.Test; -import java.io.IOException; -import java.io.InputStream; -import java.text.ParseException; - /** * Test du service d'import en faisant des import/export EBP et xml. * Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java 2012-04-25 08:23:08 UTC (rev 3390) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/ReportServiceImplTest.java 2012-04-25 08:28:20 UTC (rev 3391) @@ -39,7 +39,6 @@ import org.junit.Test; import java.math.BigDecimal; -import java.text.ParseException; import java.util.Date; /** @@ -52,18 +51,17 @@ public class ReportServiceImplTest extends AbstractLimaTest { @Before - public void initTest() throws LimaException, ParseException { + public void initTest() throws Exception { initTestDatabase(); } /** * Test de génération du rapport des comptes. * - * @throws LimaException - * @throws ParseException + * @throws Exception */ @Test - public void testGenerateAccountsReports() throws LimaException, ParseException { + public void testGenerateAccountsReports() throws Exception { Account accountBefa = accountService.getAccountByNumber("51"); Assert.assertNotNull(accountBefa); @@ -84,11 +82,10 @@ * Test de génération du rapport des comptes, en verifiant que les transactions * non équilibrées ne sont pas présentes (modification 0.6). * - * @throws LimaException - * @throws ParseException + * @throws Exception */ @Test - public void testGenerateAccountsReportsUnlalanced() throws LimaException, ParseException { + public void testGenerateAccountsReportsUnlalanced() throws Exception { EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); Account accountVmpVae = accountService.getAccountByNumber("511");
participants (1)
-
echatellier@users.chorem.org