public class LinkTests extends BaseFixture
NS_MAP, testSubject| Constructor and Description |
|---|
LinkTests() |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addHrefError(Node linkNode,
String details,
org.opengis.cite.validation.ValidationErrorHandler errHandler) |
(package private) void |
checkModelReferent(Element linkNode,
URI uriRef,
org.opengis.cite.validation.ValidationErrorHandler errHandler)
Checks that Link elements which are children of a kml:Model refer to a
(3D) graphics resource.
|
(package private) void |
checkNetworkLinkReferent(Node linkNode,
URI uriRef,
org.opengis.cite.validation.ValidationErrorHandler errHandler)
Checks that the network link referent exists.
|
(package private) void |
checkOverlayIconReferent(Node linkNode,
String href,
org.opengis.cite.validation.ValidationErrorHandler errHandler)
Checks that a link element occurring within a kml:Overlay element refers
to an image resource.
|
(package private) String |
getLinkHref(Element linkElem,
org.opengis.cite.validation.ValidationErrorHandler errHandler)
Gets the value of the child kml:href element in a Link element.
|
void |
initHttpClient()
Initializes the HTTP client component.
|
(package private) BufferedImage |
readImageDataFromURI(URI uriRef)
Attempts to create a BufferedImage using the data retrieved from some
URI.
|
void |
verifyIconReferent()
[
Test] Verifies that the kml:Icon/kml:href element refers to an
image resource. |
void |
verifyLinkHasHref()
[
Test] Verifies that if a kml:Link or a kml:Icon element is not a
descendant of kml:Update, then it contains a kml:href child element. |
void |
verifyLinkReferent()
[
Test] Verifies that a link element refers to the correct
resource type, according to one of the following cases:
|
void |
verifyLinkRefreshInterval()
[
Test] Verifies that a link element (of type kml:LinkType)
satisfies the following constraint: if present, the child
kml:refreshInterval element has a positive value (> 0). |
void |
verifyLinkViewBoundScale()
[
Test] Verifies that a link element (of type kml:LinkType)
satisfies the following constraint: if present, the child
kml:viewBoundScale element has a positive value (> 0). |
void |
verifyLinkViewRefreshTime()
[
Test] Verifies that a link element (of type kml:LinkType)
satisfies the following constraint: if present, the child
kml:viewRefreshTime element has a positive value (> 0). |
void |
verifyNetworkLinkControlRefresh()
[
Test] Verifies that the
kml:NetworkLinkControl/kml:minRefreshPeriod element has a non-negative
value (>=0). |
void |
verifyUpdateTargetExists()
[
Test] Verifies that the value of the kml:Update/kml:targetHref
element satisfies all of the following constraints:
it is an absolute URL that refers to a KML or KMZ resource;
the target resource contains the data to be updated. |
obtainTestSubject, setTestSubject, verifyElementNotEmptypublic void initHttpClient()
public void verifyLinkRefreshInterval()
Test] Verifies that a link element (of type kml:LinkType)
satisfies the following constraint: if present, the child
kml:refreshInterval element has a positive value (> 0).public void verifyLinkViewRefreshTime()
Test] Verifies that a link element (of type kml:LinkType)
satisfies the following constraint: if present, the child
kml:viewRefreshTime element has a positive value (> 0).public void verifyLinkViewBoundScale()
Test] Verifies that a link element (of type kml:LinkType)
satisfies the following constraint: if present, the child
kml:viewBoundScale element has a positive value (> 0).public void verifyLinkReferent()
Test] Verifies that a link element refers to the correct
resource type, according to one of the following cases:
public void verifyIconReferent()
Test] Verifies that the kml:Icon/kml:href element refers to an
image resource. The image format is expected to correspond to a
registered image media type (PNG, JPEG, and GIF images are commonly used
for this purpose). This test applies to kml:Icon elements in both
kml:IconStyle and kml:AbstractOverlayType contexts.public void verifyNetworkLinkControlRefresh()
Test] Verifies that the
kml:NetworkLinkControl/kml:minRefreshPeriod element has a non-negative
value (>=0).public void verifyUpdateTargetExists()
Test] Verifies that the value of the kml:Update/kml:targetHref
element satisfies all of the following constraints:
The kml:Update element specifies an update to a KML resource that has previously been retrieved via some kml:NetworkLink. The Updates page in the KML Developer's Guide provides a detailed example of how updates are applied in practice.
public void verifyLinkHasHref()
Test] Verifies that if a kml:Link or a kml:Icon element is not a
descendant of kml:Update, then it contains a kml:href child element.void checkOverlayIconReferent(Node linkNode, String href, org.opengis.cite.validation.ValidationErrorHandler errHandler)
ImageReader cannot be found,
an error is reported.linkNode - A link node (containing a child kml:href element).href - An absolute URI (extracted from the link node) that refers to
an image resource.errHandler - The error handler that receives any errors that were detected.BufferedImage readImageDataFromURI(URI uriRef) throws IOException
uriRef - An absolute URI reference ('http' or 'file' schemes).null.IOException - If an error occurs while reading the image data.void checkModelReferent(Element linkNode, URI uriRef, org.opengis.cite.validation.ValidationErrorHandler errHandler)
linkNode - A link element containing a child kml:href element.uriRef - A URI reference.errHandler - The error handler that receives any errors that were detected.void checkNetworkLinkReferent(Node linkNode, URI uriRef, org.opengis.cite.validation.ValidationErrorHandler errHandler)
linkNode - A link element containing a child kml:href element.uriRef - A URI reference.errHandler - The error handler that receives any errors that were detected.String getLinkHref(Element linkElem, org.opengis.cite.validation.ValidationErrorHandler errHandler)
Note: A kml:Icon/kml:href value will include tile
parameters if a kml:PhotoOverlay element has a child kml:ImagePyramid
element (level, x, y).
Substituting 0 (zero) for all parameter references should produce a URL
that refers to the lowest resolution image.
linkElem - An Element node representing a link element.errHandler - The error handler that receives any errors that were detected.null if it was missing or not a valid URI.Copyright © 2021 Open Geospatial Consortium. All rights reserved.