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 javax.xml.namespace.QName;
19:
20: import org.geotools.xs.TestSchema;
21:
22: public class XSLongStrategyTest extends TestSchema {
23: /**
24: * long has a lexical representation consisting of an
25: * optional sign followed by a finite-length sequence
26: * of decimal digits (#x30-#x39). If the sign is omitted,
27: * "+" is assumed.
28: *
29: * For example: -1, 0, 12678967543233, +100000.
30: * @throws Exception
31: *
32: */
33:
34: /*
35: * Test method for 'org.geotools.xml.strategies.xs.XSLongStrategy.parse(Element, Node[], Object)'
36: */
37: public void testParse() throws Exception {
38: validateValues("-1", new Long(-1));
39: validateValues("0", new Long(0));
40: validateValues("12678967543233", new Long(12678967543233L));
41: validateValues("+100000", new Long(100000));
42: }
43:
44: protected QName getQName() {
45: return XS.LONG;
46: }
47: }
|