root / org.gvsig.educa.thematicmap / trunk / org.gvsig.educa.thematicmap / org.gvsig.educa.thematicmap.lib / org.gvsig.educa.thematicmap.lib.api / src / test / java / org / gvsig / educa / thematicmap / ThematicMapManagerTest.java @ 2
History | View | Annotate | Download (3.32 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.educa.thematicmap; |
23 |
|
24 |
import org.gvsig.educa.thematicmap.compilation.ThematicMapCompilation; |
25 |
import org.gvsig.educa.thematicmap.compilation.ThematicMapCompiler; |
26 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
27 |
|
28 |
/**
|
29 |
* API compatibility tests for {@link ThematicMapManager} implementations.
|
30 |
*
|
31 |
* @author gvSIG Team
|
32 |
* @version $Id$
|
33 |
*/
|
34 |
public abstract class ThematicMapManagerTest extends |
35 |
AbstractLibraryAutoInitTestCase { |
36 |
|
37 |
protected ThematicMapManager manager;
|
38 |
|
39 |
@Override
|
40 |
protected void doSetUp() throws Exception { |
41 |
manager = ThematicMapLocator.getManager(); |
42 |
} |
43 |
|
44 |
/**
|
45 |
* Test {@link ThematicMapManager#getInstallationMapFolder()} and
|
46 |
* {@link ThematicMapManager#setInstallationMapFolder(String)} and initial
|
47 |
* value
|
48 |
*/
|
49 |
public void testSetGetInstallationFolder() { |
50 |
String original = manager.getInstallationMapFolder();
|
51 |
|
52 |
// Check initial value
|
53 |
assertNull("default InstallationMapFolder must be null", original);
|
54 |
// Check set new value
|
55 |
String newFolder = "/tmp/xxx"; |
56 |
manager.setInstallationMapFolder(newFolder); |
57 |
assertEquals(newFolder, manager.getInstallationMapFolder()); |
58 |
|
59 |
} |
60 |
|
61 |
/**
|
62 |
* Test {@link ThematicMapManager#getTemporalFolder()} and
|
63 |
* {@link ThematicMapManager#getTemporalFolder(String)} and initial
|
64 |
* value
|
65 |
*/
|
66 |
public void testSetGetTemporalFolder() { |
67 |
String original = manager.getTemporalFolder();
|
68 |
|
69 |
// Check initial value
|
70 |
assertNotNull("default TemporalFolder not initialized", original);
|
71 |
assertTrue("default TemporalFolder not initialized",
|
72 |
original.length() > 0);
|
73 |
|
74 |
// Check set new value
|
75 |
String newFolder = "/tmp/xxx1"; |
76 |
manager.setInstallationMapFolder(newFolder); |
77 |
assertEquals(newFolder, manager.getTemporalFolder()); |
78 |
|
79 |
// Restore original value
|
80 |
manager.setInstallationMapFolder(original); |
81 |
} |
82 |
|
83 |
/**
|
84 |
* Test {@link ThematicMapManager#createCompilationInstance()}
|
85 |
*
|
86 |
*/
|
87 |
public void testCreateCompilation() { |
88 |
ThematicMapCompilation compilation = |
89 |
manager.createCompilationInstance(); |
90 |
|
91 |
assertNotNull(compilation); |
92 |
} |
93 |
|
94 |
/**
|
95 |
* Test {@link ThematicMapManager#createCompilerInstance()}
|
96 |
*
|
97 |
*/
|
98 |
public void testCreateCompiler() { |
99 |
ThematicMapCompiler compiler = |
100 |
manager.createCompilerInstance(); |
101 |
|
102 |
assertNotNull(compiler); |
103 |
} |
104 |
} |