Skip to content

Conversation

massifben
Copy link
Contributor

No description provided.

…w exception Multiple Data Attribute found

Signed-off-by: massifben <[email protected]>
@@ -14,6 +14,7 @@
import org.lfenergy.compas.sct.commons.scl.SclRootAdapter;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got 2 test failing in my IDE :
org.lfenergy.compas.sct.commons.scl.dtt.LNodeTypeAdapterTest#testHasSameContentAs
and
org.lfenergy.compas.sct.commons.scl.dtt.DataTypeTemplateAdapterTest#testImportLNodeType
org.lfenergy.compas.sct.commons.scl.dtt.DataTypeTemplateAdapterTest#testImportDTT

.filter(dataAttributeRef -> dataRef.equals(dataAttributeRef.getDataAttributes()))
.reduce((dar1, dar2) -> {
// 2 data attribute ref with the same name in the same LNodeType means the SCL is not valid, according to XSD
throw new ScdException("Multiple Data Attribute found for this data reference '%s' in LNodeType.lnClass=%s, LNodeType.id=%s. Found DA : '%s' ".formatted(dataRef, getLNClass(), getId(), dar1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it tested ?

@@ -195,7 +193,7 @@ public List<DataAttributeRef> getDataAttributeRefs(@NonNull DataAttributeRef fil
}

/**
* Return a list of summarized Data Attribute References beginning from given this LNodeType.
* Return a DataAttributeRef beginning from this LNodeType.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

@@ -41,7 +41,7 @@
* <li>{@link LNodeTypeAdapter#getId() <em>Returns the value of the <b>id </b>attribute</em>}</li>
* <li>{@link LNodeTypeAdapter#getLNClass <em>Returns the value of the <b>lnClass </b>attribute</em>}</li>
* <li>{@link LNodeTypeAdapter#getDataAttributeRefs(DataAttributeRef)} <em>Returns <b>DataAttributeRef </b> list</em>}</li>
* <li>{@link LNodeTypeAdapter#getDataAttributeRefs(String)} <em>Returns <b>DataAttributeRef </b> list</em>}</li>
* <li>{@link LNodeTypeAdapter#getDataAttributeRef(String)} <em>Returns <b>DataAttributeRef </b> list</em>}</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bof

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug : LNodeTypeAdapter.getDataAttributeRef should not throw exception "Multiple Data Attribute found"
2 participants