root / branches / v10 / extensions / extPublish / src-test / com / iver / cit / gvsig / publish / infoProject / Test_queryProject.java @ 13570
History | View | Annotate | Download (3 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
|
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 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Iba?ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
/**
|
42 |
* @author Jos? Vicente Hig?n (josevicente.higon@iver.es)
|
43 |
*/
|
44 |
package com.iver.cit.gvsig.publish.infoProject; |
45 |
|
46 |
import java.io.File; |
47 |
import java.net.URL; |
48 |
|
49 |
import com.iver.cit.gvsig.project.Project; |
50 |
import com.iver.cit.gvsig.publish.infoProject.InfoFactory; |
51 |
import com.iver.cit.gvsig.publish.infoProject.ProjectInfo; |
52 |
import com.iver.cit.gvsig.publish.util.LocalResourcesTestUtilities; |
53 |
|
54 |
import junit.framework.TestCase; |
55 |
/**
|
56 |
* Test of ProjectInfImpl
|
57 |
*
|
58 |
* @author Jos? Vicente Hig?n (josevicente.higon@iver.es)
|
59 |
*
|
60 |
*/
|
61 |
public class Test_queryProject extends TestCase { |
62 |
//gvSIG project
|
63 |
private Project gvProj = null; |
64 |
//info about project to publish
|
65 |
private ProjectInfo prjInf = null; |
66 |
/**
|
67 |
* Initialice test
|
68 |
*/
|
69 |
protected void setUp() throws Exception { |
70 |
super.setUp();
|
71 |
File f = null; |
72 |
URL url = this.getClass().getResource("../resources"); |
73 |
if (url == null) |
74 |
throw new Exception("Can't find resources directory"); |
75 |
f = new File(url.getFile()); |
76 |
if (!f.exists())
|
77 |
throw new Exception("Can't find resources dir"); |
78 |
//get a new project from the utilities
|
79 |
LocalResourcesTestUtilities util = new LocalResourcesTestUtilities(f.getAbsolutePath());
|
80 |
this.gvProj = util.getProject();
|
81 |
//creates a instance to get project information
|
82 |
this.prjInf = InfoFactory.getProjectInfo(gvProj);
|
83 |
} |
84 |
/**
|
85 |
* Just before finish the test
|
86 |
*/
|
87 |
protected void tearDown() throws Exception { |
88 |
super.tearDown();
|
89 |
} |
90 |
/**
|
91 |
* test getName() method
|
92 |
*/
|
93 |
public void test_getName(){ |
94 |
|
95 |
this.assertEquals("info project fails", "test_project_name",this.prjInf.getName()); |
96 |
System.out.println(this.prjInf.getName()); |
97 |
return;
|
98 |
} |
99 |
/**
|
100 |
* test getOwner method
|
101 |
*
|
102 |
*/
|
103 |
public void test_getOwner(){ |
104 |
this.assertEquals("info project fails", "test_project_owner",this.prjInf.getOwner()); |
105 |
System.out.println(this.prjInf.getOwner()); |
106 |
return;
|
107 |
} |
108 |
|
109 |
} |