#!/bin/sh

host=localhost
port=5050

## initialize
(cd ../../bin && ./setup --init-only)

check()
{
	file="${1}"

	if [ ! -r ${file} ]; then
		echo "${file} not found" 1>&2
		exit 1
	fi

	darumaClient --host "$host" --port "$port" "${file}" \
		| tee response-"${file}"

	echo; echo; echo
}

## register
check common.wfs.register
check Node.wfs.register
check RoadLink.wfs.register
check Building.wfs.register

## describe
check Node.wfs.describe
check RoadLink.wfs.describe
check Building.wfs.describe
check all.wfs.describe

# capabilities
check all.wfs.capabilities

# insert
check RandomCity.gml.small-insert
#check RandomCity.gml-insert

# get feature
check Node.wfs.getFeature
check RoadLink.wfs.getFeature
check Building.wfs.getFeature
