1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.cdm.test.function;
|
12
|
|
13
|
|
14
|
import java.io.FileNotFoundException;
|
15
|
|
16
|
import org.apache.log4j.Logger;
|
17
|
import org.junit.Ignore;
|
18
|
import org.junit.Test;
|
19
|
import org.unitils.spring.annotation.SpringBeanByType;
|
20
|
|
21
|
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
|
22
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
23
|
import eu.etaxonomy.cdm.api.service.ILocationService;
|
24
|
import eu.etaxonomy.cdm.api.service.ILocationService.NamedAreaVocabularyType;
|
25
|
import eu.etaxonomy.cdm.database.CdmDataSource;
|
26
|
import eu.etaxonomy.cdm.database.DbSchemaValidation;
|
27
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
28
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
29
|
import eu.etaxonomy.cdm.test.integration.CdmIntegrationTest;
|
30
|
|
31
|
/**
|
32
|
* <h2>NOTE</h2>
|
33
|
* This is a test for sole development purposes, it is not
|
34
|
* touched by mvn test since it is not matching the "\/**\/*Test" pattern,
|
35
|
* but it should be annotate with @Ignore when running the project a s junit suite in eclipse
|
36
|
*
|
37
|
* @author n.hoffman
|
38
|
* @created 12.05.2009
|
39
|
* @version 1.0
|
40
|
*/
|
41
|
@Ignore
|
42
|
public class TestLocationServiceImpl extends CdmIntegrationTest{
|
43
|
private static final Logger logger = Logger
|
44
|
.getLogger(TestLocationServiceImpl.class);
|
45
|
|
46
|
@SpringBeanByType
|
47
|
private ILocationService locationService;
|
48
|
|
49
|
@Ignore
|
50
|
@Test
|
51
|
public void testGetTopLevelContinentAreas(){
|
52
|
locationService.getTopLevelNamedAreasByVocabularyType(NamedAreaVocabularyType.CONTINENT);
|
53
|
}
|
54
|
|
55
|
@Test
|
56
|
public void testGetTopLevelTdwgAreas(){
|
57
|
locationService.getTopLevelNamedAreasByVocabularyType(NamedAreaVocabularyType.TDWG_AREA);
|
58
|
}
|
59
|
|
60
|
@Ignore
|
61
|
@Test
|
62
|
public void testGetTopLevelCoutryAreas(){
|
63
|
locationService.getTopLevelNamedAreasByVocabularyType(NamedAreaVocabularyType.COUNTRY);
|
64
|
}
|
65
|
|
66
|
@Ignore
|
67
|
@Test
|
68
|
public void testGetTopLevelWaterbodyAreas(){
|
69
|
locationService.getTopLevelNamedAreasByVocabularyType(NamedAreaVocabularyType.WATERBODY);
|
70
|
}
|
71
|
|
72
|
public void testNewDatasourceClass(){
|
73
|
// String server = "192.168.2.10";
|
74
|
// String database = "cdm_test_andreasM";
|
75
|
// String username = "edit";
|
76
|
// String password = CdmUtils.readInputLine("Password: ");
|
77
|
DbSchemaValidation dbSchemaValidation = DbSchemaValidation.CREATE;
|
78
|
|
79
|
// ICdmDataSource datasource = CdmDataSource.NewMySqlInstance(server, database, username, password);
|
80
|
ICdmDataSource datasource = CdmDataSource.NewH2EmbeddedInstance("test", "sa", "", null);
|
81
|
CdmApplicationController appCtr = CdmApplicationController.NewInstance(datasource, dbSchemaValidation);
|
82
|
|
83
|
ConversationHolder conversation = appCtr.NewConversation();
|
84
|
conversation.bind();
|
85
|
|
86
|
Taxon taxon = Taxon.NewInstance(null, null);
|
87
|
|
88
|
}
|
89
|
|
90
|
/* (non-Javadoc)
|
91
|
* @see eu.etaxonomy.cdm.test.integration.CdmIntegrationTest#createTestData()
|
92
|
*/
|
93
|
@Override
|
94
|
public void createTestDataSet() throws FileNotFoundException {
|
95
|
// TODO Auto-generated method stub
|
96
|
|
97
|
}
|
98
|
}
|