Revision 1264

View differences:

org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/resources/log4j.xml
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!--
3

  
4
    gvSIG. Desktop Geographic Information System.
5

  
6
    Copyright (C) 2007-2013 gvSIG Association.
7

  
8
    This program is free software; you can redistribute it and/or
9
    modify it under the terms of the GNU General Public License
10
    as published by the Free Software Foundation; either version 2
11
    of the License, or (at your option) any later version.
12

  
13
    This program is distributed in the hope that it will be useful,
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
    GNU General Public License for more details.
17

  
18
    You should have received a copy of the GNU General Public License
19
    along with this program; if not, write to the Free Software
20
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
    MA  02110-1301, USA.
22

  
23
    For any additional information, do not hesitate to contact us
24
    at info AT gvsig.com, or visit our website www.gvsig.com.
25

  
26
-->
27
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
28

  
29
<!-- 
30
Log4J configuration file for unit tests execution.
31
 -->
32
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
33

  
34
	<!-- Appender configuration to show logging messages through the console -->
35
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
36
		<layout class="org.apache.log4j.PatternLayout">
37
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]  %m%n" />
38
		</layout>
39
	</appender>
40

  
41
	<!-- 
42
	Activate logging messages of DEBUG level of higher only for the
43
	org.gvsig.tools packages.
44
	You can put full classes names or packages instead, to configure
45
	logging for all the classes and subpackages of the package.
46
	-->
47
	<category name="org.gvsig.tools">
48
		<priority value="TRACE" />
49
	</category>
50

  
51
	<!-- 
52
	By default, show only logging messages of INFO level or higher, 
53
	through the previously configured CONSOLE appender. 
54
	-->
55
	<root>
56
		<priority value="TRACE" />
57
		<appender-ref ref="CONSOLE" />
58
	</root>
59
</log4j:configuration>
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/resources/org/gvsig/tools/dynobject/attrBasedImportDynClassTest.xml
1
<?xml version="1.0"?>
2
<!--
3

  
4
    gvSIG. Desktop Geographic Information System.
5

  
6
    Copyright (C) 2007-2013 gvSIG Association.
7

  
8
    This program is free software; you can redistribute it and/or
9
    modify it under the terms of the GNU General Public License
10
    as published by the Free Software Foundation; either version 2
11
    of the License, or (at your option) any later version.
12

  
13
    This program is distributed in the hope that it will be useful,
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
    GNU General Public License for more details.
17

  
18
    You should have received a copy of the GNU General Public License
19
    along with this program; if not, write to the Free Software
20
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
    MA  02110-1301, USA.
22

  
23
    For any additional information, do not hesitate to contact us
24
    at info AT gvsig.com, or visit our website www.gvsig.com.
25

  
26
-->
27
<definitions version="1.0.0">
28
  <classes>
29
    <class name="MyObjectBasicTypes">
30
      <description>MyObjectBasicTypes test definition</description>
31
      <fields>
32
        <field	name="a" type="integer" mandatory="true" persistent="true" 
33
        		minValue="0x0" maxValue="100" defaultValue="1"
34
          		group="Numbers" order="12">
35
        </field>
36
        <field	name="b" type="long" mandatory="true" persistent="true" 
37
        		defaultValue="2"
38
          		group="Numbers"/>
39
        <field	name="c" type="double" mandatory="false" persistent="true" 
40
        		defaultValue="1.1" minValue="0.0" maxValue="100.0" 
41
          		group="Numbers"/>
42
        <field	name="d" type="float" mandatory="false" 
43
        		minValue="0.0" maxValue="100.0" 
44
          		group="Numbers">
45
          <persistent>true</persistent>
46
          <defaultValue>1.2</defaultValue>
47
        </field>
48

  
49
        <field	name="e" type="boolean" mandatory="true"> 
50
          <persistent>false</persistent>
51
          <defaultValue>true</defaultValue>
52
          <availableValues>
53
            <value label="True">true</value>
54
            <value label="False">false</value>
55
          </availableValues>
56
        </field>
57

  
58
        <field name="f" type="string" mandatory="true" persistent="true" defaultValue="red">
59
          <availableValues>
60
            <value label="Red">red</value>
61
            <value label="Green">green</value>
62
            <value label="Blue">blue</value>
63
          </availableValues>
64
        </field>
65
        <field name="g" type="date" mandatory="true" persistent="true"/>
66
      </fields>
67
    </class>
68

  
69
    <class name="MyObjectBasicTypes2" namespace="test1">
70
      <extends>
71
        <class name="MyObjectBasicTypes"/>
72
      </extends>
73
      <fields>
74
      </fields>
75
    </class>
76

  
77
    <class name="MyObjectBasicTypes3">
78
      <extends>
79
        <class name="MyObjectBasicTypes2" namespace="test1"/>
80
      </extends>
81
      <fields>
82
      </fields>
83
    </class>
84

  
85
    <class name="MyObjectBasicTypes4">
86
      <extends>
87
        <class name="MyObjectBasicTypes2" namespace="test1"/>
88
      </extends>
89
      <fields>
90
        <field	name="obj" type="Object" classOfValue="org.gvsig.tools.evaluator.Evaluator"/>
91
        <field	name="objs" type="List" classOfItems="org.gvsig.tools.visitor.Visitor"/>
92
      </fields>
93
    </class>
94

  
95
  </classes>
96
</definitions>  
0 97

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/resources/org/gvsig/tools/dynobject/tagBasedImportDynClassTest.xml
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!--
3

  
4
    gvSIG. Desktop Geographic Information System.
5

  
6
    Copyright (C) 2007-2013 gvSIG Association.
7

  
8
    This program is free software; you can redistribute it and/or
9
    modify it under the terms of the GNU General Public License
10
    as published by the Free Software Foundation; either version 2
11
    of the License, or (at your option) any later version.
12

  
13
    This program is distributed in the hope that it will be useful,
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
    GNU General Public License for more details.
17

  
18
    You should have received a copy of the GNU General Public License
19
    along with this program; if not, write to the Free Software
20
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
    MA  02110-1301, USA.
22

  
23
    For any additional information, do not hesitate to contact us
24
    at info AT gvsig.com, or visit our website www.gvsig.com.
25

  
26
-->
27
<definitions>
28
  <version>1.0.0</version>
29
  <classes>
30
    <class>
31
      <name>MyObjectBasicTypes</name>
32
      <description>MyObjectBasicTypes test definition</description>
33
      <fields>
34
        <field>
35
          <name>a</name>
36
          <type>integer</type>
37
          <mandatory>true</mandatory>
38
          <persistent>true</persistent>
39
          <minValue>0</minValue>
40
          <maxValue>100</maxValue>
41
          <defaultValue>1</defaultValue>
42
          <group>Numbers</group>
43
          <order>12</order>
44
        </field>
45
        <field>
46
          <name>b</name>
47
          <type>long</type>
48
          <mandatory>true</mandatory>
49
          <persistent>true</persistent>
50
          <defaultValue>2</defaultValue>
51
          <group>Numbers</group>
52
        </field>
53
        <field>
54
          <name>c</name>
55
          <type>double</type>
56
          <mandatory>false</mandatory>
57
          <persistent>true</persistent>
58
          <minValue>0.0</minValue>
59
          <maxValue>100.0</maxValue>
60
          <defaultValue>1.1</defaultValue>
61
          <group>Numbers</group>
62
        </field>
63
        <field>
64
          <name>d</name>
65
          <type>float</type>
66
          <mandatory>false</mandatory>
67
          <persistent>true</persistent>
68
          <defaultValue>1.2</defaultValue>
69
          <group>Numbers</group>
70
        </field>
71
        <field>
72
          <name>e</name>
73
          <type>boolean</type>
74
          <mandatory>true</mandatory>
75
          <persistent>false</persistent>
76
          <defaultValue>true</defaultValue>
77
          <availableValues>
78
            <valueItem>
79
              <label>True</label>
80
              <value>true</value>
81
            </valueItem>
82
            <valueItem>
83
              <label>False</label>
84
              <value>false</value>
85
            </valueItem>
86
          </availableValues>
87
        </field>
88
        <field>
89
          <name>f</name>
90
          <type>string</type>
91
          <mandatory>true</mandatory>
92
          <persistent>true</persistent>
93
          <defaultValue>red</defaultValue>
94
          <availableValues>
95
            <valueItem>
96
              <label>Red</label>
97
              <value>red</value>
98
            </valueItem>
99
            <valueItem>
100
              <label>Green</label>
101
              <value>green</value>
102
            </valueItem>
103
            <valueItem>
104
              <label>Blue</label>
105
              <value>blue</value>
106
            </valueItem>
107
          </availableValues>
108
        </field>
109
        <field>
110
          <name>g</name>
111
          <type>date</type>
112
          <mandatory>true</mandatory>
113
          <persistent>true</persistent>
114
        </field>
115
      </fields>
116
    </class>
117

  
118

  
119
    <class name="MyObjectBasicTypes2" namespace="test1">
120
      <extends>
121
        <class>MyObjectBasicTypes</class>
122
      </extends>
123
      <fields>
124
      </fields>
125
    </class>
126

  
127
    <class name="MyObjectBasicTypes3">
128
      <extends>
129
        <class namespace="test1">MyObjectBasicTypes2</class> 
130
      </extends>
131
      <fields>
132
      </fields>
133
    </class>
134

  
135
    <class name="MyObjectBasicTypes4">
136
      <extends>
137
        <class name="MyObjectBasicTypes2" namespace="test1"/>
138
      </extends>
139
      <fields>
140
        <field>
141
          <name>obj</name>
142
          <type>Object</type>
143
          <classOfValue>org.gvsig.tools.evaluator.Evaluator</classOfValue>
144
        </field>
145
        <field>
146
          <name>objs</name>
147
          <type>List</type>
148
          <classOfItems>org.gvsig.tools.visitor.Visitor</classOfItems>
149
        </field>
150
      </fields>
151
    </class>
152

  
153

  
154
  </classes>
155
</definitions>
0 156

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/resources/org/gvsig/tools/dynobject/DynClassTemplate.xml
1
<?xml version="1.0"?>
2
<!--
3

  
4
    gvSIG. Desktop Geographic Information System.
5

  
6
    Copyright (C) 2007-2013 gvSIG Association.
7

  
8
    This program is free software; you can redistribute it and/or
9
    modify it under the terms of the GNU General Public License
10
    as published by the Free Software Foundation; either version 2
11
    of the License, or (at your option) any later version.
12

  
13
    This program is distributed in the hope that it will be useful,
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
    GNU General Public License for more details.
17

  
18
    You should have received a copy of the GNU General Public License
19
    along with this program; if not, write to the Free Software
20
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
    MA  02110-1301, USA.
22

  
23
    For any additional information, do not hesitate to contact us
24
    at info AT gvsig.com, or visit our website www.gvsig.com.
25

  
26
-->
27
<definitions>
28
  <version>1.0.0</version>
29
  <classes>
30
    <class>
31
      <name></name>
32
      <namespace></namespace>
33
      <description></description>
34
      <superClassNames>
35
        <superClassName></superClassName>
36
        <superClassName></superClassName>
37
      </superClassNames>
38
      <fields>
39
        <field>
40
          <name></name>
41
          <type></type>
42
          <subtype></subtype>
43
          <description></description>
44
          <isMandatory></isMandatory>
45
          <isPersistent></isPersistent>
46
          <minValue></minValue>
47
          <maxValue></maxValue>
48
          <classOfValue></classOfValue>
49
          <defaultValue></defaultValue>
50
          <group></group>
51
          <availableValues>
52
            <valueItem>
53
              <label></label>
54
              <value></value>
55
            </valueItem>
56
            <valueItem>
57
              <label></label>
58
              <value></value>
59
            </valueItem>
60
          </availableValues>
61
        </field>
62
      </fields>
63
    </class>
64
  </classes>
65
</definitions>  
0 66

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/resources/org/gvsig/tools/persistence/BasicTypes2Test.xml
1
<?xml version="1.0"?>
2
<!--
3

  
4
    gvSIG. Desktop Geographic Information System.
5

  
6
    Copyright (C) 2007-2013 gvSIG Association.
7

  
8
    This program is free software; you can redistribute it and/or
9
    modify it under the terms of the GNU General Public License
10
    as published by the Free Software Foundation; either version 2
11
    of the License, or (at your option) any later version.
12

  
13
    This program is distributed in the hope that it will be useful,
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
    GNU General Public License for more details.
17

  
18
    You should have received a copy of the GNU General Public License
19
    along with this program; if not, write to the Free Software
20
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
    MA  02110-1301, USA.
22

  
23
    For any additional information, do not hesitate to contact us
24
    at info AT gvsig.com, or visit our website www.gvsig.com.
25

  
26
-->
27
<definitions version="1.0.0">
28
  <classes>
29
    <class name="MyObjectBasicTypes">
30
      <description>MyObjectBasicTypes Persistence definition</description>
31
      <fields>
32
        <field name="a" type="integer"/>
33
        <field name="b" type="long"/>
34
        <field name="c" type="double"/>
35
        <field name="d" type="float"/>
36
        <field name="e" type="boolean"/>
37
        <field name="f" type="string"/>
38
        <field name="g" type="date"/>
39
      </fields>
40
    </class>
41
    <class name="Extends1Test">
42
      <description>Test the extends with namespace</description>
43
      <extends>
44
      	<class name="MyObjectBasicTypes"/>
45
      </extends>
46
      <fields>
47
      </fields>
48
    </class>
49
    <class name="MyObjectComplexTypes">
50
      <description>Test the extends with namespace</description>
51
      <extends>
52
      	<class name="MyObjectBasicTypes"/>
53
      </extends>
54
      <fields>
55
      	<field name="child" type="dynObject" subtype="MyObjectBasicTypes"></field>
56
      </fields>
57
    </class>
58
  </classes>
59
</definitions>  
0 60

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/resources/org/gvsig/tools/persistence/DynTypesTest.xml
1
<?xml version= "1.0 "?>
2
<!--
3

  
4
    gvSIG. Desktop Geographic Information System.
5

  
6
    Copyright (C) 2007-2013 gvSIG Association.
7

  
8
    This program is free software; you can redistribute it and/or
9
    modify it under the terms of the GNU General Public License
10
    as published by the Free Software Foundation; either version 2
11
    of the License, or (at your option) any later version.
12

  
13
    This program is distributed in the hope that it will be useful,
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
    GNU General Public License for more details.
17

  
18
    You should have received a copy of the GNU General Public License
19
    along with this program; if not, write to the Free Software
20
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
    MA  02110-1301, USA.
22

  
23
    For any additional information, do not hesitate to contact us
24
    at info AT gvsig.com, or visit our website www.gvsig.com.
25

  
26
-->
27
<definitions version="1.0.0">
28
  <classes>
29
    <class name="MyObjectDynTypes">
30
      <description>MyObjectMapType Persistence definition</description>
31
      <fields>
32
      	<field>
33
          <name>mapa</name>
34
          <type>Map</type>
35
          <mandatory>true</mandatory>
36
          <classOfItems>java.lang.String</classOfItems>
37
        </field>
38
      	<field>
39
          <name>conjunto</name>
40
          <type>Set</type>
41
          <mandatory>true</mandatory>
42
          <classOfItems>java.lang.String</classOfItems>
43
        </field>
44
      	<field>
45
          <name>lista</name>
46
          <type>List</type>
47
          <mandatory>true</mandatory>
48
          <classOfItems>java.lang.String</classOfItems>
49
        </field>
50
      	<field>
51
          <name>viewPort</name>
52
          <type>Object</type>
53
          <mandatory>true</mandatory>
54
          <classOfItems>org.gvsig.tools.persistence.case1.model.ViewPort</classOfItems>
55
        </field>
56
      </fields>
57
    </class>
58
  </classes>
59
</definitions>  
0 60

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/resources/org/gvsig/tools/packageutils/package1.info
1
code=org.gvsig.myplugin
2
name=myplugin
3
description=Test
4
version=1.0.0
5
build=1
6
state=RC1
7
official=true
8
type=plugin
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/resources/README.txt
1
====
2
    gvSIG. Desktop Geographic Information System.
3

  
4
    Copyright (C) 2007-2013 gvSIG Association.
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
    For any additional information, do not hesitate to contact us
22
    at info AT gvsig.com, or visit our website www.gvsig.com.
23
====
24

  
25
#set( $symbol_pound = '#' )
26
#set( $symbol_dollar = '$' )
27
#set( $symbol_escape = '\' )
28
Put into this folder the resources needed by your test classes.
29

  
30
This folder is added to the Tests classpath, so you can load any resources 
31
through the ClassLoader.
32

  
33
By default, in this folder you can find an example of log4j configuration,
34
prepared to log messages through the console, so logging works when you
35
run your tests classes.
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/observer/impl/BaseWeakReferencingObservableTest.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
/*
25
 * AUTHORS (In addition to CIT):
26
 * 2008 {DiSiD Technologies}  {{Task}}
27
 */
28
package org.gvsig.tools.observer.impl;
29

  
30
import java.lang.ref.WeakReference;
31
import java.util.ArrayList;
32
import java.util.List;
33
import java.util.Random;
34

  
35
import junit.framework.TestCase;
36

  
37
import org.easymock.MockControl;
38

  
39
import org.gvsig.tools.observer.Observable;
40
import org.gvsig.tools.observer.Observer;
41

  
42
/**
43
 * Unit tests for the {@link BaseWeakReferencingObservable} class.
44
 *
45
 * @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
46
 */
47
public class BaseWeakReferencingObservableTest extends TestCase {
48

  
49
    private BaseWeakReferencingObservable observable;
50
    private MockControl obsControl;
51
    private Observer observer;
52

  
53
    protected void setUp() throws Exception {
54
        super.setUp();
55
        observable = new BaseWeakReferencingObservable();
56
        obsControl = MockControl.createStrictControl(Observer.class);
57
        observer = (Observer) obsControl.getMock();
58
    }
59

  
60
    protected void tearDown() throws Exception {
61
        super.tearDown();
62
    }
63

  
64
    /**
65
     * Test method for
66
     * {@link org.gvsig.tools.observer.impl.BaseWeakReferencingObservable#enableNotifications()}
67
     * .
68
     */
69
    public void testEnableNotifications() {
70
        observer.update(observable, null);
71
        obsControl.replay();
72

  
73
        observable.addObserver(observer);
74
        observable.enableNotifications();
75
        observable.notifyObservers();
76

  
77
        obsControl.verify();
78
    }
79

  
80
    /**
81
     * Test method for {@link org.gvsig.tools.observer.impl.BaseWeakReferencingObservable#dis}.
82
     */
83
    public void testDisableNotifications() {
84
        // The observer must not be notified
85
        obsControl.replay();
86

  
87
        observable.addObserver(observer);
88
        observable.disableNotifications();
89
        observable.notifyObservers();
90

  
91
        obsControl.verify();
92
    }
93

  
94
    /**
95
     * Test method for
96
     * {@link org.gvsig.tools.observer.impl.BaseWeakReferencingObservable#isEnabledNotifications()}
97
     * .
98
     */
99
    public void testIsEnabledNotifications() {
100
        assertTrue(observable.isEnabledNotifications());
101

  
102
        observable.disableNotifications();
103
        assertFalse(observable.isEnabledNotifications());
104

  
105
        observable.enableNotifications();
106
        assertTrue(observable.isEnabledNotifications());
107
    }
108

  
109
    /**
110
     * Test method for
111
     * {@link org.gvsig.tools.observer.impl.BaseWeakReferencingObservable#addObserver(org.gvsig.tools.observer.Observer)}
112
     * .
113
     */
114
    public void testAddObserverObserver() {
115
        assertEquals(0, observable.countObservers());
116
        observable.addObserver(observer);
117
        assertEquals(1, observable.countObservers());
118
        observable.addObserver(observer);
119
        assertEquals(1, observable.countObservers());
120
    }
121

  
122
    /**
123
     * Test method for
124
     * {@link org.gvsig.tools.observer.impl.BaseWeakReferencingObservable#addObserver(java.lang.ref.Reference)}
125
     * .
126
     */
127
    public void testAddObserverReference() {
128
        assertEquals(0, observable.countObservers());
129
        observable.addObserver(new WeakReference(observer));
130
        assertEquals(1, observable.countObservers());
131
        observable.addObserver(new WeakReference(observer));
132
        assertEquals(1, observable.countObservers());
133
    }
134

  
135
    /**
136
     * Test method for
137
     * {@link org.gvsig.tools.observer.impl.BaseObservable#addObservers(org.gvsig.tools.observer.impl.BaseObservable)}
138
     * .
139
     */
140
    // public void testAddObservers() {
141
    // fail("Not yet implemented");
142
    // }
143
    /**
144
     * Test method for
145
     * {@link org.gvsig.tools.observer.impl.BaseWeakReferencingObservable#deleteObserver(org.gvsig.tools.observer.Observer)}
146
     * .
147
     */
148
    public void testDeleteObserverObserver() {
149
        observable.addObserver(observer);
150
        assertEquals(1, observable.countObservers());
151
        observable.deleteObserver(observer);
152
        assertEquals(0, observable.countObservers());
153
    }
154

  
155
    /**
156
     * Test method for
157
     * {@link org.gvsig.tools.observer.impl.BaseWeakReferencingObservable#deleteObserver(java.lang.ref.Reference)}
158
     * .
159
     */
160
    public void testDeleteObserverReference() {
161
        observable.addObserver(new WeakReference(observer));
162
        assertEquals(1, observable.countObservers());
163
        observable.deleteObserver(new WeakReference(observer));
164
        assertEquals(0, observable.countObservers());
165
    }
166

  
167
	/**
168
	 * Test method for complex notification management. .
169
	 */
170
    public void testComplexNotification() {
171
		TestObserver observer = new TestObserver();
172
		observable.addObserver(observer);
173
    	
174
		assertFalse(observable.inComplex());
175

  
176
        observable.beginComplexNotification();
177
		assertTrue(observable.inComplex());
178
        observable.beginComplexNotification();
179
		assertTrue(observable.inComplex());
180
        observable.beginComplexNotification();
181
		assertTrue(observable.inComplex());
182
        
183
		observable.endComplexNotification();
184
		assertTrue(observable.inComplex());
185
		observable.endComplexNotification();
186
		assertTrue(observable.inComplex());
187
        
188
        observer.setMustBeNotified(true);
189
		observable.endComplexNotification();
190
		assertFalse(observable.inComplex());
191
    }
192

  
193
    public void testComplex() {
194

  
195
        Random rnd = new Random();
196
        rnd.setSeed(System.currentTimeMillis());
197
        int i;
198
        int notifications = rnd.nextInt(10) + 2;
199
        int observers = rnd.nextInt(10) + 3;
200
        ArrayList observerList = new ArrayList(observers);
201
        MyObserver obs;
202
        for (i = 0; i < observers; i++) {
203
            obs = new MyObserver();
204
            obs.addObserverInFirstNotification = rnd.nextBoolean();
205
            observerList.add(obs);
206
            observable.addObserver(obs);
207
        }
208
        observable.beginComplexNotification();
209
        for (i = 0; i < notifications; i++) {
210
            Object obj = new Integer(i);
211
            observable.notifyObservers(obj);
212
        }
213

  
214
        for (i = 0; i < observers; i++) {
215
            obs = (MyObserver) observerList.get(i);
216
            assertEquals(0, obs.notifications.size());
217
            assertNull(obs.observerAdded);
218
        }
219

  
220
        observable.endComplexNotification();
221

  
222
        for (i = 0; i < observers; i++) {
223
            obs = (MyObserver) observerList.get(i);
224
            assertEquals(notifications, obs.notifications.size());
225
            if (obs.addObserverInFirstNotification) {
226
                assertNotNull(obs.observerAdded);
227
                assertEquals(0,
228
                    obs.observerAdded.notifications.size());
229
            }
230
        }
231
    }
232

  
233
    private class MyObserver implements Observer {
234

  
235
        public List notifications = new ArrayList();
236
        public boolean addObserverInFirstNotification = false;
237
        public MyObserver observerAdded = null;
238

  
239
        public void update(Observable observable, Object notification) {
240
            notifications.add(notification);
241
            if (addObserverInFirstNotification && notifications.size() == 1) {
242
                observerAdded = new MyObserver();
243
                observable.addObserver(observerAdded);
244
            }
245
        }
246

  
247
    }
248

  
249
	private class TestObserver implements Observer {
250
		private boolean mustBeNotified = false;
251

  
252
		public boolean isMustBeNotified() {
253
			return mustBeNotified;
254
		}
255

  
256
		public void setMustBeNotified(boolean mustBeNotified) {
257
			this.mustBeNotified = mustBeNotified;
258
		}
259

  
260
		public void update(Observable observable, Object notification) {
261
			if (!isMustBeNotified()) {
262
				fail("Observer notified when it shouldn't");
263
			}
264
		}
265
	}
266

  
267
}
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/servicewithprovider/test/ProviderManagerTest.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.servicewithprovider.test;
25

  
26
import java.util.List;
27

  
28
import junit.framework.TestCase;
29

  
30
import org.gvsig.tools.ToolsLocator;
31
import org.gvsig.tools.dataTypes.impl.DefaultDataTypesManager;
32
import org.gvsig.tools.dynobject.impl.DefaultDynObjectManager;
33
import org.gvsig.tools.service.spi.ProviderManager_WithGetFactories;
34
import org.gvsig.tools.servicewithprovider.MyLocator;
35
import org.gvsig.tools.servicewithprovider.impl.DefaultMyManager;
36
import org.gvsig.tools.servicewithprovider.impl.DefaultMyProviderManager;
37
import org.gvsig.tools.servicewithprovider.myone.myone1.MyOne1ProviderFactory;
38
import org.gvsig.tools.servicewithprovider.myone.myone2.MyOne2ProviderFactory;
39
import org.gvsig.tools.servicewithprovider.spi.MyProviderLocator;
40
import org.gvsig.tools.servicewithprovider.spi.MyProviderManager;
41

  
42
public class ProviderManagerTest extends TestCase {
43

  
44
	protected void setUp() throws Exception {
45
		super.setUp();
46
		ToolsLocator.registerDefaultDataTypesManager(DefaultDataTypesManager.class);
47
		ToolsLocator.registerDynObjectManager(DefaultDynObjectManager.class);
48
		MyProviderLocator.registerManager(DefaultMyProviderManager.class);
49
		MyLocator.registerManager(DefaultMyManager.class);
50
	}
51

  
52
	private void registerProviders() {
53
		MyProviderManager providerManager = MyProviderLocator.getManager();
54
		
55
		providerManager.addProviderFactory(new MyOne1ProviderFactory());
56
		providerManager.addProviderFactory(new MyOne2ProviderFactory());
57
	}
58
	
59
	public void testProviderFactories() {
60
		MyProviderManager providerManager = MyProviderLocator.getManager();
61

  
62
		registerProviders();
63
		
64
		List factories = ((ProviderManager_WithGetFactories)providerManager).getProviderFactories();
65
		assertEquals("Expected 2 ProviderFactories", 2, factories.size());
66
		
67
		assertTrue("Expected an instance of MyOne1ProviderFactory as the first provider factory", factories.get(0) instanceof MyOne1ProviderFactory );
68
		assertTrue("Expected an instance of MyOne1ProviderFactory as the second provider factory", factories.get(1) instanceof MyOne2ProviderFactory );
69
		
70
	}
71
	
72
	public void testProvider() {
73
		MyProviderManager providerManager = MyProviderLocator.getManager();
74
		List factories = ((ProviderManager_WithGetFactories)providerManager).getProviderFactories();
75
		if( factories.size()!=2 ) {
76
			
77
		}
78
	}
79
}
0 80

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/servicewithprovider/MyManager.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.servicewithprovider;
25

  
26
import org.gvsig.tools.service.Manager;
27
import org.gvsig.tools.service.spi.ServiceManager;
28

  
29
public interface MyManager extends ServiceManager, Manager{
30

  
31
}
0 32

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/servicewithprovider/MyTwoService.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.servicewithprovider;
25

  
26
import org.gvsig.tools.service.Service;
27

  
28
public interface MyTwoService extends Service {
29

  
30
}
0 31

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/servicewithprovider/impl/DefaultMyManager.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.servicewithprovider.impl;
25

  
26
import org.gvsig.tools.dynobject.DynObject;
27
import org.gvsig.tools.service.Service;
28
import org.gvsig.tools.service.ServiceException;
29
import org.gvsig.tools.service.spi.AbstractServiceManager;
30
import org.gvsig.tools.servicewithprovider.MyManager;
31

  
32
public class DefaultMyManager extends AbstractServiceManager implements MyManager {
33

  
34
	protected String getRegistryKey() {
35
		// TODO Auto-generated method stub
36
		return null;
37
	}
38

  
39
	protected String getRegistryDescription() {
40
		// TODO Auto-generated method stub
41
		return null;
42
	}
43

  
44
	public Service getService(DynObject parameters) throws ServiceException {
45
		// TODO Auto-generated method stub
46
		return null;
47
	}
48

  
49
}
0 50

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/servicewithprovider/impl/DefaultMyTwoService.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.servicewithprovider.impl;
25

  
26
import org.gvsig.tools.service.AbstractService;
27
import org.gvsig.tools.service.Manager;
28
import org.gvsig.tools.service.spi.ProviderManager;
29

  
30
public class DefaultMyTwoService extends AbstractService {
31

  
32
	public Manager getManager() {
33
		// TODO Auto-generated method stub
34
		return null;
35
	}
36

  
37
	protected ProviderManager getProviderManager() {
38
		// TODO Auto-generated method stub
39
		return null;
40
	}
41

  
42
}
0 43

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/servicewithprovider/impl/DefaultMyProviderServices.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.servicewithprovider.impl;
25

  
26
import org.gvsig.tools.service.spi.AbstractProviderServices;
27
import org.gvsig.tools.servicewithprovider.spi.MyProviderServices;
28

  
29
public class DefaultMyProviderServices extends AbstractProviderServices implements MyProviderServices {
30

  
31
}
0 32

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/servicewithprovider/impl/DefaultMyOneService.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.servicewithprovider.impl;
25

  
26
import org.gvsig.tools.service.AbstractService;
27
import org.gvsig.tools.service.Manager;
28
import org.gvsig.tools.service.spi.ProviderManager;
29
import org.gvsig.tools.servicewithprovider.MyManager;
30
import org.gvsig.tools.servicewithprovider.MyOneService;
31

  
32
/*
33
 * "MyOne" service that use providers.
34
 */
35
public class DefaultMyOneService extends AbstractService implements MyOneService {
36

  
37
	private MyManager manager;
38
	
39
	public DefaultMyOneService(MyManager manager) {
40
		this.manager = manager;
41
	}
42
	
43
	public Manager getManager() {
44
		return this.manager;
45
	}
46

  
47
	protected ProviderManager getProviderManager() {
48
		return null;
49
	}
50

  
51
}
0 52

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/servicewithprovider/impl/DefaultMyLibrary.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.servicewithprovider.impl;
25

  
26
import org.gvsig.tools.library.AbstractLibrary;
27
import org.gvsig.tools.library.LibraryException;
28
import org.gvsig.tools.servicewithprovider.MyLibrary;
29
import org.gvsig.tools.servicewithprovider.MyLocator;
30
import org.gvsig.tools.servicewithprovider.spi.MyProviderLocator;
31

  
32
public class DefaultMyLibrary extends AbstractLibrary {
33

  
34
    public void doRegistration() {
35
        registerAsImplementationOf(MyLibrary.class);
36
    }
37
    
38
    protected void doInitialize() throws LibraryException {
39
        MyLocator.registerManager(DefaultMyManager.class);
40
        MyProviderLocator.registerManager(DefaultMyProviderManager.class);
41
    }
42

  
43
	protected void doPostInitialize() throws LibraryException {
44
		
45
	}
46

  
47
}
0 48

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/servicewithprovider/impl/DefaultMyProviderManager.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.servicewithprovider.impl;
25

  
26
import org.gvsig.tools.service.Service;
27
import org.gvsig.tools.service.spi.AbstractProviderManager;
28
import org.gvsig.tools.service.spi.ProviderServices;
29
import org.gvsig.tools.servicewithprovider.spi.MyProviderManager;
30

  
31
public class DefaultMyProviderManager extends AbstractProviderManager implements MyProviderManager {
32

  
33
	protected String getRegistryKey() {
34
		return "My.providers";
35
	}
36

  
37
	protected String getRegistryDescription() {
38
		return "My providers";
39
	}
40

  
41
	public ProviderServices createProviderServices(Service service) {
42
		// TODO Auto-generated method stub
43
		return null;
44
	}
45

  
46
}
0 47

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/servicewithprovider/myone/myone1/MyOne1Provider.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.servicewithprovider.myone.myone1;
25

  
26
import org.gvsig.tools.dynobject.DynObject;
27
import org.gvsig.tools.service.spi.AbstractProvider;
28
import org.gvsig.tools.service.spi.ProviderServices;
29

  
30
public class MyOne1Provider extends AbstractProvider {
31

  
32
	private DynObject parameters = null;
33
	
34
	public MyOne1Provider(DynObject parameters, ProviderServices providerServices) {
35
		super(providerServices);
36
		this.parameters = parameters;
37
	}
38

  
39
}
0 40

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/servicewithprovider/myone/myone1/MyOne1ProviderLibrary.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.servicewithprovider.myone.myone1;
25

  
26
import org.gvsig.tools.library.AbstractLibrary;
27
import org.gvsig.tools.library.LibraryException;
28
import org.gvsig.tools.servicewithprovider.MyLibrary;
29

  
30
public class MyOne1ProviderLibrary extends AbstractLibrary {
31

  
32
    public void doRegistration() {
33
        registerAsServiceOf(MyLibrary.class);
34
    }
35

  
36
	protected void doInitialize() throws LibraryException {
37
		
38
	}
39

  
40
	protected void doPostInitialize() throws LibraryException {
41
		
42
	}
43

  
44
}
0 45

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.62/org.gvsig.tools.lib/src/test/java/org/gvsig/tools/servicewithprovider/myone/myone1/MyOne1ProviderFactory.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff