Last change
on this file since 6963 was
6963,
checked in by mlg, 14 years ago
|
Add unit tests :
New unit tests for the services :
- CategoryServiceTest that tests the listing of the categories and the creation of a category
- ServicesTest that tests the listing of the categories, then the listing of images of a category and finally adding a comment to an image.
Add informations in the install.txt file to explain how to build the executable jar file via maven (this allows to execute the tests before building, and does not build if tests fail).
|
File size:
787 bytes
|
Line | |
---|
1 | package fr.mael.jiwigo.service; |
---|
2 | |
---|
3 | import java.io.IOException; |
---|
4 | import java.util.Date; |
---|
5 | |
---|
6 | import junit.framework.Assert; |
---|
7 | |
---|
8 | import org.junit.Test; |
---|
9 | |
---|
10 | import fr.mael.jiwigo.TestBase; |
---|
11 | import fr.mael.jiwigo.dao.CategoryDao; |
---|
12 | |
---|
13 | public class CategoryServiceTest extends TestBase { |
---|
14 | public CategoryServiceTest() { |
---|
15 | super(); |
---|
16 | } |
---|
17 | |
---|
18 | /** |
---|
19 | * Test of the listing method |
---|
20 | */ |
---|
21 | @Test |
---|
22 | public void ListerTest() { |
---|
23 | try { |
---|
24 | CategoryDao.getInstance().lister(true); |
---|
25 | CategoryDao.getInstance().lister(false); |
---|
26 | } catch (IOException e) { |
---|
27 | e.printStackTrace(); |
---|
28 | } |
---|
29 | } |
---|
30 | |
---|
31 | /** |
---|
32 | * Test of the creation method |
---|
33 | */ |
---|
34 | @Test |
---|
35 | public void creerTest() { |
---|
36 | Date date = new Date(); |
---|
37 | Assert.assertSame(true, CategoryService.getInstance().creer("Category" + date.getTime())); |
---|
38 | } |
---|
39 | |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.