Statistics
| Revision:

gvsig-3d / 2.1 / trunk / org.gvsig.gvsig3d / org.gvsig.gvsig3d.lib / org.gvsig.gvsig3d.lib.api / src / test / java / org / gvsig / gvsig3d / Gvsig3DServiceTest.java @ 385

History | View | Annotate | Download (3.22 KB)

1
/* gvSIG 3D extension for gvSIG
2
 *
3
 * Copyright (C) 2012 Prodevelop.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Prodevelop, S.L.
22
 *   Pza. Don Juan de Villarrasa, 14 - 5
23
 *   46001 Valencia
24
 *   Spain
25
 *
26
 *   +34 963 510 612
27
 *   +34 963 510 968
28
 *   prode@prodevelop.es
29
 *   http://www.prodevelop.es
30
 */
31
/*
32
 * AUTHORS:
33
 * 2012 AI2 - Instituto Universitario de Automatica e Informatica Industrial.
34
 * Universitat Politecnica de Valencia (UPV)
35
 * http://www.ai2.upv.es
36
 */
37

    
38
package org.gvsig.gvsig3d;
39

    
40
import org.gvsig.tools.dynobject.DynObject;
41
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
42

    
43
/**
44
 * API compatibility tests for {@link Gvsig3DService} implementations.
45
 * 
46
 * @author gvSIG Team
47
 * @version $Id$
48
 */
49
public abstract class Gvsig3DServiceTest extends
50
    AbstractLibraryAutoInitTestCase {
51

    
52
    protected Gvsig3DManager manager;
53

    
54
    @Override
55
    protected void doSetUp() throws Exception {
56
        manager = Gvsig3DLocator.getManager();
57
    }
58

    
59
    /**
60
     * Returns an instance of the {@link Gvsig3DService}.
61
     * 
62
     * @return a {@link Gvsig3DService} instance
63
     * @throws Exception
64
     *             if there is any error creating the instance
65
     */
66
    protected Gvsig3DService createService() throws Exception {
67
        DynObject parameters =
68
            manager
69
                .createServiceParameters(Gvsig3DManagerTest.TEST_PROVIDER_NAME);
70
        return (Gvsig3DService) manager.getService(parameters);
71
    }
72

    
73
    /**
74
     * Test for the {@link Gvsig3DService#getMessage()} method.
75
     * 
76
     * @throws Exception
77
     *             if there is any error in the tests
78
     */
79
    public void testGvsig3DServiceMessage() throws Exception {
80
        Gvsig3DService cookie = createService();
81

    
82
        String message = null;
83
        message = cookie.getMessage();
84

    
85
        assertNotNull(message);
86
        assertTrue(message.length() > 0);
87
    }
88

    
89
    /**
90
     * Test for the {@link Gvsig3DService#getDate()} method.
91
     * 
92
     * @throws Exception
93
     *             if there is any error in the tests
94
     */
95
    public void testGvsig3DServiceDate() throws Exception {
96
        Gvsig3DService cookie = createService();
97
        cookie.getMessage();
98
        assertNotNull(cookie.getDate());
99
    }
100

    
101
    /**
102
     * Test for the {@link Gvsig3DService#getManager()} method.
103
     * 
104
     * @throws Exception
105
     *             if there is any error in the tests
106
     */
107
    public void testGvsig3DServiceManager() throws Exception {
108
        Gvsig3DService cookie = createService();
109
        assertEquals(manager, cookie.getManager());
110
    }
111
}