Last change
on this file since 9393 was
9393,
checked in by mlg, 13 years ago
|
Modifications to use the last version of jiwigo-ws-api
|
File size:
1008 bytes
|
Line | |
---|
1 | package fr.mael.jiwigo.service; |
---|
2 | |
---|
3 | import junit.framework.Assert; |
---|
4 | |
---|
5 | import org.junit.Test; |
---|
6 | |
---|
7 | import fr.mael.jiwigo.Main; |
---|
8 | import fr.mael.jiwigo.TestBase; |
---|
9 | import fr.mael.jiwigo.om.Category; |
---|
10 | import fr.mael.jiwigo.om.Image; |
---|
11 | |
---|
12 | public class ServicesTest extends TestBase { |
---|
13 | |
---|
14 | public ServicesTest() { |
---|
15 | super(); |
---|
16 | } |
---|
17 | |
---|
18 | @Test |
---|
19 | public void testCreer() throws Exception { |
---|
20 | Category cat = null; |
---|
21 | for (Category category : CategoryService.getInstance(Main.sessionManager).list(true)) { |
---|
22 | if (category.getIdentifier().equals(3)) { |
---|
23 | cat = category; |
---|
24 | break; |
---|
25 | } |
---|
26 | } |
---|
27 | Image image = ImageService.getInstance(Main.sessionManager).listByCategory(cat.getIdentifier(), true).get(0); |
---|
28 | int firstCount = CommentService.getInstance(Main.sessionManager).list(image.getIdentifier()).size(); |
---|
29 | CommentService.getInstance(Main.sessionManager).create("comment test", image.getIdentifier(), "none"); |
---|
30 | Assert.assertSame(firstCount + 1, CommentService.getInstance(Main.sessionManager).list(image.getIdentifier()) |
---|
31 | .size()); |
---|
32 | } |
---|
33 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.