source: extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/TestBase.java @ 6963

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: 610 bytes
Line 
1package fr.mael.jiwigo;
2
3import junit.framework.Assert;
4
5import org.junit.Test;
6
7import fr.mael.jiwigo.transverse.session.SessionManager;
8
9public class TestBase {
10    public TestBase() {
11        Main.sessionManager = new SessionManager("mael", "motdepasse", "http://mael.piwigo.com");
12        if (!Main.sessionManager.processLogin()) {
13            try {
14                throw new Exception("Connection failed");
15            } catch (Exception e) {
16                e.printStackTrace();
17            }
18        }
19    }
20
21    /**
22     * Fake test so that maven assembly plugin's build does not fail
23     */
24    @Test
25    public void fakeTest() {
26        Assert.assertSame(true, true);
27    }
28}
Note: See TracBrowser for help on using the repository browser.