Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / org.gvsig.exportto / org.gvsig.exportto.swing / org.gvsig.exportto.swing.api / src / test / java / org / gvsig / exportto / swing / ExporttoSwingManagerTest.java @ 34981

History | View | Annotate | Download (3.09 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;
23

    
24
import org.gvsig.exportto.ExporttoLocator;
25
import org.gvsig.exportto.ExporttoManager;
26
import org.gvsig.fmap.crs.CRSFactory;
27
import org.gvsig.fmap.dal.DALLocator;
28
import org.gvsig.fmap.dal.DataManager;
29
import org.gvsig.fmap.dal.DataStoreParameters;
30
import org.gvsig.fmap.dal.exception.InitializeException;
31
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
32
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
33
import org.gvsig.fmap.dal.feature.FeatureStore;
34
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
35
import org.gvsig.tools.service.ServiceException;
36

    
37
/**
38
 * API compatibility tests for {@link ExporttoSwingManager}
39
 * implementations.
40
 * 
41
 * @author gvSIG Team
42
 * @version $Id$
43
 */
44
public abstract class ExporttoSwingManagerTest extends
45
    AbstractLibraryAutoInitTestCase {
46

    
47
    protected ExporttoManager manager;
48
    protected ExporttoSwingManager swingManager;
49
    protected DataManager dataManager = null;
50
    
51
    @Override
52
    protected void doSetUp() throws Exception {
53
        manager = ExporttoLocator.getManager();
54
        swingManager = ExporttoSwingLocator.getSwingManager();
55
        dataManager = DALLocator.getDataManager();
56
    }
57

    
58
    public void testGetManager() {
59
        assertEquals(manager, swingManager.getManager());
60
    }
61

    
62
    public void testCreateWindowManager() {
63
        ExporttoWindowManager windowManager = null;
64
        swingManager.registerWindowManager(windowManager);
65
        assertEquals(swingManager.getWindowManager(), windowManager);
66
    }
67

    
68
    public void testCreationJExporttoServicePanel()
69
        throws ServiceException, ValidateDataParametersException, InitializeException, ProviderNotRegisteredException {
70

    
71
        JExporttoServicePanel panel1 =
72
            swingManager.createExportto(createMemoryFeatureStore(), CRSFactory.getCRS("EPSG:4326"));
73

    
74
        assertNotNull(panel1);
75
    }
76
    
77
    private FeatureStore createMemoryFeatureStore() throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException{        
78
        DataStoreParameters memoryParameters = dataManager.createStoreParameters("Memory");    
79
        return (FeatureStore) dataManager.openStore("Memory", memoryParameters);
80
    }
81

    
82
}