Author: echatellier Date: 2012-02-21 15:20:35 +0100 (Tue, 21 Feb 2012) New Revision: 3331 Url: http://chorem.org/repositories/revision/lima/3331 Log: Add new test with FR accountingRules Added: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java Removed: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceTest.java Copied: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java (from rev 3329, trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceTest.java) =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java (rev 0) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java 2012-02-21 14:20:35 UTC (rev 3331) @@ -0,0 +1,190 @@ +/* + * #%L + * + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package org.chorem.lima.business; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.List; + +import org.chorem.lima.entity.Account; +import org.chorem.lima.entity.Entry; +import org.chorem.lima.entity.EntryBook; +import org.chorem.lima.entity.EntryImpl; +import org.chorem.lima.entity.FinancialPeriod; +import org.chorem.lima.entity.FinancialTransaction; +import org.chorem.lima.entity.FinancialTransactionImpl; +import org.chorem.lima.entity.FiscalPeriod; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * Test on financial transaction service. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class FinancialTransactionServiceImplTest extends AbstractLimaTest { + + /** + * Init db with some transaction. + * + * @throws ParseException + * @throws LimaException + */ + @Before + public void initTransactions() throws ParseException, LimaException { + + EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); + Account accountVmpVae = accountService.getAccountByNumber("511"); + + // TODO echatellier 20120116 improve period choice + FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0); + + FinancialTransaction transaction1 = new FinancialTransactionImpl(); + transaction1.setTransactionDate(df.parse("April 4, 2012")); + transaction1.setEntryBook(journalDesVentes); + transaction1.setFinancialPeriod(financialPeriod); + transaction1 = financialTransactionService.createFinancialTransaction(transaction1); + + Entry tr1Entry1 = new EntryImpl(); + tr1Entry1.setAmount(BigDecimal.valueOf(42.0)); + tr1Entry1.setAccount(accountVmpVae); + tr1Entry1.setFinancialTransaction(transaction1); + tr1Entry1.setDescription("test desc"); + tr1Entry1.setVoucher("voucher"); + tr1Entry1 = financialTransactionService.createEntry(tr1Entry1); + + Entry tr1Entry2 = new EntryImpl(); + tr1Entry2.setAmount(BigDecimal.valueOf(42.0)); + tr1Entry2.setDebit(true); + tr1Entry2.setAccount(accountVmpVae); + tr1Entry2.setFinancialTransaction(transaction1); + tr1Entry2.setDescription("test desc"); + tr1Entry2.setVoucher("voucher"); + tr1Entry2 = financialTransactionService.createEntry(tr1Entry2); + } + + /** + * Test to find all unbalanced transactions. + * Nothing wrong here. + * + * @throws ParseException + * @throws LimaException + */ + @Test + public void testGetInexactTransactionAllGood() throws ParseException, LimaException { + FiscalPeriod fiscalPeriod = fiscalPeriodService.getAllFiscalPeriods().get(0); + List<FinancialTransaction> transactions = financialTransactionService.getAllInexactFinancialTransactions(fiscalPeriod); + Assert.assertTrue(transactions.isEmpty()); + } + + /** + * Test to find all unbalanced transactions. + * + * wrong data. + * + * @throws ParseException + * @throws LimaException + */ + @Test + public void testGetInexactTransactionNotAllGood() throws ParseException, LimaException { + + EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); + Account accountVmpVae = accountService.getAccountByNumber("511"); + + // TODO echatellier 20120116 improve period choice + FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0); + + FinancialTransaction transaction1 = new FinancialTransactionImpl(); + transaction1.setTransactionDate(df.parse("April 5, 2012")); + transaction1.setEntryBook(journalDesVentes); + transaction1.setFinancialPeriod(financialPeriod); + transaction1 = financialTransactionService.createFinancialTransaction(transaction1); + + Entry tr1Entry1 = new EntryImpl(); + tr1Entry1.setAmount(BigDecimal.valueOf(42.0)); + tr1Entry1.setAccount(accountVmpVae); + tr1Entry1.setFinancialTransaction(transaction1); + //tr1Entry1.setDescription("test desc"); + tr1Entry1.setVoucher("voucher"); + tr1Entry1 = financialTransactionService.createEntry(tr1Entry1); + + Entry tr1Entry2 = new EntryImpl(); + tr1Entry2.setAmount(BigDecimal.valueOf(42.0)); + tr1Entry2.setDebit(true); + tr1Entry2.setAccount(accountVmpVae); + tr1Entry2.setFinancialTransaction(transaction1); + tr1Entry2.setDescription("test desc"); + tr1Entry2.setVoucher("voucher"); + tr1Entry2 = financialTransactionService.createEntry(tr1Entry2); + + // one in period + FiscalPeriod fiscalPeriod = fiscalPeriodService.getAllFiscalPeriods().get(0); + List<FinancialTransaction> transactions = financialTransactionService.getAllInexactFinancialTransactions(fiscalPeriod); + Assert.assertEquals(1, transactions.size()); + } + + /** + * Test to find all unbalanced transactions. + * + * Test only unbalanced transactions (no data errors : fields). + * + * @throws ParseException + * @throws LimaException + */ + @Test + public void testGetUnbalancedTransactionNotAllGood() throws ParseException, LimaException { + + EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); + Account accountVmpVae = accountService.getAccountByNumber("511"); + + // TODO echatellier 20120116 improve period choice + FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0); + + FinancialTransaction transaction1 = new FinancialTransactionImpl(); + transaction1.setTransactionDate(df.parse("April 5, 2012")); + transaction1.setEntryBook(journalDesVentes); + transaction1.setFinancialPeriod(financialPeriod); + transaction1 = financialTransactionService.createFinancialTransaction(transaction1); + + Entry tr1Entry1 = new EntryImpl(); + tr1Entry1.setAmount(BigDecimal.valueOf(54.0)); + tr1Entry1.setAccount(accountVmpVae); + tr1Entry1.setFinancialTransaction(transaction1); + tr1Entry1.setDescription("test desc"); + tr1Entry1.setVoucher("voucher"); + tr1Entry1 = financialTransactionService.createEntry(tr1Entry1); + + // one in period + FiscalPeriod fiscalPeriod = fiscalPeriodService.getAllFiscalPeriods().get(0); + List<FinancialTransaction> transactions = financialTransactionService.getAllInexactFinancialTransactions(fiscalPeriod); + Assert.assertEquals(1, transactions.size()); + } +} Deleted: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceTest.java 2012-02-21 14:02:26 UTC (rev 3330) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceTest.java 2012-02-21 14:20:35 UTC (rev 3331) @@ -1,190 +0,0 @@ -/* - * #%L - * - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 Codelutin, Chatellier Eric - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -package org.chorem.lima.business; - -import java.math.BigDecimal; -import java.text.ParseException; -import java.util.List; - -import org.chorem.lima.entity.Account; -import org.chorem.lima.entity.Entry; -import org.chorem.lima.entity.EntryBook; -import org.chorem.lima.entity.EntryImpl; -import org.chorem.lima.entity.FinancialPeriod; -import org.chorem.lima.entity.FinancialTransaction; -import org.chorem.lima.entity.FinancialTransactionImpl; -import org.chorem.lima.entity.FiscalPeriod; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -/** - * Test on financial transaction service. - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ - */ -public class FinancialTransactionServiceTest extends AbstractLimaTest { - - /** - * Init db with some transaction. - * - * @throws ParseException - * @throws LimaException - */ - @Before - public void initTransactions() throws ParseException, LimaException { - - EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); - Account accountVmpVae = accountService.getAccountByNumber("511"); - - // TODO echatellier 20120116 improve period choice - FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0); - - FinancialTransaction transaction1 = new FinancialTransactionImpl(); - transaction1.setTransactionDate(df.parse("April 4, 2012")); - transaction1.setEntryBook(journalDesVentes); - transaction1.setFinancialPeriod(financialPeriod); - transaction1 = financialTransactionService.createFinancialTransaction(transaction1); - - Entry tr1Entry1 = new EntryImpl(); - tr1Entry1.setAmount(BigDecimal.valueOf(42.0)); - tr1Entry1.setAccount(accountVmpVae); - tr1Entry1.setFinancialTransaction(transaction1); - tr1Entry1.setDescription("test desc"); - tr1Entry1.setVoucher("voucher"); - tr1Entry1 = financialTransactionService.createEntry(tr1Entry1); - - Entry tr1Entry2 = new EntryImpl(); - tr1Entry2.setAmount(BigDecimal.valueOf(42.0)); - tr1Entry2.setDebit(true); - tr1Entry2.setAccount(accountVmpVae); - tr1Entry2.setFinancialTransaction(transaction1); - tr1Entry2.setDescription("test desc"); - tr1Entry2.setVoucher("voucher"); - tr1Entry2 = financialTransactionService.createEntry(tr1Entry2); - } - - /** - * Test to find all unbalanced transactions. - * Nothing wrong here. - * - * @throws ParseException - * @throws LimaException - */ - @Test - public void testGetInexactTransactionAllGood() throws ParseException, LimaException { - FiscalPeriod fiscalPeriod = fiscalPeriodService.getAllFiscalPeriods().get(0); - List<FinancialTransaction> transactions = financialTransactionService.getAllInexactFinancialTransactions(fiscalPeriod); - Assert.assertTrue(transactions.isEmpty()); - } - - /** - * Test to find all unbalanced transactions. - * - * wrong data. - * - * @throws ParseException - * @throws LimaException - */ - @Test - public void testGetInexactTransactionNotAllGood() throws ParseException, LimaException { - - EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); - Account accountVmpVae = accountService.getAccountByNumber("511"); - - // TODO echatellier 20120116 improve period choice - FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0); - - FinancialTransaction transaction1 = new FinancialTransactionImpl(); - transaction1.setTransactionDate(df.parse("April 5, 2012")); - transaction1.setEntryBook(journalDesVentes); - transaction1.setFinancialPeriod(financialPeriod); - transaction1 = financialTransactionService.createFinancialTransaction(transaction1); - - Entry tr1Entry1 = new EntryImpl(); - tr1Entry1.setAmount(BigDecimal.valueOf(42.0)); - tr1Entry1.setAccount(accountVmpVae); - tr1Entry1.setFinancialTransaction(transaction1); - //tr1Entry1.setDescription("test desc"); - tr1Entry1.setVoucher("voucher"); - tr1Entry1 = financialTransactionService.createEntry(tr1Entry1); - - Entry tr1Entry2 = new EntryImpl(); - tr1Entry2.setAmount(BigDecimal.valueOf(42.0)); - tr1Entry2.setDebit(true); - tr1Entry2.setAccount(accountVmpVae); - tr1Entry2.setFinancialTransaction(transaction1); - tr1Entry2.setDescription("test desc"); - tr1Entry2.setVoucher("voucher"); - tr1Entry2 = financialTransactionService.createEntry(tr1Entry2); - - // one in period - FiscalPeriod fiscalPeriod = fiscalPeriodService.getAllFiscalPeriods().get(0); - List<FinancialTransaction> transactions = financialTransactionService.getAllInexactFinancialTransactions(fiscalPeriod); - Assert.assertEquals(1, transactions.size()); - } - - /** - * Test to find all unbalanced transactions. - * - * Test only unbalanced transactions (no data errors : fields). - * - * @throws ParseException - * @throws LimaException - */ - @Test - public void testGetUnbalancedTransactionNotAllGood() throws ParseException, LimaException { - - EntryBook journalDesVentes = entryBookService.getEntryBookByCode("jdv"); - Account accountVmpVae = accountService.getAccountByNumber("511"); - - // TODO echatellier 20120116 improve period choice - FinancialPeriod financialPeriod = financialPeriodService.getAllFinancialPeriods().get(0); - - FinancialTransaction transaction1 = new FinancialTransactionImpl(); - transaction1.setTransactionDate(df.parse("April 5, 2012")); - transaction1.setEntryBook(journalDesVentes); - transaction1.setFinancialPeriod(financialPeriod); - transaction1 = financialTransactionService.createFinancialTransaction(transaction1); - - Entry tr1Entry1 = new EntryImpl(); - tr1Entry1.setAmount(BigDecimal.valueOf(54.0)); - tr1Entry1.setAccount(accountVmpVae); - tr1Entry1.setFinancialTransaction(transaction1); - tr1Entry1.setDescription("test desc"); - tr1Entry1.setVoucher("voucher"); - tr1Entry1 = financialTransactionService.createEntry(tr1Entry1); - - // one in period - FiscalPeriod fiscalPeriod = fiscalPeriodService.getAllFiscalPeriods().get(0); - List<FinancialTransaction> transactions = financialTransactionService.getAllInexactFinancialTransactions(fiscalPeriod); - Assert.assertEquals(1, transactions.size()); - } -} Added: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java (rev 0) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java 2012-02-21 14:20:35 UTC (rev 3331) @@ -0,0 +1,62 @@ +/* + * #%L + * + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package org.chorem.lima.business.accountingrules; + +import org.chorem.lima.business.EntryBookServiceImplTest; +import org.chorem.lima.business.LimaConfig; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Add configuration to add specific test on French rules set. + * + * (redo all test defined in AccountServiceImplTest). + * + * Plus ajout de test specific à la locale FR. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class EntryBookServiceRuleFrTest extends EntryBookServiceImplTest { + + @BeforeClass + public static void installFrenchRule() throws Exception { + LimaConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); + } + + /** + * Test une fois que la regles est correctement instanciée car + * elle peut être mise en cache dans {@link LimaConfig}. + */ + @Test + public void testRuleInstance() { + Assert.assertTrue(LimaConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); + } +} Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java (rev 0) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java 2012-02-21 14:20:35 UTC (rev 3331) @@ -0,0 +1,62 @@ +/* + * #%L + * + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package org.chorem.lima.business.accountingrules; + +import org.chorem.lima.business.EntryBookServiceImplTest; +import org.chorem.lima.business.LimaConfig; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Add configuration to add specific test on French rules set. + * + * (redo all test defined in AccountServiceImplTest). + * + * Plus ajout de test specific à la locale FR. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class FinancialPeriodServiceRuleFrTest extends EntryBookServiceImplTest { + + @BeforeClass + public static void installFrenchRule() throws Exception { + LimaConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); + } + + /** + * Test une fois que la regles est correctement instanciée car + * elle peut être mise en cache dans {@link LimaConfig}. + */ + @Test + public void testRuleInstance() { + Assert.assertTrue(LimaConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); + } +} Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java (rev 0) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java 2012-02-21 14:20:35 UTC (rev 3331) @@ -0,0 +1,62 @@ +/* + * #%L + * + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package org.chorem.lima.business.accountingrules; + +import org.chorem.lima.business.FinancialTransactionServiceImplTest; +import org.chorem.lima.business.LimaConfig; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Add configuration to add specific test on French rules set. + * + * (redo all test defined in AccountServiceImplTest). + * + * Plus ajout de test specific à la locale FR. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class FinancialTransactionServiceRuleFrTest extends FinancialTransactionServiceImplTest { + + @BeforeClass + public static void installFrenchRule() throws Exception { + LimaConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); + } + + /** + * Test une fois que la regles est correctement instanciée car + * elle peut être mise en cache dans {@link LimaConfig}. + */ + @Test + public void testRuleInstance() { + Assert.assertTrue(LimaConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); + } +} Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java (rev 0) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java 2012-02-21 14:20:35 UTC (rev 3331) @@ -0,0 +1,62 @@ +/* + * #%L + * + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package org.chorem.lima.business.accountingrules; + +import org.chorem.lima.business.FiscalPeriodServiceImplTest; +import org.chorem.lima.business.LimaConfig; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Add configuration to add specific test on French rules set. + * + * (redo all test defined in AccountServiceImplTest). + * + * Plus ajout de test specific à la locale FR. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class FiscalPeriodServiceRuleFrTest extends FiscalPeriodServiceImplTest { + + @BeforeClass + public static void installFrenchRule() throws Exception { + LimaConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); + } + + /** + * Test une fois que la regles est correctement instanciée car + * elle peut être mise en cache dans {@link LimaConfig}. + */ + @Test + public void testRuleInstance() { + Assert.assertTrue(LimaConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); + } +} Property changes on: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL
participants (1)
-
echatellier@users.chorem.org