Revision 231

View differences:

tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/test/java/README.txt
1
#set( $symbol_pound = '#' )
2
#set( $symbol_dollar = '$' )
3
#set( $symbol_escape = '\' )
4
For each class you are going to test, create one Test class with the same
5
name as the class to test, ending with Test.
6

  
7
For example, the unit tests of the "ExampleLibrary" class are performed
8
by the "ExampleLibraryTest" class.
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/test/resources/README.txt
1
#set( $symbol_pound = '#' )
2
#set( $symbol_dollar = '$' )
3
#set( $symbol_escape = '\' )
4
Put into this folder the resources needed by your test classes.
5

  
6
This folder is added to the Tests classpath, so you can load any resources 
7
through the ClassLoader.
8

  
9
By default, in this folder you can find an example of log4j configuration,
10
prepared to log messages through the console, so logging works when you
11
run your tests classes.
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/test/resources/log4j.xml
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<!-- 
5
Log4J configuration file for unit tests execution.
6
 -->
7
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
8

  
9
	<!-- Appender configuration to show logging messages through the console -->
10
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
11
		<layout class="org.apache.log4j.PatternLayout">
12
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
13
		</layout>
14
	</appender>
15

  
16
	<!-- 
17
	Activate logging messages of DEBUG level of higher only for the
18
	DefaultExampleManager class.
19
	You can put full classes names or packages instead, to configure
20
	logging for all the classes and subpackages of the package.
21
	-->
22
	<category name="org.gvsig.scripting.impl.DefaultExampleManager">
23
		<priority value="DEBUG" />
24
	</category>
25

  
26
	<!-- 
27
	By default, show only logging messages of INFO level or higher, 
28
	through the previously configured CONSOLE appender. 
29
	-->
30
	<root>
31
		<priority value="INFO" />
32
		<appender-ref ref="CONSOLE" />
33
	</root>
34
</log4j:configuration>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/javadoc/overview.html
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title>org.gvsig.scripting package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>TODO: Example library overview.</p>
11
	
12
	<p>See the <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#overviewcomment">Javadoc Tool documentation about the overview file</a></p>
13

  
14
</body>
15
</html>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/log4j.xml
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<!-- 
5
Log4J configuration file for unit tests execution.
6
 -->
7
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
8

  
9
	<!-- Appender configuration to show logging messages through the console -->
10
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
11
		<layout class="org.apache.log4j.PatternLayout">
12
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
13
		</layout>
14
	</appender>
15

  
16
	<!-- 
17
	Activate logging messages of DEBUG level of higher only for the
18
	org.gvsig.tools packages.
19
	You can put full classes names or packages instead, to configure
20
	logging for all the classes and subpackages of the package.
21
	-->
22
	<category name="org.gvsig.tools">
23
		<priority value="DEBUG" />
24
	</category>
25
	<category name="org.gvsig.scripting">
26
		<priority value="DEBUG" />
27
	</category>
28

  
29
	<!-- 
30
	By default, show only logging messages of INFO level or higher, 
31
	through the previously configured CONSOLE appender. 
32
	-->
33
	<root>
34
		<priority value="INFO" />
35
		<appender-ref ref="CONSOLE" />
36
	</root>
37
</log4j:configuration>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/org/gvsig/scripting/impl/scripts/Test.groovy
1
/**
2
 * package com.disid.groovygis 
3
 */
4

  
5

  
6
/**
7
 *
8
 */
9
class Test {
10

  
11
	static main(args) {
12
		println "Hello world"
13
	}
14
}
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/org/gvsig/scripting/main/scolab.html
1
<html>
2
<body>
3

  
4
<img src="scolab-logo.png"><br>
5

  
6
<h2>Software Colaborativo</h2>
7
<br>
8

  
9
<p>EN CONSTRUCCION</p>
10

  
11
</body>
12
</html>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/org/gvsig/scripting/main/iver.html
1
<html>
2
<body>
3

  
4
<img src="iver-logo.png"><br>
5

  
6
<h2>IVER</h2>
7
<br>
8

  
9
<p>EN CONSTRUCCION</p>
10

  
11
</body>
12
</html>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/org/gvsig/scripting/main/csgis.html
1
<html>
2
<body>
3

  
4
<img src="csgis-logo.gif"><br>
5

  
6
<h2>CSGIS</h2>
7
<br>
8

  
9
<p>EN CONSTRUCCION</p>
10

  
11
</body>
12
</html>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/org/gvsig/scripting/main/disid.html
1
<html>
2
<body>
3

  
4
<img src="disid-logo.jpeg"><br>
5

  
6
<h2>DiSiD Technologies</h2>
7
<br>
8

  
9
<p>EN CONSTRUCCION</p>
10

  
11
</body>
12
</html>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/org/gvsig/scripting/main/gva.html
1
<html>
2
<body>
3

  
4
<img src="gva-logo_horiz_bicolor.png"><br>
5

  
6
<h2>GVA</h2>
7
<br>
8

  
9
<p>EN CONSTRUCCION</p>
10

  
11
</body>
12
</html>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/org/gvsig/scripting/main/gvsig.html
1
<html>
2
<body>
3

  
4
<img src="gvsig-logo1-association.jpg"><br>
5
<h2>gvSIG desktop</h2>
6
<p>
7
A Geographic Information System (GIS) for desktop environments<br>
8
<br>
9
Version: %(version)<br>
10
Build: %(build)<br>
11
&copy; Copyright gvSIG Association. All rights reserved.<br>
12
<br>
13
For more information, contact:<a href="http://www.gvsig.com/contact-info">http://www.gvsig.com/contact-info</a><br>
14
Or visit <a href="http://www.gvsig.org">http://www.gvsig.org</a>
15
</p>
16
<br>
17
<br>
18
<br>
19
<font face="Arial, Helvetica, sans-serif"> 
20
This program is free software; you can redistribute it and/or
21
modify it under the terms of the GNU General Public License
22
as published by the Free Software Foundation; either version 2
23
of the License, or (at your option) any later version.
24
<br>
25
This program is distributed in the hope that it will be useful,
26
but WITHOUT ANY WARRANTY; without even the implied warranty of
27
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
GNU General Public License for more dlogo.jpgetails.<br>
29
<br>
30
You should have received a copy of the GNU General Public License
31
along with this program; if not, write to the Free Software
32
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
33
<br>
34

  
35
<p>Agradecimientos:</p>
36
<ul>
37
	<li><a target="blank" href="http://www.gvsig.org/web/community/agradecimientos/traductores/">Traductores</a></li>
38
	<li><a target="blank" href="http://www.gvsig.org/web/community/agradecimientos/testers/">Testers</a></li>
39
	<li><a target="blank" href="http://www.gvsig.org/web/community/agradecimientos/otras-colaboraciones/">Otras colaboraciones</a></li>
40
</ul>
41
      
42

  
43
</font>
44
</body>
45
</html>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/org/gvsig/scripting/main/prodevelop.html
1
<html>
2
<body>
3

  
4
<img src="prodevelop-logo.png"><br>
5

  
6
<h2>PRODEVELOP</h2>
7
<br>
8

  
9
<p>EN CONSTRUCCION</p>
10

  
11
</body>
12
</html>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/org/gvsig/scripting/help/help.hs
1
<?xml version='1.0' encoding='ISO-8859-1' ?>
2
<!DOCTYPE helpset
3
  PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 1.0//EN"
4
 		  "http://java.sun.com/products/javahelp/helpset_1_0.dtd">
5

  
6
<?TestTarget this is data for the test target ?>
7

  
8
<helpset version="1.0">
9

  
10
  <!-- title -->
11
  <title>ScriptingFramework</title>
12

  
13
  <!-- maps -->
14
  <maps>
15
     <homeID>main</homeID>
16
     <mapref location="help.jhm"/>
17
  </maps>
18

  
19
  <!-- views -->
20
  <view>
21
    <name>TOC</name>
22
    <label>TOC</label>
23
    <type>javax.help.TOCView</type>
24
    <data>toc.xml</data>
25
  </view>
26
  <!--
27
  <view> <name>Index</name>
28
	 <label>Indice</label>
29
	 <type>javax.help.IndexView</type>
30
	 <data>index.xml</data>
31
	</view>
32
  
33
  <view>
34
	 <name>Search</name>
35
	 <label>Busqueda</label>
36
	 <type>javax.help.SearchView</type>
37
  </view>
38
  
39
  -->
40
  <view>
41
    <name>Favorites</name>
42
    <label>Favoritos</label>
43
    <type>javax.help.FavoritesView</type>
44
  </view>
45

  
46
  <presentation default="true" displayviewimages="false">
47
     <name>main window</name>
48
     <size width="700" height="400" />
49
     <location x="200" y="200" />
50
     <title>gvSIG - Ayuda en linea</title>
51
     <image>toplevelfolder</image>
52
     <toolbar>
53
       <helpaction image="action.back">javax.help.BackAction</helpaction>
54
       <helpaction image="action.forward">javax.help.ForwardAction</helpaction>
55
     </toolbar>
56
  </presentation>
57
</helpset>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/org/gvsig/scripting/help/introduction.html
1
<html>
2
<h1>Hola</h1>
3
</html>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/org/gvsig/scripting/help/toc.xml
1
<!DOCTYPE toc
2
  PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 1.0//EN"
3
             "http://java.sun.com/products/javahelp/toc_1_0.dtd">
4

  
5
<toc version="1.0">
6
	<tocitem text="gvSIG scripting framework">
7
		<tocitem text="Introduction" target="introduction.html"/>
8
	</tocitem>
9
</toc>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/org/gvsig/scripting/help/help.jhm
1
<?xml version='1.0' encoding='ISO-8859-1' ?>
2
<!DOCTYPE map
3
  PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Map Version 1.0//EN"
4
         "http://java.sun.com/products/javahelp/map_1_0.dtd">
5

  
6
<map version="1.0">
7
	<mapID target="introduction.html" url="introduction.html" />
8
</map>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/resources/README.txt
1
Put into this folder the resources needed by your library classes.
2

  
3
This folder is added to the runtime classpath, so you can load any resources 
4
through the ClassLoader.
5

  
6
By default, into this folder you can find some examples of resource bundle 
7
property files that may be used by your library classes.
tags/v1_0_0_Build_1/org.gvsig.scripting.main/src/main/java/org/gvsig/scripting/main/Main.java
1
package org.gvsig.scripting.main;
2

  
3
import java.awt.BorderLayout;
4
import java.awt.event.ActionEvent;
5
import java.awt.event.ActionListener;
6
import java.io.File;
7
import java.net.URL;
8
import java.util.Calendar;
9
import java.util.Date;
10
import java.util.HashMap;
11
import java.util.Map;
12

  
13
import javax.swing.JButton;
14
import javax.swing.JFrame;
15
import javax.swing.JMenu;
16
import javax.swing.JMenuBar;
17
import javax.swing.JMenuItem;
18
import javax.swing.JPanel;
19
import javax.swing.JToolBar;
20
import javax.swing.WindowConstants;
21

  
22
import org.gvsig.about.AboutLocator;
23
import org.gvsig.about.AboutManager;
24
import org.gvsig.about.AboutParticipant;
25
import org.gvsig.scripting.ScriptingManager;
26
import org.gvsig.scripting.swing.api.ScriptingSwingLocator;
27
import org.gvsig.scripting.swing.api.ScriptingUIManager;
28
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
29

  
30
public class Main {
31

  
32
    /**
33
	 * 
34
	 */
35
    private static final long serialVersionUID = -6853523688803006280L;
36
    static ScriptingUIManager uimanager;
37
    static AboutManager aboutManager;
38

  
39
    public static void main(String args[]) {
40
        Main main = new Main();
41
        main.doMain(args);
42
    }
43

  
44
    public void doMain(String args[]) {
45

  
46
        new DefaultLibrariesInitializer().fullInitialize();
47

  
48
        // This step is necessary for extensions to work:
49
        /*
50
         * try {
51
         * PlatformInit.getInstance().init(false, false);
52
         * } catch (Exception e1) {
53
         * // TODO Auto-generated catch block
54
         * e1.printStackTrace();
55
         * }
56
         */
57

  
58
        aboutManager = AboutLocator.getManager();
59

  
60
        Map<String, String> gvsig_vars = new HashMap<String, String>();
61
        gvsig_vars.put("version", "2.0.0");
62
        gvsig_vars.put("build", "2020");
63
        aboutManager.setProject("gvSIG Desktop", getResource("gvsig.html"),
64
            null, gvsig_vars);
65
        aboutManager.getProject().set("build", "2021");
66

  
67
        AboutParticipant participant;
68

  
69
        participant =
70
            aboutManager.addSponsor("Generalitat Valenciana",
71
                getResource("gva.html"), 1);
72

  
73
        participant =
74
            aboutManager.addDeveloper("IVER", getResource("iver.html"), 2);
75

  
76
        participant =
77
            aboutManager.addDeveloper("PRODEVELOP",
78
                getResource("prodevelop.html"), 2);
79

  
80
        participant =
81
            aboutManager.addDeveloper("Software Colaborativo",
82
                getResource("scolab.html"), 3);
83

  
84
        participant =
85
            aboutManager.addDeveloper("DISID", getResource("disid.html"), 4);
86

  
87
        participant =
88
            aboutManager.addDeveloper("UCLM", getResource("uclm.html"), 5);
89

  
90
        participant =
91
            aboutManager.addDeveloper("CSGIS", getResource("csgis.html"), 5);
92

  
93
        participant = aboutManager.getDeveloper("PRODEVELOP");
94
        participant.addContribution("JDBC Oracle Spatial",
95
            "Prodevelop S.L. ha mejorado y ampliado la extension extJDBC "
96
                + "y ha a?adido el driver para el acceso a informacion "
97
                + "geografica en bases de datos Oracle.", getDate(2009, 1, 2),
98
            getDate(2009, 12, 21));
99
        participant.addContribution("ArcIMS", "Cliente ArcIMS para gvSIG",
100
            getDate(2009, 1, 2), getDate(2009, 12, 21));
101

  
102
        participant = aboutManager.getDeveloper("DISID");
103
        participant.addContribution("Gesti?n de Internacionalizacion",
104
            "Extensi?n de Gesti?n de traducciones", getDate(2009, 1, 2),
105
            getDate(2009, 12, 21));
106

  
107
        participant = aboutManager.getDeveloper("UCLM");
108
        participant.addContribution("JCRS",
109
            "Extensi?n para el manejo de Sistemas de Referencia de "
110
                + "Coordenadas", getDate(2009, 1, 2), getDate(2009, 12, 21));
111

  
112
        participant =
113
            aboutManager.addSponsor("Junta Castilla y Le?n",
114
                getResource("castillaLeon.html"), 2);
115
        participant.addContribution("Backup del fichero GVP",
116
            "Backup automatico del gvp antes de guardar", getDate(2009, 6, 1),
117
            getDate(2009, 12, 1));
118
        participant.addContribution("Herramienta de informacion rapida",
119
            "Herramienta que muestra un tip con la informacion de las "
120
                + "geometrias sobre las que pasa el puntero",
121
            getDate(2009, 6, 1), getDate(2009, 12, 1));
122
        participant.addContribution("Herramientas de seleccion",
123
            "Varias herramientas de seleccion", 2009, 6, 1, 2009, 12, 1);
124

  
125
        participant =
126
            aboutManager.addSponsor("Region de Murcia",
127
                getResource("regionDeMurcia.html"), 2);
128
        participant.addContribution("ArcSDE",
129
            "Extesi?n de la Aplicaci?n para la conexi?n con una Base de "
130
                + "Datos ArcSDE.", getDate(2009, 6, 1), getDate(2009, 12, 1));
131

  
132
        participant =
133
            aboutManager.addTranslator("Gustavo P?rez",
134
                getResource("gustavoPerez.html"), 1);
135
        participant
136
            .addContribution("traducci?n multidioma", "traducci?n al franc?s",
137
                getDate(2009, 1, 2), getDate(2009, 12, 21));
138

  
139
        // Asignamos el locator e iniciamos la instancia
140
        uimanager = ScriptingSwingLocator.getUIManager();
141
        final ScriptingManager manager = uimanager.getManager();
142

  
143
        // Ejemplo de mecanismo de registro de paquetes para la Browser del
144
        // Sistema
145
        URL u =
146
            Main.class.getClassLoader().getResource(
147
                "org/gvsig/scripting/impl/scripts/");
148
        File f = new File(u.getPath());
149
        manager.registerSystemFolder("Tests", f);
150

  
151
        uimanager.addUserHelp("es", Main.class.getResource("/"));
152

  
153
        JFrame frame = new JFrame("gvSIG's Script Framework");
154
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
155

  
156
        // Create the menu bar.
157
        JMenuBar menuBar = new JMenuBar();
158

  
159
        // Build the menu.
160
        JMenu menu_file = new JMenu("File");
161
        JMenuItem menuItem_launcher = new JMenuItem("Open Launcher");
162
        menuItem_launcher.addActionListener(new ActionListener() {
163

  
164
            public void actionPerformed(ActionEvent e) {
165
                showLauncher(manager);
166
            }
167
        });
168
        menu_file.add(menuItem_launcher);
169

  
170
        JMenuItem menuItem_composer = new JMenuItem("Open Composer");
171
        menuItem_composer.addActionListener(new ActionListener() {
172

  
173
            public void actionPerformed(ActionEvent e) {
174
                showComposer(manager);
175
            }
176
        });
177
        menu_file.add(menuItem_composer);
178

  
179
        JMenuItem menuItem_installer = new JMenuItem("Open Installer");
180
        menuItem_installer.addActionListener(new ActionListener() {
181

  
182
            public void actionPerformed(ActionEvent e) {
183
                showInstaller(manager);
184
            }
185
        });
186
        menu_file.add(menuItem_installer);
187

  
188
        menu_file.addSeparator();
189

  
190
        JMenuItem menuItem_exit = new JMenuItem("Exit");
191
        menuItem_exit.addActionListener(new ActionListener() {
192

  
193
            public void actionPerformed(ActionEvent e) {
194
                System.exit(0);
195
            }
196
        });
197
        menu_file.add(menuItem_exit);
198

  
199
        menuBar.add(menu_file);
200

  
201
        JToolBar toolBar = new JToolBar();
202

  
203
        JButton launch = new JButton("Launcher");
204
        launch.addActionListener(new ActionListener() {
205

  
206
            public void actionPerformed(ActionEvent arg0) {
207
                showLauncher(manager);
208
            }
209

  
210
        });
211
        JButton comp = new JButton("Composer");
212
        comp.addActionListener(new ActionListener() {
213

  
214
            public void actionPerformed(ActionEvent arg0) {
215
                showComposer(manager);
216
            }
217

  
218
        });
219
        JButton install = new JButton("Installer");
220
        install.addActionListener(new ActionListener() {
221

  
222
            public void actionPerformed(ActionEvent e) {
223
                showInstaller(manager);
224
            }
225
        });
226
        toolBar.add(launch);
227
        toolBar.add(comp);
228
        toolBar.add(install);
229

  
230
        uimanager.setMainFrame(frame);
231
        // frame.setPreferredSize(new Dimension(450, 130));
232
        frame.add(menuBar, BorderLayout.NORTH);
233
        frame.add(toolBar, BorderLayout.LINE_END);
234

  
235
        // Display the window.
236
        frame.pack();
237
        frame.setVisible(true);
238

  
239
    }
240

  
241
    private Date getDate(int year, int month, int day) {
242
        Calendar cal = Calendar.getInstance();
243
        cal.set(year, month, day);
244
        return cal.getTime();
245
    }
246

  
247
    private URL getResource(String name) {
248
        URL resource = this.getClass().getResource(name);
249
        return resource;
250
    }
251

  
252
    private void showLauncher(ScriptingManager manager) {
253
        showWindow(uimanager.createLauncher(), "Scripting Launcher");
254
    }
255

  
256
    private void showComposer(ScriptingManager manager) {
257
        showWindow(uimanager.createComposer(), "Scripting Composer");
258
    }
259

  
260
    private void showInstaller(ScriptingManager manager) {
261

  
262
    }
263

  
264
    private void showWindow(JPanel panel, String title) {
265
        JFrame frame = new JFrame(title);
266
        frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
267

  
268
        frame.setContentPane(panel);
269

  
270
        // Display the window.
271
        frame.pack();
272
        frame.setVisible(true);
273
    }
274
}
tags/v1_0_0_Build_1/org.gvsig.scripting.main/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
4
		 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5

  
6
	<modelVersion>4.0.0</modelVersion>
7
	<artifactId>org.gvsig.scripting.main</artifactId>
8
	<packaging>jar</packaging>
9
	<name>org.gvsig.scripting.main</name>
10
	<parent>
11
		<groupId>org.gvsig</groupId>
12
		<artifactId>org.gvsig.scripting</artifactId>
13
		<version>1.0.0-SNAPSHOT</version>
14
	</parent>
15
	<dependencies>
16
		<dependency>
17
			<groupId>org.gvsig</groupId>
18
			<artifactId>org.gvsig.about.api</artifactId>
19
		</dependency>
20
		<dependency>
21
			<groupId>org.gvsig</groupId>
22
			<artifactId>org.gvsig.about.impl</artifactId>
23
			<scope>runtime</scope>
24
		</dependency>
25
		<dependency>
26
			<groupId>org.gvsig</groupId>
27
			<artifactId>org.gvsig.scripting.lib.api</artifactId>
28
			<version>1.0.0-SNAPSHOT</version>
29
		</dependency>
30
		<dependency>
31
			<groupId>org.gvsig</groupId>
32
			<artifactId>org.gvsig.scripting.lib.impl</artifactId>
33
			<version>1.0.0-SNAPSHOT</version>
34
		</dependency>
35
		<dependency>
36
			<groupId>org.gvsig</groupId>
37
			<artifactId>org.gvsig.scripting.swing.api</artifactId>
38
			<version>1.0.0-SNAPSHOT</version>
39
		</dependency>
40
		<dependency>
41
			<groupId>org.gvsig</groupId>
42
			<artifactId>org.gvsig.scripting.swing.impl</artifactId>
43
			<version>1.0.0-SNAPSHOT</version>
44
		</dependency>
45
		<dependency>
46
			<groupId>com.jgoodies</groupId>
47
			<artifactId>looks</artifactId>
48
		</dependency>
49
	</dependencies>
50
</project>
tags/v1_0_0_Build_1/org.gvsig.scripting.main/README.txt
1
The project structure of this project is the following:
2

  
3
Project
4
|-pom.xml:   		Maven 2 configuration file.
5
`-src
6
  |-main:    		Project source code, resources and configuration
7
  | |-java:  		Java source code
8
  | |-resources:	Resources needed by the code (resource bundles, images, etc.)   
9
  |`-javadoc:		Javadoc common resources	
10
  `-test:    		Unit tests source code, resources and configuration
11
    |-java:  		Unit tests java source code
12
    `-resources:	Resources needed by the test code (resource bundles, images, etc.)   
13

  
14
Look at the main folders for a README.txt file with more information on the 
15
contents of each folder.
0 16

  
tags/v1_0_0_Build_1/prepare-workspace.xml
1
<project name="org.gvsig.initial.build" default="prepare-workspace">
2

  
3
	<dirname property="org.gvsig.initial.build.basedir" file="${ant.file.org.gvsig.initial.build}" />
4

  
5
	<property name="workspace.basedir" value="${org.gvsig.initial.build.basedir}/.." />
6
	<property name="build.basedir" value="${workspace.basedir}/org.gvsig.maven.base.build" description="Eclipse workspace location" />
7
	<property name="build.jar.version" value="1.0.6-SNAPSHOT" />
8
	<property name="build.jar.file" value="org.gvsig.maven.base.build-${build.jar.version}.jar" />
9

  
10
	<property name="ant.libs.dir" location="${build.basedir}" description="Additional ant tasks libs folder" />
11

  
12
	<target name="check-maven-base-build-available">
13
		<available file="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" property="maven-base-build-available" />
14
	</target>
15

  
16
	<target name="get-maven-base-build-local" depends="check-maven-base-build-available" if="maven-base-build-available">
17
		<!-- Unzip de build jar file from the maven repository into the workspace root folder -->
18
		<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
19
			<zipfileset src="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}">
20
				<patternset>
21
					<exclude name="META-INF/**" />
22
				</patternset>
23
			</zipfileset>
24
		</copy>
25
	</target>
26

  
27
	<target name="get-maven-base-build-remote" depends="check-maven-base-build-available" unless="maven-base-build-available">
28
		<!-- Download the build jar file -->
29
		<get src="http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" dest="target/${build.jar.file}" verbose="true" />
30

  
31
		<mkdir dir="target" />
32

  
33
		<!-- Unzip de build jar file into the workspace root folder -->
34
		<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
35
			<zipfileset src="target/${build.jar.file}">
36
				<patternset>
37
					<exclude name="META-INF/**" />
38
				</patternset>
39
			</zipfileset>
40
			<filterset>
41
				<filter token="GVSIG_HOME" value="/home/cordin/projects/gvsig/svn/gvSIG-2.0-build/build/product" />
42
			</filterset>
43
		</copy>
44

  
45
	</target>
46

  
47
	<target name="prepare-workspace" depends="get-maven-base-build-local,get-maven-base-build-remote">
48

  
49
		<mkdir dir="target" />
50

  
51
		<chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug" />
52

  
53
		<!-- Copy the maven launchers to the workspace metadata folder -->
54
		<copy todir="${workspace.basedir}/.metadata">
55
			<fileset dir="${build.basedir}/eclipse-launchers">
56
				<exclude name="**/org.eclipse.jdt.core.prefs" />
57
				<exclude name="**/org.eclipse.core.variables.prefs" />
58
			</fileset>
59
		</copy>
60

  
61
		<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" append="true">
62
			<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.jdt.core.prefs" />
63
		</concat>
64
		<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" append="true">
65
			<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.core.variables.prefs" />
66
		</concat>
67

  
68
		<!-- Configure the eclipse workspace -->
69
		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace" />
70

  
71
		<!-- Configure the gvSIG profile -->
72
		<ant antfile="${build.basedir}/check-gvsig-profile.xml" target="initialize" />
73

  
74
		<property name="user-settings-file-location" value="${user.home}/.m2/settings.xml" />
75

  
76
		<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
77
			<classpath>
78
				<pathelement location="${ant.libs.dir}/com.oopsconsultancy.xmltask-1.16.1.jar" />
79
			</classpath>
80
		</taskdef>
81

  
82
		<xmltask source="${user-settings-file-location}" dest="${user-settings-file-location}">
83
			<copy path="//:settings/:profiles/:profile[:id/text() = 'gvsig-install']/:properties/:gvsig.install.dir/text()" property="current-gvsig-location" />
84
		</xmltask>
85

  
86
		<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
87
		<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
88

  
89
		<!-- Compile, install and generate eclipse projects -->
90
		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse" />
91

  
92
		<echo>INFORMATION!!!</echo>
93
		<echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo>
94

  
95
		<!-- TODO: copiar al proyecto de configuración general -->
96
	</target>
97

  
98
	<target name="clean">
99
		<delete dir="target" />
100
	</target>
101

  
102
</project>
0 103

  
tags/v1_0_0_Build_1/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
4
		 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5

  
6
	<modelVersion>4.0.0</modelVersion>
7
	<groupId>org.gvsig</groupId>
8
	<artifactId>org.gvsig.scripting</artifactId>
9
	<packaging>pom</packaging>
10
	<version>1.0.0-SNAPSHOT</version>
11
	<name>org.gvsig.scripting</name>
12
	<description>Scripting Framework for gvSIG</description>
13
	<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.scripting/${project.version}</url>
14
	<scm>
15
		<connection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-scripting/trunk</connection>
16
		<developerConnection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-scripting/trunk</developerConnection>
17
		<url>https://forge.osor.eu/plugins/scmsvn/viewcvs.php/trunk/org.gvsig.scripting?root=gvsig-scripting</url>
18
	</scm>
19

  
20
	<developers>
21
		<developer>
22
			<id>jjdelcerro</id>
23
			<name>Joaquín José del Cerro</name>
24
			<email>jjdelcerro@gvsig.org</email>
25
			<roles>
26
				<role>Architect</role>
27
				<role>Developer</role>
28
			</roles>
29
		</developer>
30
		<developer>
31
			<id>jbadia</id>
32
			<name>José Badía</name>
33
			<email>badia_jos@gva.es</email>
34
			<roles>
35
				<role>Developer</role>
36
			</roles>
37
		</developer>
38
	</developers>
39
	<parent>
40
		<groupId>org.gvsig</groupId>
41
		<artifactId>org.gvsig.maven.base.pom</artifactId>
42
		<version>1.0.6-SNAPSHOT</version>
43
	</parent>
44

  
45
	<distributionManagement>
46
		<site>
47
			<id>gvsig-repository</id>
48
			<url>scp://shell.forge.osor.eu/home/groups/gvsig-desktop/www/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.scripting/${project.version}</url>
49
		</site>
50
	</distributionManagement>
51
	<repositories>
52
		<repository>
53
			<id>gvsig-public-http-repository</id>
54
			<name>gvSIG maven public HTTP repository</name>
55
			<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository</url>
56
			<releases>
57
				<enabled>true</enabled>
58
				<updatePolicy>daily</updatePolicy>
59
				<checksumPolicy>warn</checksumPolicy>
60
			</releases>
61
			<snapshots>
62
				<enabled>true</enabled>
63
				<updatePolicy>daily</updatePolicy>
64
				<checksumPolicy>warn</checksumPolicy>
65
			</snapshots>
66
		</repository>
67
	</repositories>
68
	<build>
69
		<plugins>
70
			<plugin>
71
				<groupId>org.apache.maven.plugins</groupId>
72
				<artifactId>maven-release-plugin</artifactId>
73
				<configuration>
74
					<tagBase>https://svn.forge.osor.eu/svn/gvsig-scripting/tags</tagBase>
75
				</configuration>
76
			</plugin>
77
		</plugins>
78
	</build>
79

  
80
	<dependencyManagement>
81
		<dependencies>
82
			<dependency>
83
				<groupId>org.gvsig</groupId>
84
				<artifactId>org.gvsig.tools.lib</artifactId>
85
				<version>2.1.0-SNAPSHOT</version>
86
			</dependency>
87
			<dependency>
88
				<groupId>org.gvsig</groupId>
89
				<artifactId>org.gvsig.tools.lib</artifactId>
90
				<version>2.1.0-SNAPSHOT</version>
91
				<type>test-jar</type>
92
				<scope>test</scope>
93
			</dependency>
94
			<dependency>
95
				<groupId>org.gvsig</groupId>
96
				<artifactId>org.gvsig.i18n</artifactId>
97
				<version>2.0-SNAPSHOT</version>
98
			</dependency>
99
			<dependency>
100
				<groupId>org.gvsig</groupId>
101
				<artifactId>org.gvsig.about.api</artifactId>
102
				<version>1.0.0-SNAPSHOT</version>
103
			</dependency>
104
			<dependency>
105
				<groupId>org.gvsig</groupId>
106
				<artifactId>org.gvsig.about.impl</artifactId>
107
				<version>1.0.0-SNAPSHOT</version>
108
			</dependency>
109
		</dependencies>
110
	</dependencyManagement>
111
	<dependencies>
112
		<dependency>
113
			<groupId>org.gvsig</groupId>
114
			<artifactId>org.gvsig.tools.lib</artifactId>
115
		</dependency>
116
		<dependency>
117
			<groupId>org.gvsig</groupId>
118
			<artifactId>org.gvsig.tools.lib</artifactId>
119
			<type>test-jar</type>
120
			<scope>test</scope>
121
		</dependency>
122
		<dependency>
123
			<groupId>org.gvsig</groupId>
124
			<artifactId>org.gvsig.i18n</artifactId>
125
		</dependency>
126
	</dependencies>
127
	<modules>
128
		<module>org.gvsig.scripting.thing</module>
129
		<module>org.gvsig.scripting.lib</module>
130
		<module>org.gvsig.scripting.swing</module>
131
		<module>org.gvsig.scripting.main</module>
132
	</modules>
133
</project>
tags/v1_0_0_Build_1/org.gvsig.scripting.lib/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
4
		 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5

  
6
	<modelVersion>4.0.0</modelVersion>
7
	<artifactId>org.gvsig.scripting.lib</artifactId>
8
	<packaging>pom</packaging>
9
	<name>org.gvsig.scripting.lib</name>
10
	<parent>
11
		<groupId>org.gvsig</groupId>
12
		<artifactId>org.gvsig.scripting</artifactId>
13
		<version>1.0.0-SNAPSHOT</version>
14
	</parent>
15

  
16
	<modules>
17
		<module>org.gvsig.scripting.lib.api</module>
18
		<module>org.gvsig.scripting.lib.impl</module>
19
	</modules>
20
</project>
tags/v1_0_0_Build_1/org.gvsig.scripting.lib/org.gvsig.scripting.lib.impl/src/test/resources/log4j.xml
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<!-- 
5
Log4J configuration file for unit tests execution.
6
 -->
7
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
8

  
9
	<!-- Appender configuration to show logging messages through the console -->
10
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
11
		<layout class="org.apache.log4j.PatternLayout">
12
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
13
		</layout>
14
	</appender>
15

  
16
	<!-- 
17
	Activate logging messages of DEBUG level of higher only for the
18
	DefaultExampleManager class.
19
	You can put full classes names or packages instead, to configure
20
	logging for all the classes and subpackages of the package.
21
	-->
22
	<category name="org.gvsig.scripting.impl.DefaultExampleManager">
23
		<priority value="DEBUG" />
24
	</category>
25

  
26
	<!-- 
27
	By default, show only logging messages of INFO level or higher, 
28
	through the previously configured CONSOLE appender. 
29
	-->
30
	<root>
31
		<priority value="INFO" />
32
		<appender-ref ref="CONSOLE" />
33
	</root>
34
</log4j:configuration>
tags/v1_0_0_Build_1/org.gvsig.scripting.lib/org.gvsig.scripting.lib.impl/src/test/resources/org/gvsig/scripting/impl/scripts/hola.py
1

  
2

  
3
def main():
4
  print 'hola'
5
 
6
def hola(name):
7
  return 'hola %s' % name
8
  
9
def adios():
10
  print 'adios'
tags/v1_0_0_Build_1/org.gvsig.scripting.lib/org.gvsig.scripting.lib.impl/src/test/resources/org/gvsig/scripting/impl/scripts/hola2.dlg
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<!-- generated by ThinG, the Thinlet GUI editor -->
3
<panel>
4
    <button text="hola" action="click"/>
5
</panel>
tags/v1_0_0_Build_1/org.gvsig.scripting.lib/org.gvsig.scripting.lib.impl/src/test/resources/org/gvsig/scripting/impl/scripts/hola2.py
1

  
2

  
3
def click():
4
  print 'click'
5

  
6
def main():
7
  print 'hola'
8
 
9
def hola(name):
10
  return 'hola %s' % name
11
  
12
def adios():
13
  print 'adios'
tags/v1_0_0_Build_1/org.gvsig.scripting.lib/org.gvsig.scripting.lib.impl/src/test/resources/README.txt
1
#set( $symbol_pound = '#' )
2
#set( $symbol_dollar = '$' )
3
#set( $symbol_escape = '\' )
4
Put into this folder the resources needed by your test classes.
5

  
6
This folder is added to the Tests classpath, so you can load any resources 
7
through the ClassLoader.
8

  
9
By default, in this folder you can find an example of log4j configuration,
10
prepared to log messages through the console, so logging works when you
11
run your tests classes.
tags/v1_0_0_Build_1/org.gvsig.scripting.lib/org.gvsig.scripting.lib.impl/src/test/java/org/gvsig/scripting/impl/TestFolderImpl.java
1
package org.gvsig.scripting.impl;
2

  
3
import org.gvsig.scripting.TestFolder;
4

  
5
public class TestFolderImpl extends TestFolder {
6
	
7
}
tags/v1_0_0_Build_1/org.gvsig.scripting.lib/org.gvsig.scripting.lib.impl/src/test/java/org/gvsig/scripting/impl/TestDialogImpl.java
1
package org.gvsig.scripting.impl;
2

  
3
import org.gvsig.scripting.TestDialog;
4

  
5
public class TestDialogImpl extends TestDialog {
6
	
7
}
tags/v1_0_0_Build_1/org.gvsig.scripting.lib/org.gvsig.scripting.lib.impl/src/test/java/org/gvsig/scripting/impl/TestScriptImpl.java
1
package org.gvsig.scripting.impl;
2

  
3
import org.gvsig.scripting.TestScript;
4

  
5
public class TestScriptImpl extends TestScript {
6
//	
7
//	ScriptingDefaultImplLibrary lib;
8
//	ScriptingManager manager;
9
//	
10
//	public void setUp(){
11
//		// Inicializamos las librerías
12
//		lib = new ScriptingDefaultImplLibrary();
13
//		lib.initialize();
14
//
15
//		//  Asignamos el locator e iniciamos la instancia
16
//		manager = ScriptingLocator.getManager();	
17
//	}
18
//	
19
//	
20
//	public void testSimpleDialog(){
21
//		URL folderUrl = TestScript.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts");
22
//		
23
//		DefaultScriptingFolder folder = new DefaultScriptingFolder(manager, folderUrl);
24
//		assertNotNull("No se ha podido obtener \"impl\"",folder);	
25
//		
26
//		DefaultScriptingScript script = new DefaultScriptingDialog(manager);
27
//		script.load(folder,"hola2.py");
28
//		this.checkScript(script, "hola2", "ss TestScript extends TestCase {
29
//
30
//ScriptingDefaultImplLibrary lib;
31
//ScriptingManager manager;
32
//
33
//public void setUp(){
34
//	// Inicializamos las librerías
35
//	lib = new ScriptingDefaultImplLibrary();
36
//	lib.initialize();
37
//
38
//	//  Asignamos el locator e iniciamos la instancia
39
//	manager = ScriptingLocator.getManager();	
40
//}
41
//
42
//
43
//public void testSimpleDialog(){
44
//	URL folderUrl = TestScript.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts");
45
//	
46
//	DefaultScriptingFolder folder = new DefaultScriptingFolder(manager, folderUrl);
47
//	assertNotNull("No se ha podido obtener \"impl\"",folder);	
48
//	
49
//	DefaultScriptingScript script = new DefaultScriptingDialog(manager);
50
//	script.load(folder,"hola2.py");
51
//	this.checkScript(script, "hola2", "hola2", "scripting_dialog", null, null, folder, "main", "python");
52
//	script.run(null);
53
//}	
54
//
55
//public void testSimplePythonScript() throws NoSuchMethodException{
56
//	URL folderUrl = TestScript.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts");
57
//	
58
//	DefaultScriptingFolder folder = new DefaultScriptingFolder(manager, folderUrl);
59
//	assertNotNull("No se ha podido obtener \"impl\"",folder);	
60
//	
61
//	DefaultScriptingScript script = new DefaultScriptingScript(manager);
62
//	assertNotNull("No se ha podido obtener \"hola.py\"",script);	
63
//	
64
//	script.load(folder,"hola.py");
65
//	this.checkScript(script, "hola", "hola", "scripting_python", null, null, folder, "main", "python");
66
//	script.run(null);
67
//	assertEquals("Resultado incorrecto","hola pepe",script.invokeFunction("hola", new Object[]{"pepe"}));
68
//	script.setMainName("adios");
69
//	script.run(null);
70
//}
71
//
72
//public void testSimpleSavePythonScript(){
73
//	URL folderUrl = TestScript.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts");
74
//	
75
//	DefaultScriptingFolder folder = new DefaultScriptingFolder(manager, folderUrl);
76
//	assertNotNull("No se ha podido obtener \"impl\"",folder);	
77
//	
78
//	DefaultScriptingScript script = new DefaultScriptingScript(manager);
79
//	assertNotNull("No se ha podido obtener \"hola.py\"",script);	
80
//	
81
//	script.load(folder,"hola.py");
82
//	this.checkScript(script, "hola", "hola", "scripting_python", null, null, folder, "main", "python");
83
//	script.save();
84
//}
85
//
86
//public void testFolderScript(){
87
//	URL folderUrl = TestScript.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts");
88
//	DefaultScriptingFolder folder = new DefaultScriptingFolder(manager, folderUrl);
89
//	this.checkFolder(folder, "scripts", "scripts", "scripting_folder", "scripting_folder_open", null, null);
90
//}
91
//
92
//public void testUserFolderScript(){
93
//	ScriptingFolder folder = this.manager.getUserFolder();
94
//	this.checkFolder((DefaultScriptingFolder) folder, "Scripts del usuario", "UserFolder", "scripting_userFolder", null, null, null);
95
//}
96
//
97
//private void checkScript(DefaultScriptingScript script, String name, String id, String icon01, String icon02, String description, DefaultScriptingFolder parent, String main, String lang){
98
//	assertEquals("El nombre del script no es correcto",name,script.getName());
99
//	assertEquals("El id del script no es correcto",id,script.getId());
100
//	assertEquals("La descripción del script no es correcta",description,script.getDescription());
101
//	assertEquals("Se esperaban 2 iconos",2, script.getIconNames().length);
102
//	assertEquals("Icono incorrecto",icon01, script.getIconNames()[0]);
103
//	assertEquals("Icono incorrecto",icon02, script.getIconNames()[1]);
104
//	assertEquals("Nombre de Main incorrecto", main, script.getMainName());
105
//	assertEquals("Nombre del Lenguaje incorrecto", lang, script.getLangName());
106
//	if (parent != null){
107
//		assertEquals("Parent incorrecto",parent, script.getParent());
108
//	}
109
//}
110
//
111
//private void checkFolder(DefaultScriptingFolder folder, String name, String id, String icon01, String icon02, String description, DefaultScriptingFolder parent){
112
//	assertNotNull("No se ha podido obtener folder",folder);		
113
//	assertEquals("El nombre de la carpeta no es correcto",name,folder.getName());
114
//	assertEquals("El id de la carpeta no es correcto",id,folder.getId());
115
//	assertEquals("La descripción de la carpeta no es correcta",description,folder.getDescription());
116
//	assertEquals("Se esperaban 2 iconos",2, folder.getIconNames().length);
117
//	assertEquals("Icono incorrecto",icon01, folder.getIconNames()[0]);
118
//	assertEquals("Icono incorrecto",icon02, folder.getIconNames()[1]);
119
//	if (parent != null){
120
//		assertEquals("Parent incorrecto",parent, folder.getParent());
121
//	}
122
//}
123
//
124
//public static void main( String args[] ) {	  
125
//	TestScript test = new TestScript();
126
//	test.setUp();
127
//	URL u = TestScript.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts/hola.inf");
128
//	File f = new File(u.getPath());
129
//	System.out.println(f.getAbsolutePath());
130
//	try {
131
//		f.createNewFile();
132
//	} catch (IOException e1) {
133
//		e1.printStackTrace();
134
//	}
135
//	Ini p = null;
136
//	
137
//	try {
138
//		p = new Ini(f);
139
//	} catch (InvalidFileFormatException e) {
140
//		// TODO Auto-generated catch block
141
//		e.printStackTrace();
142
//	} catch (IOException e) {
143
//		// TODO Auto-generated catch block
144
//		e.printStackTrace();
145
//	}
146
//	p.put("Unit", "Nombre", "pepe");
147
//	try {
148
//		p.store();
149
//	} catch (IOException e) {
150
//		// TODO Auto-generated catch block
151
//		e.printStackTrace();
152
//	}
153
//	
154
//	System.out.println(p.get("Unit","Description"));
155
//	
156
//}
157
//hola2", "scripting_dialog", null, null, folder, "main", "python");
158
//		script.run(null);
159
//	}	
160
//	
161
//	public void testSimplePythonScript() throws NoSuchMethodException{
162
//		URL folderUrl = TestScript.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts");
163
//		
164
//		DefaultScriptingFolder folder = new DefaultScriptingFolder(manager, folderUrl);
165
//		assertNotNull("No se ha podido obtener \"impl\"",folder);	
166
//		
167
//		DefaultScriptingScript script = new DefaultScriptingScript(manager);
168
//		assertNotNull("No se ha podido obtener \"hola.py\"",script);	
169
//		
170
//		script.load(folder,"hola.py");
171
//		this.checkScript(script, "hola", "hola", "scripting_python", null, null, folder, "main", "python");
172
//		script.run(null);
173
//		assertEquals("Resultado incorrecto","hola pepe",script.invokeFunction("hola", new Object[]{"pepe"}));
174
//		script.setMainName("adios");
175
//		script.run(null);
176
//	}
177
//	
178
//	public void testSimpleSavePythonScript(){
179
//		URL folderUrl = TestScript.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts");
180
//		
181
//		DefaultScriptingFolder folder = new DefaultScriptingFolder(manager, folderUrl);
182
//		assertNotNull("No se ha podido obtener \"impl\"",folder);	
183
//		
184
//		DefaultScriptingScript script = new DefaultScriptingScript(manager);
185
//		assertNotNull("No se ha podido obtener \"hola.py\"",script);	
186
//		
187
//		script.load(folder,"hola.py");
188
//		this.checkScript(script, "hola", "hola", "scripting_python", null, null, folder, "main", "python");
189
//		script.save();
190
//	}
191
//	
192
//	public void testFolderScript(){
193
//		URL folderUrl = TestScript.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts");
194
//		DefaultScriptingFolder folder = new DefaultScriptingFolder(manager, folderUrl);
195
//		this.checkFolder(folder, "scripts", "scripts", "scripting_folder", "scripting_folder_open", null, null);
196
//	}
197
//
198
//	public void testUserFolderScript(){
199
//		ScriptingFolder folder = this.manager.getUserFolder();
200
//		this.checkFolder((DefaultScriptingFolder) folder, "Scripts del usuario", "UserFolder", "scripting_userFolder", null, null, null);
201
//	}
202
//	
203
//	private void checkScript(DefaultScriptingScript script, String name, String id, String icon01, String icon02, String description, DefaultScriptingFolder parent, String main, String lang){
204
//		assertEquals("El nombre del script no es correcto",name,script.getName());
205
//		assertEquals("El id del script no es correcto",id,script.getId());
206
//		assertEquals("La descripción del script no es correcta",description,script.getDescription());
207
//		assertEquals("Se esperaban 2 iconos",2, script.getIconNames().length);
208
//		assertEquals("Icono incorrecto",icon01, script.getIconNames()[0]);
209
//		assertEquals("Icono incorrecto",icon02, script.getIconNames()[1]);
210
//		assertEquals("Nombre de Main incorrecto", main, script.getMainName());
211
//		assertEquals("Nombre del Lenguaje incorrecto", lang, script.getLangName());
212
//		if (parent != null){
213
//			assertEquals("Parent incorrecto",parent, script.getParent());
214
//		}
215
//	}
216
//
217
//	private void checkFolder(DefaultScriptingFolder folder, String name, String id, String icon01, String icon02, String description, DefaultScriptingFolder parent){
218
//		assertNotNull("No se ha podido obtener folder",folder);		
219
//		assertEquals("El nombre de la carpeta no es correcto",name,folder.getName());
220
//		assertEquals("El id de la carpeta no es correcto",id,folder.getId());
221
//		assertEquals("La descripción de la carpeta no es correcta",description,folder.getDescription());
222
//		assertEquals("Se esperaban 2 iconos",2, folder.getIconNames().length);
223
//		assertEquals("Icono incorrecto",icon01, folder.getIconNames()[0]);
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff