Skip to content

Commit

Permalink
Update test data to aas-core-meta 31d6afd (#518)
Browse files Browse the repository at this point in the history
We update the development requirements to and re-record the test data
for [aas-core-meta 31d6afd].

Notably, we update to the v3.0.1 of the specification.

[aas-core-meta 31d6afd]: aas-core-works/aas-core-meta@31d6afd
  • Loading branch information
mristin authored Aug 22, 2024
1 parent e1d8c19 commit 0f7345e
Show file tree
Hide file tree
Showing 40 changed files with 409 additions and 566 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"twine",
"jsonschema==3.2.0",
"xmlschema==3.3.1",
"aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@6d5411b#egg=aas-core-meta",
"aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@31d6afd#egg=aas-core-meta",
"ssort==0.12.3",
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7118,22 +7118,16 @@ class EnhancedEmbeddedDataSpecification
instance_->set_data_specification_content(value);
}

const common::optional<
std::shared_ptr<types::IReference>
>& data_specification() const override {
const std::shared_ptr<types::IReference>& data_specification() const override {
return instance_->data_specification();
}

common::optional<
std::shared_ptr<types::IReference>
>& mutable_data_specification() override {
std::shared_ptr<types::IReference>& mutable_data_specification() override {
return instance_->mutable_data_specification();
}

void set_data_specification(
common::optional<
std::shared_ptr<types::IReference>
> value
std::shared_ptr<types::IReference> value
) override {
instance_->set_data_specification(value);
}
Expand Down Expand Up @@ -13537,26 +13531,12 @@ std::shared_ptr<types::IEmbeddedDataSpecification> WrapEmbeddedDataSpecification
)
);

if (that->data_specification().has_value()) {
const std::shared_ptr<types::IReference>& value(
that->data_specification().value()
);

std::shared_ptr<
types::IReference
> wrapped(
Wrap<E>(
value,
factory
)
);

that->set_data_specification(
common::make_optional(
std::move(wrapped)
)
);
}
that->set_data_specification(
Wrap<E>(
that->data_specification(),
factory
)
);

std::shared_ptr<E> enh(
factory(that)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11313,15 +11313,10 @@ void IteratorOverEmbeddedDataSpecification::Execute() {
}

case 1: {
if (!(casted_->data_specification().has_value())) {
state_ = 2;
continue;
}

property_ = Property::kDataSpecification;
item_ = std::move(
std::static_pointer_cast<types::IClass>(
*(casted_->data_specification())
casted_->data_specification()
)
);
++index_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23597,6 +23597,18 @@ std::pair<
);
}

if (!json.contains("dataSpecification")) {
return std::make_pair<
common::optional<std::shared_ptr<types::IEmbeddedDataSpecification> >,
common::optional<DeserializationError>
>(
common::nullopt,
common::make_optional<DeserializationError>(
L"The required property dataSpecification is missing"
)
);
}

// endregion Check required properties

// region Initialization
Expand All @@ -23605,9 +23617,7 @@ std::pair<

common::optional<std::shared_ptr<types::IDataSpecificationContent> > the_data_specification_content;

common::optional<
std::shared_ptr<types::IReference>
> the_data_specification;
common::optional<std::shared_ptr<types::IReference> > the_data_specification;

// endregion Initialization

Expand Down Expand Up @@ -23641,30 +23651,28 @@ std::pair<

// region De-serialize dataSpecification

if (json.contains("dataSpecification")) {
std::tie(
the_data_specification,
error
) = DeserializeReference(
json["dataSpecification"],
additional_properties
);
std::tie(
the_data_specification,
error
) = DeserializeReference(
json["dataSpecification"],
additional_properties
);

if (error.has_value()) {
error->path.segments.emplace_front(
common::make_unique<PropertySegment>(
L"dataSpecification"
)
);
if (error.has_value()) {
error->path.segments.emplace_front(
common::make_unique<PropertySegment>(
L"dataSpecification"
)
);

return std::make_pair<
common::optional<std::shared_ptr<types::IEmbeddedDataSpecification> >,
common::optional<DeserializationError>
>(
common::nullopt,
std::move(error)
);
}
return std::make_pair<
common::optional<std::shared_ptr<types::IEmbeddedDataSpecification> >,
common::optional<DeserializationError>
>(
common::nullopt,
std::move(error)
);
}

// endregion De-serialize dataSpecification
Expand All @@ -23678,7 +23686,7 @@ std::pair<
// upcast.
new types::EmbeddedDataSpecification(
std::move(*the_data_specification_content),
std::move(the_data_specification)
std::move(*the_data_specification)
)
),
common::nullopt
Expand Down Expand Up @@ -36939,40 +36947,33 @@ std::pair<
*json_data_specification_content
);

const common::optional<
std::shared_ptr<types::IReference>
>& maybe_data_specification(
that.data_specification()
common::optional<nlohmann::json> json_data_specification;
std::tie(
json_data_specification,
error
) = SerializeIClass(
*that.data_specification()
);
if (maybe_data_specification.has_value()) {
common::optional<nlohmann::json> json_data_specification;
std::tie(
json_data_specification,
error
) = SerializeIClass(
**maybe_data_specification
if (error.has_value()) {
error->path.segments.emplace_front(
common::make_unique<iteration::PropertySegment>(
iteration::Property::kDataSpecification
)
);
if (error.has_value()) {
error->path.segments.emplace_front(
common::make_unique<iteration::PropertySegment>(
iteration::Property::kDataSpecification
)
);

return std::make_pair<
common::optional<nlohmann::json>,
common::optional<SerializationError>
>(
common::nullopt,
std::move(error)
);
}

result["dataSpecification"] = std::move(
*json_data_specification
return std::make_pair<
common::optional<nlohmann::json>,
common::optional<SerializationError>
>(
common::nullopt,
std::move(error)
);
}

result["dataSpecification"] = std::move(
*json_data_specification
);

return std::make_pair<
common::optional<nlohmann::json>,
common::optional<SerializationError>
Expand Down
16 changes: 4 additions & 12 deletions test_data/cpp/test_main/aas_core_meta.v3/expected_output/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6912,9 +6912,7 @@ void Environment::set_concept_descriptions(

EmbeddedDataSpecification::EmbeddedDataSpecification(
std::shared_ptr<IDataSpecificationContent> data_specification_content,
common::optional<
std::shared_ptr<IReference>
> data_specification
std::shared_ptr<IReference> data_specification
) {
data_specification_content_ = std::move(data_specification_content);

Expand All @@ -6939,22 +6937,16 @@ void EmbeddedDataSpecification::set_data_specification_content(
data_specification_content_ = value;
}

const common::optional<
std::shared_ptr<IReference>
>& EmbeddedDataSpecification::data_specification() const {
const std::shared_ptr<IReference>& EmbeddedDataSpecification::data_specification() const {
return data_specification_;
}

common::optional<
std::shared_ptr<IReference>
>& EmbeddedDataSpecification::mutable_data_specification() {
std::shared_ptr<IReference>& EmbeddedDataSpecification::mutable_data_specification() {
return data_specification_;
}

void EmbeddedDataSpecification::set_data_specification(
common::optional<
std::shared_ptr<IReference>
> value
std::shared_ptr<IReference> value
) {
data_specification_ = value;
}
Expand Down
34 changes: 9 additions & 25 deletions test_data/cpp/test_main/aas_core_meta.v3/expected_output/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2942,18 +2942,12 @@ class IEmbeddedDataSpecification
///@{
/// \brief Reference to the data specification

virtual const common::optional<
std::shared_ptr<IReference>
>& data_specification() const = 0;
virtual const std::shared_ptr<IReference>& data_specification() const = 0;

virtual common::optional<
std::shared_ptr<IReference>
>& mutable_data_specification() = 0;
virtual std::shared_ptr<IReference>& mutable_data_specification() = 0;

virtual void set_data_specification(
common::optional<
std::shared_ptr<IReference>
> value
std::shared_ptr<IReference> value
) = 0;

///@}
Expand Down Expand Up @@ -10275,11 +10269,9 @@ class Environment
class EmbeddedDataSpecification
: public IEmbeddedDataSpecification {
public:
explicit EmbeddedDataSpecification(
EmbeddedDataSpecification(
std::shared_ptr<IDataSpecificationContent> data_specification_content,
common::optional<
std::shared_ptr<IReference>
> data_specification = common::nullopt
std::shared_ptr<IReference> data_specification
);

ModelType model_type() const override;
Expand All @@ -10298,18 +10290,12 @@ class EmbeddedDataSpecification

// region Get and set data_specification_

const common::optional<
std::shared_ptr<IReference>
>& data_specification() const override;
const std::shared_ptr<IReference>& data_specification() const override;

common::optional<
std::shared_ptr<IReference>
>& mutable_data_specification() override;
std::shared_ptr<IReference>& mutable_data_specification() override;

void set_data_specification(
common::optional<
std::shared_ptr<IReference>
> value
std::shared_ptr<IReference> value
) override;

// endregion
Expand All @@ -10319,9 +10305,7 @@ class EmbeddedDataSpecification
private:
std::shared_ptr<IDataSpecificationContent> data_specification_content_;

common::optional<
std::shared_ptr<IReference>
> data_specification_;
std::shared_ptr<IReference> data_specification_;
};

class LevelType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5421,33 +5421,12 @@ void OfPathType::Execute() {
}

case 3: {
if (
MatchesRfc8089Path(
(*value_)
)
) {
state_ = 4;
continue;
}

error_ = common::make_unique<Error>(
L"The value must represent a valid file URI scheme according "
L"to RFC 8089."
);
// No path is prepended as the error refers to the value itself.
++index_;

state_ = 4;
return;
}

case 4: {
done_ = true;
error_ = nullptr;
index_ = -1;

// We invalidate the state since we reached the end of the routine.
state_ = 5;
state_ = 4;
return;
}

Expand Down Expand Up @@ -24262,7 +24241,7 @@ void OfDataSpecificationIec61360::Execute() {
}

error_ = common::make_unique<Error>(
L"Constraint AASc-002: preferred name shall be provided at "
L"Constraint AASc-3a-002: preferred name shall be provided at "
L"least in English."
);
// No path is prepended as the error refers to the instance itself.
Expand Down
Loading

0 comments on commit 0f7345e

Please sign in to comment.