Package org.opengis.test.util
Class NameTest
- java.lang.Object
-
- org.opengis.test.TestCase
-
- org.opengis.test.util.NameTest
-
public class NameTest extends TestCase
Tests generic name and related objects from theorg.opengis.utilpackage. Name instances are created using aNameFactorygiven at construction time.- Since:
- 2.2
- Version:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description protected NameFactoryfactoryThe factory to be used for testing generic name instances, ornullif none.
-
Constructor Summary
Constructors Modifier Constructor Description protectedNameTest(NameFactory factory)Creates a new test using the given factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private NameSpacecreateNameSpace(GenericName name, java.lang.String headSeparator, java.lang.String separator)Creates a namespace having the given name and separator.voidtestInternationalString()Tests the creation of "My documents" folder name.voidtestLocalName()Tests the creation of"EPSG:4326"as local names.voidtestParsedHTTP()Tests the parsing of"http://www.opengis.net/gml/srs/epsg.xml#4326"as a local name.voidtestParsedURN()Tests the parsing of"urn:ogc:def:crs:epsg:4326"as a scoped name.voidtestScopedName()Tests the creation of"urn:ogc:def:crs:epsg:4326"as a scoped name.
-
-
-
Field Detail
-
factory
protected final NameFactory factory
The factory to be used for testing generic name instances, ornullif none.
-
-
Constructor Detail
-
NameTest
protected NameTest(NameFactory factory)
Creates a new test using the given factory. If the given factory isnull, then the tests will be skipped.- Parameters:
factory- The factory to be used for creation of instances to be tested.
-
-
Method Detail
-
createNameSpace
private NameSpace createNameSpace(GenericName name, java.lang.String headSeparator, java.lang.String separator)
Creates a namespace having the given name and separator.- Parameters:
name- The name of the namespace to be returned. This argument can be created usingcreateGenericName(null, parsedNames).headSeparator- The separator to insert between the namespace and the head. For HTTP namespace, it is"://". For URN namespace, it is typically":".separator- The separator to insert between parsed names in that namespace. For HTTP namespace, it is".". For URN namespace, it is typically":".- Returns:
- A namespace having the given name and separator.
-
testInternationalString
public void testInternationalString()
Tests the creation of "My documents" folder name. This test uses the following factory methods:
-
testLocalName
public void testLocalName()
Tests the creation of"EPSG:4326"as local names. First the"EPSG"namespace is created. Then a"4326"local name is created in that namespace. This test uses the following factory methods:
-
testScopedName
public void testScopedName()
Tests the creation of"urn:ogc:def:crs:epsg:4326"as a scoped name. This test uses the following factory methods:
-
testParsedURN
public void testParsedURN()
Tests the parsing of"urn:ogc:def:crs:epsg:4326"as a scoped name. This test uses the following factory methods:
-
testParsedHTTP
public void testParsedHTTP()
Tests the parsing of"http://www.opengis.net/gml/srs/epsg.xml#4326"as a local name. This test uses the following factory methods:
-
-