View Javadoc
1   package com.tvnavig.client.test;
2   
3   import java.util.Calendar;
4   import java.util.List;
5   
6   import junit.framework.TestCase;
7   
8   import com.tvnavig.server.searchengine.service.common.AssetOGC;
9   import com.tvnavig.server.user.service.common.UserDomainResult;
10  
11  import fr.paris.lutece.plugins.parisvideo.service.ParisvideoService;
12  
13  /**
14   * Le webservice ParisTV n'est accessible que depuis l'intranet
15   * ce test unitaire n'a donc aucune chance de fonctionner depuis Continuum depuis internet
16   */
17  public class ClientTest extends TestCase
18  {
19  	//http://v01-vnavig.apps.paris.mdp
20  	private final String LOGIN = "flex";
21  	private final String PASSWORD = "flex";
22  	
23  	public void testTest() throws Exception
24  	{ 
25  		ParisvideoService videoService = new ParisvideoService();
26  		UserDomainResult[] udrArray = videoService.getDomain(LOGIN, PASSWORD);
27  		
28  		UserDomainResult firstUserDomain = udrArray[0];
29  		
30  		List<AssetOGC> list = videoService.getVideos(firstUserDomain.getId(), null, null, null, null, null);
31  		assertTrue(list.size()>0);
32  		
33  		List<AssetOGC> list2 = videoService.getVideos(firstUserDomain.getId(), "velib", null, null, null, null);
34  		assertTrue(list2.size()>0);
35  
36  		Calendar beginDate = Calendar.getInstance();
37  		beginDate.set(2009, 04-1, 01);
38  //		beginDate.add ( Calendar.DAY_OF_YEAR, -100 );
39  		Calendar endDate = Calendar.getInstance();
40  		List<AssetOGC> list3 = videoService.getVideos(firstUserDomain.getId(), null, null, beginDate, endDate, null);
41  		assertTrue(list3.size()>0);
42  	}
43  }