# run as:
# java -cp build/:lib/java/log4j__V1.2.8.jar:\
# lib/java/xerces__V2.6.2/xercesImpl.jar:\
# lib/java/xerces__V2.6.2/xml-apis.jar \
# mpi.imdi.api.TestDom batch < imditest.txt > logfile
loadfile=http://www2.phonetik.uni-muenchen.de/IMDI/SK/SK-Mobil/w188_mn.imdi
linkgetall=info
elementget=Session.Project.Description.Link
# it should not be allowed to remove Session.Project:
elementremove=Session.Project
elementsetbyspec=Session.Project.Description.Link,linkelink
linkgetall=info
elementremove=Session.Project.Description
# test if description removal worked:
linkgetall=info
testsession
testcorpus
# new "empty" DOM:
newcorpus
testsession
testcorpus
# test the corpus link reader:
loadfile=http://corpus1.mpi.nl/IMDI/metadata/IMDI.imdi
linkgetall=unknown
# load again, then save to a local file:
loadfile=http://www2.phonetik.uni-muenchen.de/IMDI/SK/SK-Mobil/w188_mn.imdi
linkcreate=newlink,someNewLinkDescription,media
linkgetall=unknown
saveclean=testfile.imdi
# open new "empty" DOM, save to a local file and validate that file:
newsession
# we have to saveclean, not savefile, as domids in the file would not validate
saveclean=testfile.imdi
validate=file:testfile.imdi
# reload the file and validate it again, then do some element testing:
# *** use ./testfile.imdi instead of testfile.imdi to workaround a OurURL(url,file) bug ***
loadvalidate=file:./testfile.imdi
elementget=Session.Name
elementget=Session.Title
elementsetbyid=i4,this is the title
elementget=Session.Title
elementsetbyspec=Session.Name,this is the session name
elementget=Session
elementget=Session.Name
elementget=Session.Title
elementaddempty=Session.MediaFile
elementaddempty=Session.WrittenResource
elementaddempty=Session.MediaFile
elementaddempty=Session.WrittenResource
elementget=Session.MediaFile(2)
# now do some link testing:
linkchange=i176,changedURL,1234/00-5678-9ABC-DEF0-1234-0,media,,,changedValue,changedFormat,changedType
# this should fail:
linkgetbyid=i9999
linkgetbyid=i176
linkcreate=createdWrittenURL,,written,
linkcreate=createdMediaURL,,media,
linkgetall=written
linkremove=Session.MediaFile(1)
# element i42 will probably be something which we are not allowed to remove:
linkremove=i42
linkgetbyid=i256
# save the result of the link and element tests:
savefile=test.imdi
# transform should not change the DOM in memory... fails if none.xsl is missing
transform=file:test.imdi,file:none.xsl
linkgetall=unknown
