01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library 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 GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.xs.bindings;
17:
18: import java.math.BigInteger;
19:
20: import javax.xml.namespace.QName;
21:
22: import org.geotools.xs.TestSchema;
23:
24: public class XSIntegerStrategyTest extends TestSchema {
25: /**
26: * integer has a lexical representation consisting of a finite-length
27: * sequence of decimal digits (#x30-#x39) with an optional leading sign.
28: * If the sign is omitted, "+" is assumed.
29: *
30: * For example: -1, 0, 12678967543233, +100000.
31: */
32: public void testParse() throws Exception {
33: validateValues("-1", new BigInteger("-1"));
34: validateValues("0", new BigInteger("0"));
35: validateValues("12678967543233", new BigInteger(
36: "12678967543233"));
37: validateValues("+100000", new BigInteger("100000"));
38: }
39:
40: protected QName getQName() {
41: return XS.INTEGER;
42: }
43: }
|