source: extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/CategoryServiceTest.java @ 9921

Last change on this file since 9921 was 9921, checked in by mlg, 13 years ago

Adds spring for the dependency injection
Deletion of jdom (not useful just for a class that manipulates a simple XML file)

File size: 1.0 KB
Line 
1package fr.mael.jiwigo.service;
2
3import java.io.IOException;
4import java.util.Date;
5
6import junit.framework.Assert;
7
8import org.junit.Test;
9
10import fr.mael.jiwigo.TestBase;
11import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException;
12import fr.mael.jiwigo.transverse.util.spring.SpringUtils;
13
14public class CategoryServiceTest extends TestBase {
15    public CategoryServiceTest() {
16        super();
17    }
18
19    /**
20     *  Test of the listing method
21     * @throws ProxyAuthenticationException
22     */
23    @Test
24    public void ListerTest() throws ProxyAuthenticationException {
25        try {
26            SpringUtils.getCategoryService().list(true);
27            SpringUtils.getCategoryService().list(false);
28        } catch (IOException e) {
29            e.printStackTrace();
30        }
31    }
32
33    /**
34     * Test of the creation method
35     * @throws ProxyAuthenticationException
36     */
37    @Test
38    public void creerTest() throws ProxyAuthenticationException {
39        Date date = new Date();
40        Assert.assertSame(true, SpringUtils.getCategoryService().create("Category" + date.getTime()));
41    }
42
43}
Note: See TracBrowser for help on using the repository browser.