Skip to content

Commit

Permalink
MET-1331 Tags/Classifications - tests failing on relationship directi…
Browse files Browse the repository at this point in the history
…on, fixed export of base relationship
  • Loading branch information
davidmilward committed Feb 15, 2017
1 parent b35617d commit 277f17d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ abstract class CatalogueElementPrintHelper<E extends CatalogueElement> {
}

protected void printBasedOn(theMkp, Relationship rel, PrintContext context) {
theMkp.basedOn(ref(rel.source, context)) {
theMkp.basedOn(ref(rel.destination, context)) {
processRelationshipMetadata(theMkp, context, rel)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ class DataTypePrintHelper extends CatalogueElementPrintHelper<DataType> {

@Override
protected void printBasedOn(Object mkp, Relationship rel, PrintContext context) {
printElement(mkp, rel.source, context, rel)
printElement(mkp, rel.destination, context, rel)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,17 @@ class CatalogueXmlPrinterSpec extends AbstractIntegrationSpec {
private DataType getInteger() {
decimal

build {
DataType dataType = build {
dataType(name: "Integer", id: "http://www.example.com/types/Integer") {
basedOn 'Decimal'
description "A number with no fractional part."
}
}

assert dataType.isBasedOn
assert dataType.isBasedOn.any { it.name == 'Decimal'}

dataType
}

private DataType getGender() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<dataElement name="Factor of Adhesion" id="http://www.example.com/elements/Adhesion" status="DRAFT">
<dataType name="Force" id="http://www.example.com/domains/Force" status="DRAFT">
<description>A force is a push or pull upon an object resulting from the object's interaction with another object.</description>
<dataType ref="http://www.example.com/domains/Force"/>
<dataType name="Decimal"
id="http://www.example.com/types/Decimal"
status="DRAFT">
<description>A number that uses a decimal point followed by digits that show a value smaller than one.</description>
</dataType>
<regex>\d+</regex>
<measurementUnit name="Newton" id="http://www.example.com/units/Newton" status="DRAFT" symbol="N">
<description>The newton (symbol: N) is the International System of Units (SI) derived unit of force.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
<dataElement name="Factor of Adhesion" id="http://www.example.com/elements/Adhesion" status="DRAFT">
<dataType name="Force" id="http://www.example.com/domains/Force" status="DRAFT">
<description>A force is a push or pull upon an object resulting from the object's interaction with another object.</description>
<dataType ref="http://www.example.com/domains/Force"/>
<dataType name="Decimal"
id="http://www.example.com/types/Decimal"
status="DRAFT">
<description>A number that uses a decimal point followed by digits that show a value smaller than one.</description>
</dataType>
<regex>\d+</regex>
<measurementUnit name="Newton" id="http://www.example.com/units/Newton" status="DRAFT" symbol="N">
<description>The newton (symbol: N) is the International System of Units (SI) derived unit of force.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<dataElement name="Factor of Adhesion" id="http://www.example.com/elements/Adhesion" status="DRAFT">
<dataType name="Force" id="http://www.example.com/domains/Force" status="DRAFT">
<description>A force is a push or pull upon an object resulting from the object's interaction with another object.</description>
<dataType ref="http://www.example.com/domains/Force"/>
<dataType name="Decimal"
id="http://www.example.com/types/Decimal"
status="DRAFT">
<description>A number that uses a decimal point followed by digits that show a value smaller than one.</description>
</dataType>
<regex>\d+</regex>
<measurementUnit name="Newton" id="http://www.example.com/units/Newton" status="DRAFT" symbol="N">
<description>The newton (symbol: N) is the International System of Units (SI) derived unit of force.</description>
Expand All @@ -19,9 +23,6 @@
<dataClass name="Locomotive" id="http://www.example.com/models/Locomotive" status="DRAFT">
<dataElement ref="http://www.example.com/elements/Adhesion"/>
</dataClass>
<dataType name="Decimal" id="http://www.example.com/types/Decimal" status="DRAFT">
<description>A number that uses a decimal point followed by digits that show a value smaller than one.</description>
</dataType>
</dataModel>
<!-- Relationship types are only imported if and only if they are not present in the catalogue yet. Any subsequent changes are ignored! For non-admin users, the types are always imported as system ones and they need to be approved by the catalogue admin first. -->
<relationshipTypes>
Expand Down

0 comments on commit 277f17d

Please sign in to comment.