svn-gvsig-desktop / branches / v2_0_0_prep / libraries / org.gvsig.exportto / org.gvsig.exportto.swing / org.gvsig.exportto.swing.impl / src / test / java / org / gvsig / exportto / swing / impl / JExporttoServicePanelTest.java @ 40030
History | View | Annotate | Download (3.1 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.exportto.swing.impl; |
23 |
|
24 |
import org.gvsig.exportto.ExporttoManager; |
25 |
import org.gvsig.exportto.ExporttoServiceException; |
26 |
import org.gvsig.exportto.swing.ExporttoSwingLocator; |
27 |
import org.gvsig.exportto.swing.ExporttoSwingManager; |
28 |
import org.gvsig.exportto.swing.JExporttoServicePanel; |
29 |
import org.gvsig.fmap.crs.CRSFactory; |
30 |
import org.gvsig.fmap.dal.DALLocator; |
31 |
import org.gvsig.fmap.dal.DataManager; |
32 |
import org.gvsig.fmap.dal.DataStoreParameters; |
33 |
import org.gvsig.fmap.dal.exception.InitializeException; |
34 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
35 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
36 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
37 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
38 |
import org.gvsig.tools.service.ServiceException; |
39 |
|
40 |
/**
|
41 |
* API compatibility tests for {@link JExporttoServicePanel} implementations.
|
42 |
*
|
43 |
* @author gvSIG Team
|
44 |
* @version $Id$
|
45 |
*/
|
46 |
public abstract class JExporttoServicePanelTest extends |
47 |
AbstractLibraryAutoInitTestCase { |
48 |
|
49 |
protected ExporttoManager manager;
|
50 |
protected ExporttoSwingManager swingManager;
|
51 |
protected DataManager dataManager = null; |
52 |
|
53 |
@Override
|
54 |
protected void doSetUp() throws Exception { |
55 |
swingManager = ExporttoSwingLocator.getSwingManager(); |
56 |
manager = swingManager.getManager(); |
57 |
dataManager = DALLocator.getDataManager(); |
58 |
|
59 |
IconThemeHelper.registerIcon("export-to", "wizard-export-to", this); |
60 |
} |
61 |
|
62 |
public void testJExporttoServicePanel() throws ServiceException, |
63 |
ExporttoServiceException, ValidateDataParametersException, |
64 |
InitializeException, ProviderNotRegisteredException { |
65 |
assertNotNull(swingManager); |
66 |
|
67 |
JExporttoServicePanel panel = |
68 |
swingManager.createExportto(createMemoryFeatureStore(), |
69 |
CRSFactory.getCRS("EPSG:4326"));
|
70 |
assertNotNull(panel); |
71 |
} |
72 |
|
73 |
private FeatureStore createMemoryFeatureStore() throws InitializeException, |
74 |
ProviderNotRegisteredException, ValidateDataParametersException { |
75 |
DataStoreParameters memoryParameters = |
76 |
dataManager.createStoreParameters("Memory");
|
77 |
return (FeatureStore) dataManager.openStore("Memory", memoryParameters); |
78 |
} |
79 |
} |