Project

General

Profile

Download (2.12 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2009 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.test.function;
11

    
12

    
13
import java.util.List;
14

    
15
import org.junit.AfterClass;
16
import org.junit.Assert;
17
import org.junit.BeforeClass;
18
import org.junit.Ignore;
19
import org.junit.Test;
20

    
21
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
22
import eu.etaxonomy.cdm.database.CdmDataSource;
23
import eu.etaxonomy.cdm.database.DbSchemaValidation;
24
import eu.etaxonomy.cdm.model.agent.Person;
25
import eu.etaxonomy.cdm.model.agent.Team;
26
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
27

    
28
/**
29
 * <h2>NOTE</h2>
30
 * This is a test for sole development purposes, it is not
31
 * touched by mvn test since it is not matching the "\/**\/*Test" pattern,
32
 * but it should be annotate with @Ignore when running the project a s junit suite in eclipse
33
 *
34
 * @author nho
35
 *
36
 */
37
@Ignore /* IGNORE in Suite */
38
public class TestAgentService {
39

    
40
	static CdmApplicationController appController;
41

    
42
	/**
43
	 * @throws java.lang.Exception
44
	 */
45
	@BeforeClass
46
	public static void setUpBeforeClass() throws Exception {
47
//		CdmDataSource dataSource = CdmDataSource.NewMySqlInstance("localhost", "test", -1, "", "");
48
		CdmDataSource dataSource = CdmDataSource.NewH2EmbeddedInstance("TestAgentService", "sa", "");
49
		appController = CdmApplicationController.NewInstance(dataSource, DbSchemaValidation.UPDATE);
50
	}
51

    
52
	@AfterClass
53
	public static void tearDownAfterClass() throws Exception {
54
		appController.close();
55
	}
56

    
57
	@Test
58
	public void testGetTeamOrPersonBaseUuidAndNomenclaturalTitle(){
59
		List<UuidAndTitleCache<Team>> result = appController.getAgentService().getTeamUuidAndNomenclaturalTitle();
60

    
61
		Assert.assertNotNull(result);
62
		Assert.assertTrue(result.size() > 0);
63
	}
64

    
65
	@Test
66
	public void testGetPersonUuidAndNomenclaturalTitle(){
67
		List<UuidAndTitleCache<Person>> result = appController.getAgentService().getPersonUuidAndTitleCache();
68

    
69
		Assert.assertNotNull(result);
70
		Assert.assertTrue(result.size() > 0);
71
	}
72

    
73
}
(3-3/9)