Skip to content

Add tests #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,12 @@ ivoatex/Makefile:
@echo
git submodule update --init


STILTS ?= stilts
SCHEMA_FILE=VODataService-v1.3.xsd

test:
@echo "No tests defined yet"
sh test-assertions.sh
@$(STILTS) xsdvalidate $(SCHEMA_FILE)
@ls samples/*.xml | xargs -n1 $(STILTS) xsdvalidate \
schemaloc="http://www.ivoa.net/xml/VODataService/v1.1=$(SCHEMA_FILE)"
370 changes: 157 additions & 213 deletions samples/catalog.xml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion samples/conesearch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
xmlns:cs="http://www.ivoa.net/xml/ConeSearch/v1.0"
xmlns:stc="http://www.ivoa.net/xml/STC/stc-v1.30.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ivoa.net/xml/ConeSearch/v1.0 http://www.ivoa.net/xml/ConeSearch/v1.0">

<title>NCSA Astronomy Digital Image Library Cone Search</title>
<shortName>ADIL</shortName>
Expand Down
File renamed without changes.
6 changes: 5 additions & 1 deletion samples/sia.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
xmlns:sia="http://www.ivoa.net/xml/SIA/v1.0"
xmlns:stc="http://www.ivoa.net/xml/STC/stc-v1.30.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ivoa.net/xml/SIA/v1.0 http://www.ivoa.net/xml/SIA/v1.0">

<validationLevel validatedBy="ivo://nvo.ncsa/registry"> 2 </validationLevel>

Expand Down Expand Up @@ -120,6 +121,9 @@

</coverage>

<productTypeServed>image</productTypeServed>
<productTypeServed>visibility</productTypeServed>

<tableset>
<schema>
<name>default</name>
Expand Down
3 changes: 2 additions & 1 deletion samples/sia2ver.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
xmlns:sia="http://www.ivoa.net/xml/SIA/v1.0"
xmlns:stc="http://www.ivoa.net/xml/STC/stc-v1.30.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ivoa.net/xml/SIA/v1.0 http://www.ivoa.net/xml/SIA/v1.0">

<title>NCSA Astronomy Digital Image Library Simple Image Access</title>
<shortName>ADIL</shortName>
Expand Down
164 changes: 0 additions & 164 deletions samples/siastd.xml

This file was deleted.

92 changes: 4 additions & 88 deletions samples/ssa.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
<resource xsi:type="vs:CatalogService" status="active"
created="2000-01-01T09:00:00" updated="2000-01-01T09:00:00"

xmlns:ssa="http://www.ivoa.net/xml/SSA/v0.3"
xmlns:ssa="http://www.ivoa.net/xml/SSA/v1.1"

xmlns:vr="http://www.ivoa.net/xml/VOResource/v1.0"
xmlns:vs="http://www.ivoa.net/xml/VODataService/v1.1"
xmlns:stc="http://www.ivoa.net/xml/STC/stc-v1.30.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ivoa.net/xml/SSA/v1.1 http://www.ivoa.net/xml/SSA/v1.1">

<title>NCSA Astronomy Digital Image Library Spectrum Service</title>
<shortName>ADIL</shortName>
Expand Down Expand Up @@ -102,92 +103,7 @@
<complianceLevel>full</complianceLevel>
<dataSource>pointed</dataSource>
<creationType>cutout</creationType>
<maxSearchRadius>10</maxSearchRadius>
<maxRecords>10000</maxRecords>
<defaultMaxRecords>500</defaultMaxRecords>
<maxAperture>3600</maxAperture>

<!--
- These are the supported WCS frames. The identifiers point to
- standard (registered) coordinate systems described with STC.
- "Non-standard" systems can also be list, but then would need to
- be registered separately.
<supportedFrame> ivo://STClib/CoordSys#UTC-FK5-TOPO </supportedFrame>
<supportedFrame> ivo://STClib/CoordSys#UTC-GAL-TOPO </supportedFrame>
-->

<!-- recall also alternative approach of listing as IVOA identifiers
<supports> NativePassthru </supports>
<supports> QueryByBandpass </supports>
<supports> Compression </supports>
<supports> Paging </supports>
-->

<!--
- a test query is for periodic, automated testing; adjust
- parameters to suit the SSA interface.
-->
<testQuery>
<pos>
<long> 102.2 </long>
<lat> 28.5 </lat>
</pos>
<size> 0.5 </size>
<!--
<band>
<min> 0.0005 </min>
<max> 0.5 </max>
<name> radio </name>
</band>
<time>
<earliest>1991-01-01</earliest>
</time>
<extras> survey=f </extras>
-->
<queryDataCmd>POS=102.2,28.5&amp;SIZE=0.5</queryDataCmd>
</testQuery>
</capability>

<!--
- ProtoSpectralAccess is for a pre-v1.0 implementation of SSA
-->
<capability xsi:type="ssa:ProtoSpectralAccess"
standardID="ivo://ivoa.net/std/SSA">

<!--
- this is the standard GET interface
-->
<interface xsi:type="vs:ParamHTTP" role="std">
<accessURL use="base">
http://adil.ncsa.uiuc.edu/cgi-bin/vossa
</accessURL>

<!--
- here's a service-defined parameter
-->
<param std="false">
<name>cachedonly</name>
<description>
If set to 1 (true), this will return only those
previously calculated spectra currently in the cache.
</description>
<dataType>boolean</dataType>
</param>
</interface>

<!--
- Here's an interactive version. Since it's just a front-end to
- the GET service, it shares the same capability metadata.
-->
<interface xsi:type="vr:WebBrowser">
<accessURL> http://adil.ncsa.uiuc.edu/ws/vossa </accessURL>
</interface>

<!--
- This starts the SSA-specific metadata
-->
<dataSource>pointed</dataSource>
<creationType>cutout</creationType>
<supportedFrame>ICRS</supportedFrame>
<maxSearchRadius>10</maxSearchRadius>
<maxRecords>10000</maxRecords>
<defaultMaxRecords>500</defaultMaxRecords>
Expand Down
23 changes: 23 additions & 0 deletions test-assertions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

SCHEMA=VODataService-v1.*.xsd

die() {
echo $*
exit 1
}


assert_schema_version_for_rec() {
# make sure the schema version has no tags if this is a REC
if xmlstarlet sel -T -t -m "xs:schema" -v "@version" $SCHEMA \
| grep "^[0-9]\.[0-9]$" > /dev/null ; then
: # all is fine
else
die "$SCHEMA version has tags (inappropriate for a REC release)"
fi
}

if grep "ivoaDoctype}{REC}" ivoatexmeta.tex > /dev/null; then
assert_schema_version_for_rec
fi