From a7019614896fdd3e29b9a28f6a8cfd2c1b365983 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Sun, 1 Mar 2015 20:47:25 +0100 Subject: Renamed domain to ontology. --- test/core/model/DocumentTest.cpp | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'test/core/model/DocumentTest.cpp') diff --git a/test/core/model/DocumentTest.cpp b/test/core/model/DocumentTest.cpp index 1bb2356..8ed59f5 100644 --- a/test/core/model/DocumentTest.cpp +++ b/test/core/model/DocumentTest.cpp @@ -23,10 +23,10 @@ #include #include #include -#include +#include #include "TestDocument.hpp" -#include "TestDomain.hpp" +#include "TestOntology.hpp" namespace ousia { @@ -36,10 +36,10 @@ TEST(Document, construct) TerminalLogger logger{std::cerr, true}; Manager mgr{1}; Rooted sys{new SystemTypesystem(mgr)}; - // Get the domain. - Rooted domain = constructBookDomain(mgr, sys, logger); + // Get the ontology. + Rooted ontology = constructBookOntology(mgr, sys, logger); // Construct the document. - Rooted doc = constructBookDocument(mgr, logger, domain); + Rooted doc = constructBookDocument(mgr, logger, ontology); // Check the document content. ASSERT_FALSE(doc.isNull()); @@ -111,22 +111,22 @@ TEST(Document, construct) TEST(Document, validate) { - // Let's start with a trivial domain and a trivial document. + // Let's start with a trivial ontology and a trivial document. TerminalLogger logger{std::cerr, true}; Manager mgr{1}; Rooted sys{new SystemTypesystem(mgr)}; - Rooted domain{new Domain(mgr, sys, "trivial")}; + Rooted ontology{new Ontology(mgr, sys, "trivial")}; Cardinality single; single.merge({1}); // Set up the "root" StructuredClass. Rooted rootClass{new StructuredClass( - mgr, "root", domain, single, {nullptr}, false, true)}; + mgr, "root", ontology, single, {nullptr}, false, true)}; // set up a document for it. { // first an invalid one, which is empty. Rooted doc{new Document(mgr, "myDoc.oxd")}; - doc->referenceDomain(domain); + doc->referenceOntology(ontology); ASSERT_EQ(ValidationState::UNKNOWN, doc->getValidationState()); ASSERT_FALSE(doc->validate(logger)); // then add a root, which should make it valid. @@ -138,7 +138,7 @@ TEST(Document, validate) { // A root with an invalid name, however, should make it invalid Rooted doc{new Document(mgr, "myDoc.oxd")}; - doc->referenceDomain(domain); + doc->referenceOntology(ontology); Rooted root = buildRootStructuredEntity( doc, logger, {"root"}, {}, "my invalid root"); ASSERT_EQ(ValidationState::UNKNOWN, doc->getValidationState()); @@ -150,7 +150,7 @@ TEST(Document, validate) rootClass->createFieldDescriptor(logger).first; // and add a child class for it. Rooted childClass{ - new StructuredClass(mgr, "child", domain, single)}; + new StructuredClass(mgr, "child", ontology, single)}; rootField->addChild(childClass); { /* @@ -158,7 +158,7 @@ TEST(Document, validate) * document should be invalid again. */ Rooted doc{new Document(mgr, "myDoc.oxd")}; - doc->referenceDomain(domain); + doc->referenceOntology(ontology); Rooted root = buildRootStructuredEntity(doc, logger, {"root"}); ASSERT_EQ(ValidationState::UNKNOWN, doc->getValidationState()); @@ -173,16 +173,16 @@ TEST(Document, validate) ASSERT_FALSE(doc->validate(logger)); } /* - * Add a further extension to the domain: We add a subclass to child. + * Add a further extension to the ontology: We add a subclass to child. */ Rooted childSubClass{ - new StructuredClass(mgr, "childSub", domain, single, childClass)}; + new StructuredClass(mgr, "childSub", ontology, single, childClass)}; { /* * A document with one instance of the Child subclass should be valid. */ Rooted doc{new Document(mgr, "myDoc.oxd")}; - doc->referenceDomain(domain); + doc->referenceOntology(ontology); Rooted root = buildRootStructuredEntity(doc, logger, {"root"}); buildStructuredEntity(doc, logger, root, {"childSub"}); @@ -202,7 +202,7 @@ TEST(Document, validate) * invalid, because it has no children of itself. */ Rooted doc{new Document(mgr, "myDoc.oxd")}; - doc->referenceDomain(domain); + doc->referenceOntology(ontology); Rooted root = buildRootStructuredEntity(doc, logger, {"root"}); buildStructuredEntity(doc, logger, root, {"childSub"}); @@ -223,7 +223,7 @@ TEST(Document, validate) * valid, because of the override. */ Rooted doc{new Document(mgr, "myDoc.oxd")}; - doc->referenceDomain(domain); + doc->referenceOntology(ontology); Rooted root = buildRootStructuredEntity(doc, logger, {"root"}); buildStructuredEntity(doc, logger, root, {"childSub"}); @@ -241,7 +241,7 @@ TEST(Document, validate) * invalid again, because we are missing the primitive content. */ Rooted doc{new Document(mgr, "myDoc.oxd")}; - doc->referenceDomain(domain); + doc->referenceOntology(ontology); Rooted root = buildRootStructuredEntity(doc, logger, {"root"}); Rooted child = @@ -259,14 +259,14 @@ TEST(Document, validate) ASSERT_TRUE(doc->validate(logger)); } - // Now add an Annotation class to the domain. - Rooted annoClass{new AnnotationClass(mgr, "anno", domain)}; + // Now add an Annotation class to the ontology. + Rooted annoClass{new AnnotationClass(mgr, "anno", ontology)}; { /* * Create a valid document in itself. */ Rooted doc{new Document(mgr, "myDoc.oxd")}; - doc->referenceDomain(domain); + doc->referenceOntology(ontology); Rooted root = buildRootStructuredEntity(doc, logger, {"root"}); Rooted start{new Anchor(mgr, root)}; -- cgit v1.2.3