Revision 43702
tags/org.gvsig.desktop-2.0.215/org.gvsig.desktop/org.gvsig.desktop.buildtools/src/main/resources/gvsig/checkstyle.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 3 |
|
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 module PUBLIC |
|
28 |
"-//Puppy Crawl//DTD Check Configuration 1.2//EN" |
|
29 |
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> |
|
30 |
|
|
31 |
<!-- |
|
32 |
|
|
33 |
Checkstyle configuration that checks the sun coding conventions from: |
|
34 |
|
|
35 |
- the Java Language Specification at |
|
36 |
http://java.sun.com/docs/books/jls/second_edition/html/index.html |
|
37 |
|
|
38 |
- the Sun Code Conventions at http://java.sun.com/docs/codeconv/ |
|
39 |
|
|
40 |
- the Javadoc guidelines at |
|
41 |
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html |
|
42 |
|
|
43 |
- the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html |
|
44 |
|
|
45 |
- some best practices |
|
46 |
|
|
47 |
Checkstyle is very configurable. Be sure to read the documentation at |
|
48 |
http://checkstyle.sf.net (or in your downloaded distribution). |
|
49 |
|
|
50 |
Most Checks are configurable, be sure to consult the documentation. |
|
51 |
|
|
52 |
To completely disable a check, just comment it out or delete it from the file. |
|
53 |
|
|
54 |
Finally, it is worth reading the documentation. |
|
55 |
|
|
56 |
--> |
|
57 |
|
|
58 |
<module name="Checker"> |
|
59 |
<!-- |
|
60 |
If you set the basedir property below, then all reported file |
|
61 |
names will be relative to the specified directory. See |
|
62 |
http://checkstyle.sourceforge.net/5.x/config.html#Checker |
|
63 |
|
|
64 |
<property name="basedir" value="${basedir}"/> |
|
65 |
--> |
|
66 |
<!-- gvSIG: All project files have the ISO-8859-1 charset --> |
|
67 |
<property name="charset" value="ISO-8859-1" /> |
|
68 |
|
|
69 |
<!-- Checks that a package-info.java file exists for each package. --> |
|
70 |
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage --> |
|
71 |
<module name="JavadocPackage"> |
|
72 |
<property name="allowLegacy" value="true" /> |
|
73 |
</module> |
|
74 |
|
|
75 |
<!-- Checks whether files end with a new line. --> |
|
76 |
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> |
|
77 |
<module name="NewlineAtEndOfFile"/> |
|
78 |
|
|
79 |
<!-- Checks that property files contain the same keys. --> |
|
80 |
<!-- See http://checkstyle.sf.net/config_misc.html#Translation --> |
|
81 |
<module name="Translation"/> |
|
82 |
|
|
83 |
<!-- Checks for Size Violations. --> |
|
84 |
<!-- See http://checkstyle.sf.net/config_sizes.html --> |
|
85 |
<module name="FileLength"/> |
|
86 |
|
|
87 |
<!-- Checks for whitespace --> |
|
88 |
<!-- See http://checkstyle.sf.net/config_whitespace.html --> |
|
89 |
<module name="FileTabCharacter"/> |
|
90 |
|
|
91 |
|
|
92 |
<module name="TreeWalker"> |
|
93 |
|
|
94 |
<!-- Miscellaneous other checks. --> |
|
95 |
<!-- See http://checkstyle.sf.net/config_misc.html --> |
|
96 |
<!-- gvSIG: apply only to java files --> |
|
97 |
<module name="RegexpSinglelineJava"> |
|
98 |
<property name="format" value="\s+$"/> |
|
99 |
<property name="minimum" value="0"/> |
|
100 |
<property name="maximum" value="0"/> |
|
101 |
<property name="message" value="Line has trailing spaces."/> |
|
102 |
<property name="ignoreComments" value="true"/> |
|
103 |
</module> |
|
104 |
|
|
105 |
<!-- Checks for Javadoc comments. --> |
|
106 |
<!-- See http://checkstyle.sf.net/config_javadoc.html --> |
|
107 |
<!-- |
|
108 |
gvSIG rule 3: All protected or public classes must have a Javadoc comments, |
|
109 |
except getters and setters |
|
110 |
--> |
|
111 |
<module name="JavadocMethod"> |
|
112 |
<property name="scope" value="protected" /> |
|
113 |
<property name="allowMissingPropertyJavadoc" value="true" /> |
|
114 |
</module> |
|
115 |
<!-- |
|
116 |
gvSIG rule 9: All classes must have a Javadoc comment |
|
117 |
with the "@author tag" and the "@version $Id$" tag included |
|
118 |
--> |
|
119 |
<module name="JavadocType"> |
|
120 |
<property name="scope" value="private" /> |
|
121 |
<property name="authorFormat" value="\S" /> |
|
122 |
<property name="versionFormat" value="\$Id.*\$"/> |
|
123 |
</module> |
|
124 |
<module name="JavadocVariable"> |
|
125 |
<property name="scope" value="protected" /> |
|
126 |
</module> |
|
127 |
<!-- gvSIG rule 3: Check correctly formatted Javadoc --> |
|
128 |
<module name="JavadocStyle"> |
|
129 |
<property name="scope" value="protected" /> |
|
130 |
</module> |
|
131 |
|
|
132 |
|
|
133 |
<!-- Checks for Naming Conventions. --> |
|
134 |
<!-- See http://checkstyle.sf.net/config_naming.html --> |
|
135 |
<module name="ConstantName"/> |
|
136 |
<module name="LocalFinalVariableName"/> |
|
137 |
<module name="LocalVariableName"/> |
|
138 |
<module name="MemberName"/> |
|
139 |
<module name="MethodName"/> |
|
140 |
<!-- gvSIG rule 15: All packages must begin with org.gvsig. --> |
|
141 |
<module name="PackageName"> |
|
142 |
<property name="format" value="^org\.gvsig(\.[a-z][a-z0-9]*)+$" /> |
|
143 |
</module> |
|
144 |
<!-- gvSIG advised rule 1: Abstract class names must begin with Abstract. --> |
|
145 |
<!-- module name="AbstractClassName" /--> |
|
146 |
<module name="ParameterName"/> |
|
147 |
<module name="StaticVariableName"/> |
|
148 |
<module name="TypeName"/> |
|
149 |
|
|
150 |
<!-- Checks for imports --> |
|
151 |
<!-- See http://checkstyle.sf.net/config_import.html --> |
|
152 |
<module name="AvoidStarImport"/> |
|
153 |
<module name="IllegalImport"/> <!-- defaults to sun.* packages --> |
|
154 |
<module name="RedundantImport"/> |
|
155 |
<module name="UnusedImports"/> |
|
156 |
|
|
157 |
|
|
158 |
<!-- Checks for Size Violations. --> |
|
159 |
<!-- See http://checkstyle.sf.net/config_sizes.html --> |
|
160 |
<module name="LineLength"/> |
|
161 |
<module name="MethodLength"/> |
|
162 |
<module name="ParameterNumber"/> |
|
163 |
|
|
164 |
|
|
165 |
<!-- Checks for whitespace --> |
|
166 |
<!-- See http://checkstyle.sf.net/config_whitespace.html --> |
|
167 |
<module name="EmptyForIteratorPad"/> |
|
168 |
<module name="GenericWhitespace"/> |
|
169 |
<module name="MethodParamPad"/> |
|
170 |
<module name="NoWhitespaceAfter"/> |
|
171 |
<module name="NoWhitespaceBefore"/> |
|
172 |
<module name="OperatorWrap"/> |
|
173 |
<module name="ParenPad"/> |
|
174 |
<module name="TypecastParenPad"/> |
|
175 |
<module name="WhitespaceAfter"/> |
|
176 |
<module name="WhitespaceAround"/> |
|
177 |
|
|
178 |
|
|
179 |
<!-- Modifier Checks --> |
|
180 |
<!-- See http://checkstyle.sf.net/config_modifiers.html --> |
|
181 |
<module name="ModifierOrder"/> |
|
182 |
<module name="RedundantModifier"/> |
|
183 |
|
|
184 |
|
|
185 |
<!-- Checks for blocks. You know, those {}'s --> |
|
186 |
<!-- See http://checkstyle.sf.net/config_blocks.html --> |
|
187 |
<module name="AvoidNestedBlocks"/> |
|
188 |
<module name="EmptyBlock"/> |
|
189 |
<module name="LeftCurly"/> |
|
190 |
<module name="NeedBraces"/> |
|
191 |
<module name="RightCurly"/> |
|
192 |
|
|
193 |
|
|
194 |
<!-- Checks for common coding problems --> |
|
195 |
<!-- See http://checkstyle.sf.net/config_coding.html --> |
|
196 |
<module name="AvoidInlineConditionals"/> |
|
197 |
<module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE --> |
|
198 |
<module name="EmptyStatement"/> |
|
199 |
<module name="EqualsHashCode"/> |
|
200 |
<module name="HiddenField"/> |
|
201 |
<module name="IllegalInstantiation"/> |
|
202 |
<module name="InnerAssignment"/> |
|
203 |
<module name="MagicNumber"/> |
|
204 |
<module name="MissingSwitchDefault"/> |
|
205 |
<module name="RedundantThrows"/> |
|
206 |
<module name="SimplifyBooleanExpression"/> |
|
207 |
<module name="SimplifyBooleanReturn"/> |
|
208 |
|
|
209 |
<!-- gvSIG: Check for some common programming errors --> |
|
210 |
<module name="CovariantEquals" /> |
|
211 |
<module name="StringLiteralEquality" /> |
|
212 |
|
|
213 |
<!-- Checks for class design --> |
|
214 |
<!-- See http://checkstyle.sf.net/config_design.html --> |
|
215 |
<module name="DesignForExtension"/> |
|
216 |
<module name="FinalClass"/> |
|
217 |
<module name="HideUtilityClassConstructor"/> |
|
218 |
<module name="InterfaceIsType"/> |
|
219 |
<module name="VisibilityModifier"/> |
|
220 |
|
|
221 |
|
|
222 |
<!-- Miscellaneous other checks. --> |
|
223 |
<!-- See http://checkstyle.sf.net/config_misc.html --> |
|
224 |
<module name="ArrayTypeStyle"/> |
|
225 |
<!-- gvSIG: removed --> |
|
226 |
<!-- module name="FinalParameters"/--> |
|
227 |
<module name="TodoComment"/> |
|
228 |
<module name="UpperEll"/> |
|
229 |
|
|
230 |
<!-- gvSIG rule 2: Sun style with 4 spaces --> |
|
231 |
<module name="Indentation"> |
|
232 |
<property name="basicOffset" value="4"/> |
|
233 |
<property name="caseIndent" value="0"/> |
|
234 |
</module> |
|
235 |
|
|
236 |
<!-- gvSIG rule 10: Do not use System.out/err to log --> |
|
237 |
<module name="Regexp"> |
|
238 |
<!-- . matches any character, so we need to escape it and use \. |
|
239 |
to match dots.--> |
|
240 |
<property name="format" value="System\.[out|err]\.println"/> |
|
241 |
<property name="illegalPattern" value="true"/> |
|
242 |
</module> |
|
243 |
|
|
244 |
<!-- gvSIG rule 11: Try to avoid catching Throwable or |
|
245 |
Exception and catch specific exceptions instead. --> |
|
246 |
<module name="IllegalCatch"/> |
|
247 |
|
|
248 |
<!-- gvSIG rule 13: Use interfaces in the declaration of |
|
249 |
methods and variables. |
|
250 |
By default only avoids usage of Classes: |
|
251 |
"java.util.GregorianCalendar, java.util.Hashtable, |
|
252 |
java.util.HashSet, java.util.HashMap, java.util.ArrayList, |
|
253 |
java.util.LinkedList, java.util.LinkedHashMap, |
|
254 |
java.util.LinkedHashSet, java.util.TreeSet, |
|
255 |
java.util.TreeMap, java.util.Vector" --> |
|
256 |
<module name="IllegalType"> |
|
257 |
<property name="ignoredMethodNames" value="getInstance"/> |
|
258 |
</module> |
|
259 |
|
|
260 |
</module> |
|
261 |
|
|
262 |
<!-- gvSIG rule 1: check for the gvSIG header --> |
|
263 |
<!-- Uneeded, use the maven-license-plugin instead |
|
264 |
<module name="RegexpHeader"> --> |
|
265 |
<!-- The follow property value demonstrates the ability --> |
|
266 |
<!-- to have access to ANT properties. In this case it uses --> |
|
267 |
<!-- the ${basedir} property to allow Checkstyle to be run --> |
|
268 |
<!-- from any directory within a project. See property --> |
|
269 |
<!-- expansion, --> |
|
270 |
<!-- http://checkstyle.sf.net/config.html#properties --> |
|
271 |
<!-- |
|
272 |
<property name="headerFile" value="${checkstyle.header.file}" /> |
|
273 |
</module> |
|
274 |
--> |
|
275 |
|
|
276 |
</module> |
|
0 | 277 |
tags/org.gvsig.desktop-2.0.215/org.gvsig.desktop/org.gvsig.desktop.buildtools/src/main/resources/header.txt | ||
---|---|---|
1 |
gvSIG. Desktop Geographic Information System. |
|
2 |
|
|
3 |
Copyright (C) 2007-2013 gvSIG Association. |
|
4 |
|
|
5 |
This program is free software; you can redistribute it and/or |
|
6 |
modify it under the terms of the GNU General Public License |
|
7 |
as published by the Free Software Foundation; either version 3 |
|
8 |
of the License, or (at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU General Public License |
|
16 |
along with this program; if not, write to the Free Software |
|
17 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
MA 02110-1301, USA. |
|
19 |
|
|
20 |
For any additional information, do not hesitate to contact us |
|
21 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
0 | 22 |
tags/org.gvsig.desktop-2.0.215/org.gvsig.desktop/org.gvsig.desktop.buildtools/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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.desktop.buildtools</artifactId> |
|
6 |
<version>1.0.0</version> |
|
7 |
<packaging>jar</packaging> |
|
8 |
<name>${project.artifactId}</name> |
|
9 |
<description>Resources used for build gvsig desktop</description> |
|
10 |
|
|
11 |
|
|
12 |
<!-- No puede ser hijo de org.gvsig.desktop para evitar referencas circulares --> |
|
13 |
<!-- |
|
14 |
<parent> |
|
15 |
<groupId>org.gvsig</groupId> |
|
16 |
<artifactId>org.gvsig.desktop</artifactId> |
|
17 |
<version>2.0.10-SNAPSHOT</version> |
|
18 |
</parent> |
|
19 |
--> |
|
20 |
|
|
21 |
|
|
22 |
<licenses> |
|
23 |
<license> |
|
24 |
<name>GPLv3</name> |
|
25 |
<url>http://www.gnu.org/licenses/gpl.html</url> |
|
26 |
<distribution>repo</distribution> |
|
27 |
<comments> |
|
28 |
"GPL" stands for "General Public License". The most widespread such |
|
29 |
license is the GNU General Public License, or GNU GPL for short. |
|
30 |
This can be further shortened to "GPL", when it is understood that |
|
31 |
the GNU GPL is the one intended. |
|
32 |
</comments> |
|
33 |
</license> |
|
34 |
</licenses> |
|
35 |
|
|
36 |
<organization> |
|
37 |
<name>gvSIG Association</name> |
|
38 |
<url>http://www.gvsig.com/</url> |
|
39 |
</organization> |
|
40 |
|
|
41 |
<scm> |
|
42 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/trunk</connection> |
|
43 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/trunk</developerConnection> |
|
44 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-desktop/repository/show/trunk</url> |
|
45 |
</scm> |
|
46 |
|
|
47 |
<repositories> |
|
48 |
<repository> |
|
49 |
<id>gvsig-public-http-repository</id> |
|
50 |
<name>gvSIG maven public HTTP repository</name> |
|
51 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
52 |
<releases> |
|
53 |
<enabled>true</enabled> |
|
54 |
<updatePolicy>daily</updatePolicy> |
|
55 |
<checksumPolicy>warn</checksumPolicy> |
|
56 |
</releases> |
|
57 |
<snapshots> |
|
58 |
<enabled>true</enabled> |
|
59 |
<updatePolicy>daily</updatePolicy> |
|
60 |
<checksumPolicy>warn</checksumPolicy> |
|
61 |
</snapshots> |
|
62 |
</repository> |
|
63 |
</repositories> |
|
64 |
|
|
65 |
<distributionManagement> |
|
66 |
<site> |
|
67 |
<id>gvsig-repository</id> |
|
68 |
<url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url> |
|
69 |
</site> |
|
70 |
<repository> |
|
71 |
<id>gvsig-repository</id> |
|
72 |
<name>gvSIG maven repository</name> |
|
73 |
<url>dav:https://devel.gvsig.org/m2repo/j2se</url> |
|
74 |
<uniqueVersion>false</uniqueVersion> |
|
75 |
</repository> |
|
76 |
<snapshotRepository> |
|
77 |
<id>gvsig-repository</id> |
|
78 |
<name>gvSIG maven repository</name> |
|
79 |
<url>dav:https://devel.gvsig.org/m2repo/j2se</url> |
|
80 |
<uniqueVersion>false</uniqueVersion> |
|
81 |
</snapshotRepository> |
|
82 |
</distributionManagement> |
|
83 |
|
|
84 |
<issueManagement> |
|
85 |
<system>redmine</system> |
|
86 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-desktop</url> |
|
87 |
</issueManagement> |
|
88 |
|
|
89 |
<mailingLists> |
|
90 |
<mailingList> |
|
91 |
<name>User List</name> |
|
92 |
<subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios</subscribe> |
|
93 |
<unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios</unsubscribe> |
|
94 |
<post>gvsig_usuarios@listserv.gva.es</post> |
|
95 |
<archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive> |
|
96 |
<otherArchives> |
|
97 |
<otherArchive>http://www.mail-archive.com/gvsig_usuarios@runas.cap.gva.es</otherArchive> |
|
98 |
<otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive> |
|
99 |
</otherArchives> |
|
100 |
</mailingList> |
|
101 |
<mailingList> |
|
102 |
<name>Developer List</name> |
|
103 |
<subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores</subscribe> |
|
104 |
<unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores</unsubscribe> |
|
105 |
<post>gvsig_desarrolladores@listserv.gva.es</post> |
|
106 |
<archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive> |
|
107 |
<otherArchives> |
|
108 |
<otherArchive>http://www.mail-archive.com/gvsig_desarrolladores@runas.cap.gva.es</otherArchive> |
|
109 |
<otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive> |
|
110 |
</otherArchives> |
|
111 |
</mailingList> |
|
112 |
<mailingList> |
|
113 |
<name>International List</name> |
|
114 |
<subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</subscribe> |
|
115 |
<unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</unsubscribe> |
|
116 |
<post>gvsig_internacional@listserv.gva.es</post> |
|
117 |
<archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive> |
|
118 |
<otherArchives> |
|
119 |
<otherArchive>http://www.mail-archive.com/gvsig_internacional@runas.cap.gva.es</otherArchive> |
|
120 |
<otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive> |
|
121 |
</otherArchives> |
|
122 |
</mailingList> |
|
123 |
</mailingLists> |
|
124 |
|
|
125 |
<build> |
|
126 |
<extensions> |
|
127 |
<extension> |
|
128 |
<groupId>org.apache.maven.wagon</groupId> |
|
129 |
<artifactId>wagon-webdav-jackrabbit</artifactId> |
|
130 |
<version>1.0-beta-7</version> |
|
131 |
</extension> |
|
132 |
</extensions> |
|
133 |
</build> |
|
134 |
|
|
135 |
</project> |
|
0 | 136 |
tags/org.gvsig.desktop-2.0.215/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.utils/src/test/java/org/gvsig/utils/stringNumberUtilities/TestStringNumberUtilities.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 3 |
|
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.utils.stringNumberUtilities; |
|
25 |
|
|
26 |
import org.gvsig.utils.stringNumberUtilities.StringNumberUtilities; |
|
27 |
|
|
28 |
import junit.framework.TestCase; |
|
29 |
|
|
30 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
31 |
* |
|
32 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
33 |
* |
|
34 |
* This program is free software; you can redistribute it and/or |
|
35 |
* modify it under the terms of the GNU General Public License |
|
36 |
* as published by the Free Software Foundation; either version 2 |
|
37 |
* of the License, or (at your option) any later version. |
|
38 |
* |
|
39 |
* This program is distributed in the hope that it will be useful, |
|
40 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
41 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
42 |
* GNU General Public License for more details. |
|
43 |
* |
|
44 |
* You should have received a copy of the GNU General Public License |
|
45 |
* along with this program; if not, write to the Free Software |
|
46 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
47 |
* |
|
48 |
* For more information, contact: |
|
49 |
* |
|
50 |
* Generalitat Valenciana |
|
51 |
* Conselleria d'Infraestructures i Transport |
|
52 |
* Av. Blasco Ib??ez, 50 |
|
53 |
* 46010 VALENCIA |
|
54 |
* SPAIN |
|
55 |
* |
|
56 |
* +34 963862235 |
|
57 |
* gvsig@gva.es |
|
58 |
* www.gvsig.gva.es |
|
59 |
* |
|
60 |
* or |
|
61 |
* |
|
62 |
* IVER T.I. S.A |
|
63 |
* Salamanca 50 |
|
64 |
* 46005 Valencia |
|
65 |
* Spain |
|
66 |
* |
|
67 |
* +34 963163400 |
|
68 |
* dac@iver.es |
|
69 |
*/ |
|
70 |
|
|
71 |
/** |
|
72 |
* Tests the methods of the class StringNumberUtilities |
|
73 |
* |
|
74 |
* @author Pablo Piqueras Bartolom? (p_queras@hotmail.com) |
|
75 |
*/ |
|
76 |
public class TestStringNumberUtilities extends TestCase{ |
|
77 |
private String word; |
|
78 |
|
|
79 |
/* |
|
80 |
* (non-Javadoc) |
|
81 |
* @see junit.framework.TestCase#setUp() |
|
82 |
*/ |
|
83 |
protected void setUp() throws Exception { |
|
84 |
super.setUp(); |
|
85 |
word = new String(); |
|
86 |
} |
|
87 |
|
|
88 |
/* |
|
89 |
* (non-Javadoc) |
|
90 |
* @see junit.framework.TestCase#tearDown() |
|
91 |
*/ |
|
92 |
protected void tearDown() throws Exception { |
|
93 |
super.tearDown(); |
|
94 |
} |
|
95 |
|
|
96 |
/** |
|
97 |
* A test |
|
98 |
*/ |
|
99 |
public void test1() { |
|
100 |
word = "2.3"; |
|
101 |
ShowText.showIsNumberText(word); |
|
102 |
|
|
103 |
if (StringNumberUtilities.isNumber(word)) { |
|
104 |
ShowText.showYes(); |
|
105 |
} |
|
106 |
else { |
|
107 |
ShowText.showNo(); |
|
108 |
fail(); |
|
109 |
} |
|
110 |
} |
|
111 |
|
|
112 |
/** |
|
113 |
* A test |
|
114 |
*/ |
|
115 |
public void test2() { |
|
116 |
word = "a as wz rwa"; |
|
117 |
ShowText.showIsNumberText(word); |
|
118 |
|
|
119 |
if (StringNumberUtilities.isNumber(word)) { |
|
120 |
ShowText.showYes(); |
|
121 |
} |
|
122 |
else { |
|
123 |
ShowText.showNo(); |
|
124 |
fail(); |
|
125 |
} |
|
126 |
} |
|
127 |
|
|
128 |
/** |
|
129 |
* A test |
|
130 |
*/ |
|
131 |
public void test3() { |
|
132 |
word = "2"; |
|
133 |
ShowText.showIsNumberText(word); |
|
134 |
|
|
135 |
if (StringNumberUtilities.isNumber(word)) { |
|
136 |
ShowText.showYes(); |
|
137 |
} |
|
138 |
else { |
|
139 |
ShowText.showNo(); |
|
140 |
fail(); |
|
141 |
} |
|
142 |
} |
|
143 |
|
|
144 |
/** |
|
145 |
* A test |
|
146 |
*/ |
|
147 |
public void test4() { |
|
148 |
word = ""; |
|
149 |
ShowText.showIsNumberText(word); |
|
150 |
|
|
151 |
if (StringNumberUtilities.isNumber(word)) { |
|
152 |
ShowText.showYes(); |
|
153 |
} |
|
154 |
else { |
|
155 |
ShowText.showNo(); |
|
156 |
fail(); |
|
157 |
} |
|
158 |
} |
|
159 |
|
|
160 |
/** |
|
161 |
* A test |
|
162 |
*/ |
|
163 |
public void test5() { |
|
164 |
word = "-2.3"; |
|
165 |
ShowText.showIsNumberText(word); |
|
166 |
|
|
167 |
if (StringNumberUtilities.isNumber(word)) { |
|
168 |
ShowText.showYes(); |
|
169 |
} |
|
170 |
else { |
|
171 |
ShowText.showNo(); |
|
172 |
fail(); |
|
173 |
} |
|
174 |
} |
|
175 |
|
|
176 |
/** |
|
177 |
* A test |
|
178 |
*/ |
|
179 |
public void test6() { |
|
180 |
word = "-300"; |
|
181 |
ShowText.showIsNumberText(word); |
|
182 |
|
|
183 |
if (StringNumberUtilities.isNumber(word)) { |
|
184 |
ShowText.showYes(); |
|
185 |
} |
|
186 |
else { |
|
187 |
ShowText.showNo(); |
|
188 |
fail(); |
|
189 |
} |
|
190 |
} |
|
191 |
|
|
192 |
/** |
|
193 |
* A test |
|
194 |
*/ |
|
195 |
public void test7() { |
|
196 |
word = "2.3"; |
|
197 |
ShowText.showIsNaturalText(word); |
|
198 |
|
|
199 |
if (StringNumberUtilities.isNaturalNumber(word)) { |
|
200 |
ShowText.showYes(); |
|
201 |
} |
|
202 |
else { |
|
203 |
ShowText.showNo(); |
|
204 |
fail(); |
|
205 |
} |
|
206 |
} |
|
207 |
|
|
208 |
/** |
|
209 |
* A test |
|
210 |
*/ |
|
211 |
public void test8() { |
|
212 |
word = "334"; |
|
213 |
ShowText.showIsNaturalText(word); |
|
214 |
|
|
215 |
if (StringNumberUtilities.isNaturalNumber(word)) { |
|
216 |
ShowText.showYes(); |
|
217 |
} |
|
218 |
else { |
|
219 |
ShowText.showNo(); |
|
220 |
fail(); |
|
221 |
} |
|
222 |
} |
|
223 |
|
|
224 |
/** |
|
225 |
* A test |
|
226 |
*/ |
|
227 |
public void test9() { |
|
228 |
word = "-2a3"; |
|
229 |
ShowText.showIsIntegerText(word); |
|
230 |
|
|
231 |
if (StringNumberUtilities.isIntegerNumber(word)) { |
|
232 |
ShowText.showYes(); |
|
233 |
} |
|
234 |
else { |
|
235 |
ShowText.showNo(); |
|
236 |
fail(); |
|
237 |
} |
|
238 |
} |
|
239 |
|
|
240 |
/** |
|
241 |
* A test |
|
242 |
*/ |
|
243 |
public void test10() { |
|
244 |
word = "-23"; |
|
245 |
ShowText.showIsIntegerText(word); |
|
246 |
|
|
247 |
if (StringNumberUtilities.isIntegerNumber(word)) { |
|
248 |
ShowText.showYes(); |
|
249 |
} |
|
250 |
else { |
|
251 |
ShowText.showNo(); |
|
252 |
fail(); |
|
253 |
} |
|
254 |
} |
|
255 |
|
|
256 |
/** |
|
257 |
* A test |
|
258 |
*/ |
|
259 |
public void test11() { |
|
260 |
word = "7"; |
|
261 |
ShowText.showIsIntegerText(word); |
|
262 |
|
|
263 |
if (StringNumberUtilities.isIntegerNumber(word)) { |
|
264 |
ShowText.showYes(); |
|
265 |
} |
|
266 |
else { |
|
267 |
ShowText.showNo(); |
|
268 |
fail(); |
|
269 |
} |
|
270 |
} |
|
271 |
|
|
272 |
/** |
|
273 |
* A test |
|
274 |
*/ |
|
275 |
public void test12() { |
|
276 |
word = "2.3"; |
|
277 |
ShowText.showIsIntegerText(word); |
|
278 |
|
|
279 |
if (StringNumberUtilities.isIntegerNumber(word)) { |
|
280 |
ShowText.showYes(); |
|
281 |
} |
|
282 |
else { |
|
283 |
ShowText.showNo(); |
|
284 |
fail(); |
|
285 |
} |
|
286 |
} |
|
287 |
|
|
288 |
/** |
|
289 |
* A test |
|
290 |
*/ |
|
291 |
public void test13() { |
|
292 |
word = "2.3"; |
|
293 |
ShowText.showIsRealText(word); |
|
294 |
|
|
295 |
if (StringNumberUtilities.isRealNumber(word)) { |
|
296 |
ShowText.showYes(); |
|
297 |
} |
|
298 |
else { |
|
299 |
ShowText.showNo(); |
|
300 |
fail(); |
|
301 |
} |
|
302 |
} |
|
303 |
|
|
304 |
/** |
|
305 |
* A test |
|
306 |
*/ |
|
307 |
public void test14() { |
|
308 |
word = "37"; |
|
309 |
ShowText.showIsRealText(word); |
|
310 |
|
|
311 |
if (StringNumberUtilities.isRealNumber(word)) { |
|
312 |
ShowText.showYes(); |
|
313 |
} |
|
314 |
else { |
|
315 |
ShowText.showNo(); |
|
316 |
fail(); |
|
317 |
} |
|
318 |
} |
|
319 |
|
|
320 |
/** |
|
321 |
* A test |
|
322 |
*/ |
|
323 |
public void test15() { |
|
324 |
word = "-4.6"; |
|
325 |
ShowText.showIsRealText(word); |
|
326 |
|
|
327 |
if (StringNumberUtilities.isRealNumber(word)) { |
|
328 |
ShowText.showYes(); |
|
329 |
} |
|
330 |
else { |
|
331 |
ShowText.showNo(); |
|
332 |
fail(); |
|
333 |
} |
|
334 |
} |
|
335 |
|
|
336 |
/** |
|
337 |
* A test |
|
338 |
*/ |
|
339 |
public void test16() { |
|
340 |
word = "-8000"; |
|
341 |
ShowText.showIsRealText(word); |
|
342 |
|
|
343 |
if (StringNumberUtilities.isRealNumber(word)) { |
|
344 |
ShowText.showYes(); |
|
345 |
} |
|
346 |
else { |
|
347 |
ShowText.showNo(); |
|
348 |
fail(); |
|
349 |
} |
|
350 |
} |
|
351 |
|
|
352 |
/** |
|
353 |
* A test |
|
354 |
*/ |
|
355 |
public void test17() { |
|
356 |
word = "-80k00"; |
|
357 |
ShowText.showIsRealText(word); |
|
358 |
|
|
359 |
if (StringNumberUtilities.isRealNumber(word)) { |
|
360 |
ShowText.showYes(); |
|
361 |
} |
|
362 |
else { |
|
363 |
ShowText.showNo(); |
|
364 |
fail(); |
|
365 |
} |
|
366 |
} |
|
367 |
|
|
368 |
/** |
|
369 |
* A test |
|
370 |
*/ |
|
371 |
public void test18() { |
|
372 |
word = ".6"; |
|
373 |
ShowText.showIsRealText(word); |
|
374 |
|
|
375 |
if (StringNumberUtilities.isRealNumber(word)) { |
|
376 |
ShowText.showYes(); |
|
377 |
} |
|
378 |
else { |
|
379 |
ShowText.showNo(); |
|
380 |
fail(); |
|
381 |
} |
|
382 |
} |
|
383 |
|
|
384 |
/** |
|
385 |
* A test |
|
386 |
*/ |
|
387 |
public void test19() { |
|
388 |
word = "-.6"; |
|
389 |
ShowText.showIsRealText(word); |
|
390 |
|
|
391 |
if (StringNumberUtilities.isRealNumber(word)) { |
|
392 |
ShowText.showYes(); |
|
393 |
} |
|
394 |
else { |
|
395 |
ShowText.showNo(); |
|
396 |
fail(); |
|
397 |
} |
|
398 |
} |
|
399 |
|
|
400 |
/** |
|
401 |
* A test |
|
402 |
*/ |
|
403 |
public void test20() { |
|
404 |
word = "b-.6"; |
|
405 |
ShowText.showIsRealText(word); |
|
406 |
|
|
407 |
if (StringNumberUtilities.isRealNumber(word)) { |
|
408 |
ShowText.showYes(); |
|
409 |
} |
|
410 |
else { |
|
411 |
ShowText.showNo(); |
|
412 |
fail(); |
|
413 |
} |
|
414 |
} |
|
415 |
|
|
416 |
|
|
417 |
/** |
|
418 |
* A test |
|
419 |
*/ |
|
420 |
public void test21() { |
|
421 |
word = "-c.6"; |
|
422 |
ShowText.showIsRealText(word); |
|
423 |
|
|
424 |
if (StringNumberUtilities.isRealNumber(word)) { |
|
425 |
ShowText.showYes(); |
|
426 |
} |
|
427 |
else { |
|
428 |
ShowText.showNo(); |
|
429 |
fail(); |
|
430 |
} |
|
431 |
} |
|
432 |
|
|
433 |
|
|
434 |
/** |
|
435 |
* A test |
|
436 |
*/ |
|
437 |
public void test22() { |
|
438 |
word = "-.d6"; |
|
439 |
ShowText.showIsRealText(word); |
|
440 |
|
|
441 |
if (StringNumberUtilities.isRealNumber(word)) { |
|
442 |
ShowText.showYes(); |
|
443 |
} |
|
444 |
else { |
|
445 |
ShowText.showNo(); |
|
446 |
fail(); |
|
447 |
} |
|
448 |
} |
|
449 |
|
|
450 |
/** |
|
451 |
* A test |
|
452 |
*/ |
|
453 |
public void test23() { |
|
454 |
word = "-.6e"; |
|
455 |
ShowText.showIsRealText(word); |
|
456 |
|
|
457 |
if (StringNumberUtilities.isRealNumber(word)) { |
|
458 |
ShowText.showYes(); |
|
459 |
} |
|
460 |
else { |
|
461 |
ShowText.showNo(); |
|
462 |
fail(); |
|
463 |
} |
|
464 |
} |
|
465 |
|
|
466 |
/** |
|
467 |
* A test |
|
468 |
*/ |
|
469 |
public void test24() { |
|
470 |
word = "+.6"; |
|
471 |
ShowText.showIsRealText(word); |
|
472 |
|
|
473 |
if (StringNumberUtilities.isRealNumber(word)) { |
|
474 |
ShowText.showYes(); |
|
475 |
} |
|
476 |
else { |
|
477 |
ShowText.showNo(); |
|
478 |
fail(); |
|
479 |
} |
|
480 |
} |
|
481 |
|
|
482 |
/** |
|
483 |
* A test |
|
484 |
*/ |
|
485 |
public void test25() { |
|
486 |
word = "+.6"; |
|
487 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
488 |
|
|
489 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
490 |
ShowText.showYes(); |
|
491 |
} |
|
492 |
else { |
|
493 |
ShowText.showNo(); |
|
494 |
fail(); |
|
495 |
} |
|
496 |
} |
|
497 |
|
|
498 |
|
|
499 |
/** |
|
500 |
* A test |
|
501 |
*/ |
|
502 |
public void test26() { |
|
503 |
word = ".6"; |
|
504 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
505 |
|
|
506 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
507 |
ShowText.showYes(); |
|
508 |
} |
|
509 |
else { |
|
510 |
ShowText.showNo(); |
|
511 |
fail(); |
|
512 |
} |
|
513 |
} |
|
514 |
|
|
515 |
|
|
516 |
/** |
|
517 |
* A test |
|
518 |
*/ |
|
519 |
public void test27() { |
|
520 |
word = "-.6"; |
|
521 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
522 |
|
|
523 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
524 |
ShowText.showYes(); |
|
525 |
} |
|
526 |
else { |
|
527 |
ShowText.showNo(); |
|
528 |
fail(); |
|
529 |
} |
|
530 |
} |
|
531 |
|
|
532 |
|
|
533 |
/** |
|
534 |
* A test |
|
535 |
*/ |
|
536 |
public void test28() { |
|
537 |
word = "+6"; |
|
538 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
539 |
|
|
540 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
541 |
ShowText.showYes(); |
|
542 |
} |
|
543 |
else { |
|
544 |
ShowText.showNo(); |
|
545 |
fail(); |
|
546 |
} |
|
547 |
} |
|
548 |
|
|
549 |
|
|
550 |
/** |
|
551 |
* A test |
|
552 |
*/ |
|
553 |
public void test29() { |
|
554 |
word = "-6"; |
|
555 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
556 |
|
|
557 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
558 |
ShowText.showYes(); |
|
559 |
} |
|
560 |
else { |
|
561 |
ShowText.showNo(); |
|
562 |
fail(); |
|
563 |
} |
|
564 |
} |
|
565 |
|
|
566 |
|
|
567 |
/** |
|
568 |
* A test |
|
569 |
*/ |
|
570 |
public void test30() { |
|
571 |
word = "6"; |
|
572 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
573 |
|
|
574 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
575 |
ShowText.showYes(); |
|
576 |
} |
|
577 |
else { |
|
578 |
ShowText.showNo(); |
|
579 |
fail(); |
|
580 |
} |
|
581 |
} |
|
582 |
|
|
583 |
/** |
|
584 |
* A test |
|
585 |
*/ |
|
586 |
public void test31() { |
|
587 |
word = "136.13"; |
|
588 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
589 |
|
|
590 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
591 |
ShowText.showYes(); |
|
592 |
} |
|
593 |
else { |
|
594 |
ShowText.showNo(); |
|
595 |
fail(); |
|
596 |
} |
|
597 |
} |
|
598 |
|
|
599 |
|
|
600 |
/** |
|
601 |
* A test |
|
602 |
*/ |
|
603 |
public void test32() { |
|
604 |
word = "+13.42"; |
|
605 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
606 |
|
|
607 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
608 |
ShowText.showYes(); |
|
609 |
} |
|
610 |
else { |
|
611 |
ShowText.showNo(); |
|
612 |
fail(); |
|
613 |
} |
|
614 |
} |
|
615 |
|
|
616 |
/** |
|
617 |
* A test |
|
618 |
*/ |
|
619 |
public void test33() { |
|
620 |
word = "-246.24"; |
|
621 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
622 |
|
|
623 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
624 |
ShowText.showYes(); |
|
625 |
} |
|
626 |
else { |
|
627 |
ShowText.showNo(); |
|
628 |
fail(); |
|
629 |
} |
|
630 |
} |
|
631 |
|
|
632 |
/** |
|
633 |
* A test |
|
634 |
*/ |
|
635 |
public void test34() { |
|
636 |
word = "146.134E+13"; |
|
637 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
638 |
|
|
639 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
640 |
ShowText.showYes(); |
|
641 |
} |
|
642 |
else { |
|
643 |
ShowText.showNo(); |
|
644 |
fail(); |
|
645 |
} |
|
646 |
} |
|
647 |
|
|
648 |
/** |
|
649 |
* A test |
|
650 |
*/ |
|
651 |
public void test35() { |
|
652 |
word = "614.425E-67"; |
|
653 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
654 |
|
|
655 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
656 |
ShowText.showYes(); |
|
657 |
} |
|
658 |
else { |
|
659 |
ShowText.showNo(); |
|
660 |
fail(); |
|
661 |
} |
|
662 |
} |
|
663 |
|
|
664 |
/** |
|
665 |
* A test |
|
666 |
*/ |
|
667 |
public void test36() { |
|
668 |
word = "-8945.1201e48.141"; |
|
669 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
670 |
|
|
671 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
672 |
ShowText.showYes(); |
|
673 |
} |
|
674 |
else { |
|
675 |
ShowText.showNo(); |
|
676 |
fail(); |
|
677 |
} |
|
678 |
} |
|
679 |
|
|
680 |
/** |
|
681 |
* A test |
|
682 |
*/ |
|
683 |
public void test37() { |
|
684 |
word = "-8945.1201e48.141."; |
|
685 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
686 |
|
|
687 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
688 |
ShowText.showYes(); |
|
689 |
} |
|
690 |
else { |
|
691 |
ShowText.showNo(); |
|
692 |
fail(); |
|
693 |
} |
|
694 |
} |
|
695 |
|
|
696 |
/** |
|
697 |
* A test |
|
698 |
*/ |
|
699 |
public void test38() { |
|
700 |
word = "8945.1201ee48.141"; |
|
701 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
702 |
|
|
703 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
704 |
ShowText.showYes(); |
|
705 |
} |
|
706 |
else { |
|
707 |
ShowText.showNo(); |
|
708 |
fail(); |
|
709 |
} |
|
710 |
} |
|
711 |
|
|
712 |
/** |
|
713 |
* A test |
|
714 |
*/ |
|
715 |
public void test39() { |
|
716 |
word = "8945.1201E"; |
|
717 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
718 |
|
|
719 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
720 |
ShowText.showYes(); |
|
721 |
} |
|
722 |
else { |
|
723 |
ShowText.showNo(); |
|
724 |
fail(); |
|
725 |
} |
|
726 |
} |
|
727 |
|
|
728 |
/** |
|
729 |
* A test |
|
730 |
*/ |
|
731 |
public void test40() { |
|
732 |
word = "8945.1201e+"; |
|
733 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
734 |
|
|
735 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
736 |
ShowText.showYes(); |
|
737 |
} |
|
738 |
else { |
|
739 |
ShowText.showNo(); |
|
740 |
fail(); |
|
741 |
} |
|
742 |
} |
|
743 |
|
|
744 |
/** |
|
745 |
* A test |
|
746 |
*/ |
|
747 |
public void test41() { |
|
748 |
word = "8945.1201e+1"; |
|
749 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
750 |
|
|
751 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
752 |
ShowText.showYes(); |
|
753 |
} |
|
754 |
else { |
|
755 |
ShowText.showNo(); |
|
756 |
fail(); |
|
757 |
} |
|
758 |
} |
|
759 |
|
|
760 |
|
|
761 |
/** |
|
762 |
* A test |
|
763 |
*/ |
|
764 |
public void test42() { |
|
765 |
word = "8945.1201e+.32"; |
|
766 |
ShowText.showIsRealWithIntegerExponentText(word); |
|
767 |
|
|
768 |
if (StringNumberUtilities.isRealNumberWithIntegerExponent(word)) { |
|
769 |
ShowText.showYes(); |
|
770 |
} |
|
771 |
else { |
|
772 |
ShowText.showNo(); |
|
773 |
fail(); |
|
774 |
} |
|
775 |
} |
|
776 |
|
|
777 |
/** |
|
778 |
* A test |
|
779 |
*/ |
|
780 |
public void test43() { |
|
781 |
word = "+.6"; |
|
782 |
ShowText.showIsRealWithRealExponentText(word); |
|
783 |
|
|
784 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
785 |
ShowText.showYes(); |
|
786 |
} |
|
787 |
else { |
|
788 |
ShowText.showNo(); |
|
789 |
fail(); |
|
790 |
} |
|
791 |
} |
|
792 |
|
|
793 |
|
|
794 |
/** |
|
795 |
* A test |
|
796 |
*/ |
|
797 |
public void test44() { |
|
798 |
word = ".6"; |
|
799 |
ShowText.showIsRealWithRealExponentText(word); |
|
800 |
|
|
801 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
802 |
ShowText.showYes(); |
|
803 |
} |
|
804 |
else { |
|
805 |
ShowText.showNo(); |
|
806 |
fail(); |
|
807 |
} |
|
808 |
} |
|
809 |
|
|
810 |
|
|
811 |
/** |
|
812 |
* A test |
|
813 |
*/ |
|
814 |
public void test45() { |
|
815 |
word = "-.6"; |
|
816 |
ShowText.showIsRealWithRealExponentText(word); |
|
817 |
|
|
818 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
819 |
ShowText.showYes(); |
|
820 |
} |
|
821 |
else { |
|
822 |
ShowText.showNo(); |
|
823 |
fail(); |
|
824 |
} |
|
825 |
} |
|
826 |
|
|
827 |
|
|
828 |
/** |
|
829 |
* A test |
|
830 |
*/ |
|
831 |
public void test46() { |
|
832 |
word = "+6"; |
|
833 |
ShowText.showIsRealWithRealExponentText(word); |
|
834 |
|
|
835 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
836 |
ShowText.showYes(); |
|
837 |
} |
|
838 |
else { |
|
839 |
ShowText.showNo(); |
|
840 |
fail(); |
|
841 |
} |
|
842 |
} |
|
843 |
|
|
844 |
|
|
845 |
/** |
|
846 |
* A test |
|
847 |
*/ |
|
848 |
public void test47() { |
|
849 |
word = "-6"; |
|
850 |
ShowText.showIsRealWithRealExponentText(word); |
|
851 |
|
|
852 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
853 |
ShowText.showYes(); |
|
854 |
} |
|
855 |
else { |
|
856 |
ShowText.showNo(); |
|
857 |
fail(); |
|
858 |
} |
|
859 |
} |
|
860 |
|
|
861 |
|
|
862 |
/** |
|
863 |
* A test |
|
864 |
*/ |
|
865 |
public void test48() { |
|
866 |
word = "6"; |
|
867 |
ShowText.showIsRealWithRealExponentText(word); |
|
868 |
|
|
869 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
870 |
ShowText.showYes(); |
|
871 |
} |
|
872 |
else { |
|
873 |
ShowText.showNo(); |
|
874 |
fail(); |
|
875 |
} |
|
876 |
} |
|
877 |
|
|
878 |
/** |
|
879 |
* A test |
|
880 |
*/ |
|
881 |
public void test49() { |
|
882 |
word = "136.13"; |
|
883 |
ShowText.showIsRealWithRealExponentText(word); |
|
884 |
|
|
885 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
886 |
ShowText.showYes(); |
|
887 |
} |
|
888 |
else { |
|
889 |
ShowText.showNo(); |
|
890 |
fail(); |
|
891 |
} |
|
892 |
} |
|
893 |
|
|
894 |
|
|
895 |
/** |
|
896 |
* A test |
|
897 |
*/ |
|
898 |
public void test50() { |
|
899 |
word = "+13.42"; |
|
900 |
ShowText.showIsRealWithRealExponentText(word); |
|
901 |
|
|
902 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
903 |
ShowText.showYes(); |
|
904 |
} |
|
905 |
else { |
|
906 |
ShowText.showNo(); |
|
907 |
fail(); |
|
908 |
} |
|
909 |
} |
|
910 |
|
|
911 |
/** |
|
912 |
* A test |
|
913 |
*/ |
|
914 |
public void test51() { |
|
915 |
word = "-246.24"; |
|
916 |
ShowText.showIsRealWithRealExponentText(word); |
|
917 |
|
|
918 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
919 |
ShowText.showYes(); |
|
920 |
} |
|
921 |
else { |
|
922 |
ShowText.showNo(); |
|
923 |
fail(); |
|
924 |
} |
|
925 |
} |
|
926 |
|
|
927 |
/** |
|
928 |
* A test |
|
929 |
*/ |
|
930 |
public void test52() { |
|
931 |
word = "146.134E+13"; |
|
932 |
ShowText.showIsRealWithRealExponentText(word); |
|
933 |
|
|
934 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
935 |
ShowText.showYes(); |
|
936 |
} |
|
937 |
else { |
|
938 |
ShowText.showNo(); |
|
939 |
fail(); |
|
940 |
} |
|
941 |
} |
|
942 |
|
|
943 |
/** |
|
944 |
* A test |
|
945 |
*/ |
|
946 |
public void test53() { |
|
947 |
word = "614.425E-67"; |
|
948 |
ShowText.showIsRealWithRealExponentText(word); |
|
949 |
|
|
950 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
951 |
ShowText.showYes(); |
|
952 |
} |
|
953 |
else { |
|
954 |
ShowText.showNo(); |
|
955 |
fail(); |
|
956 |
} |
|
957 |
} |
|
958 |
|
|
959 |
/** |
|
960 |
* A test |
|
961 |
*/ |
|
962 |
public void test54() { |
|
963 |
word = "-8945.1201e48.141"; |
|
964 |
ShowText.showIsRealWithRealExponentText(word); |
|
965 |
|
|
966 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
967 |
ShowText.showYes(); |
|
968 |
} |
|
969 |
else { |
|
970 |
ShowText.showNo(); |
|
971 |
fail(); |
|
972 |
} |
|
973 |
} |
|
974 |
|
|
975 |
/** |
|
976 |
* A test |
|
977 |
*/ |
|
978 |
public void test55() { |
|
979 |
word = "-8945.1201e48.141."; |
|
980 |
ShowText.showIsRealWithRealExponentText(word); |
|
981 |
|
|
982 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
983 |
ShowText.showYes(); |
|
984 |
} |
|
985 |
else { |
|
986 |
ShowText.showNo(); |
|
987 |
fail(); |
|
988 |
} |
|
989 |
} |
|
990 |
|
|
991 |
/** |
|
992 |
* A test |
|
993 |
*/ |
|
994 |
public void test56() { |
|
995 |
word = "8945.1201ee48.141"; |
|
996 |
ShowText.showIsRealWithRealExponentText(word); |
|
997 |
|
|
998 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
999 |
ShowText.showYes(); |
|
1000 |
} |
|
1001 |
else { |
|
1002 |
ShowText.showNo(); |
|
1003 |
fail(); |
|
1004 |
} |
|
1005 |
} |
|
1006 |
|
|
1007 |
/** |
|
1008 |
* A test |
|
1009 |
*/ |
|
1010 |
public void test57() { |
|
1011 |
word = "8945.1201E"; |
|
1012 |
ShowText.showIsRealWithRealExponentText(word); |
|
1013 |
|
|
1014 |
if (StringNumberUtilities.isRealNumberWithRealExponent(word)) { |
|
1015 |
ShowText.showYes(); |
|
1016 |
} |
|
1017 |
else { |
|
1018 |
ShowText.showNo(); |
Also available in: Unified diff